Skip to content

Commit

Permalink
添加openupgrade_framework代码OCA#4327
Browse files Browse the repository at this point in the history
parent c973596
author 张飞虎 <feihu.zhang@yumtown.com.cn> 1711431231 +0000
committer 张飞虎 <feihu.zhang@yumtown.com.cn> 1717058855 +0000

parent c973596
author 张飞虎 <feihu.zhang@yumtown.com.cn> 1711431231 +0000
committer 张飞虎 <feihu.zhang@yumtown.com.cn> 1717058818 +0000

添加openupgrade_framework代码OCA#4327

增加upgrade_anaylysis_work.txt

init base migration script

初步完成base模块的升级脚本

初步添加account模块升级脚本

修复文件名错误

BUG Fix

增加mail模块升级脚本

完成mail升级脚本

初步添加hr升级脚本

完成hr模块升级脚本

完成account模块升级脚本

更新模块清单

添加sale_management升级脚本

修复升级问题

完善project模块升级脚本

增加一堆模块no_update的处理

BUG Fix

暂时移除delivery升级脚本

改进项目升级脚本

添加针对hr_responsible_id字段的处理

增加auth_signup升级脚本

修复mail_alias上的mail_channel数据

添加openupgrade_framework代码OCA#4327

parent c973596
author 张飞虎 <feihu.zhang@yumtown.com.cn> 1711431231 +0000
committer 张飞虎 <feihu.zhang@yumtown.com.cn> 1717058855 +0000

parent c973596
author 张飞虎 <feihu.zhang@yumtown.com.cn> 1711431231 +0000
committer 张飞虎 <feihu.zhang@yumtown.com.cn> 1717058818 +0000

添加openupgrade_framework代码OCA#4327

增加upgrade_anaylysis_work.txt

init base migration script

初步完成base模块的升级脚本

初步添加account模块升级脚本

修复文件名错误

BUG Fix

增加mail模块升级脚本

完成mail升级脚本

初步添加hr升级脚本

完成hr模块升级脚本

完成account模块升级脚本

更新模块清单

添加sale_management升级脚本

修复升级问题

完善project模块升级脚本

增加一堆模块no_update的处理

BUG Fix

暂时移除delivery升级脚本

改进项目升级脚本

添加针对hr_responsible_id字段的处理

增加auth_signup升级脚本

修复mail_alias上的mail_channel数据
  • Loading branch information
张飞虎 committed May 30, 2024
1 parent be57432 commit 93a53bc
Show file tree
Hide file tree
Showing 160 changed files with 7,522 additions and 4,139 deletions.
182 changes: 91 additions & 91 deletions docsource/modules160-170.rst

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions openupgrade_framework/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* call your odoo instance with the option ``--load=base,web,openupgrade_framework``

or

* add the key to your configuration file:

.. code-block:: shell
[options]
server_wide_modules = web,openupgrade_framework
When you load the module in either way of these ways, and you have the
`openupgrade_scripts` module in your addons path available, the
`--upgrade-path` option of Odoo will be set automatically to the location
of the OpenUpgrade migration scripts.
2 changes: 2 additions & 0 deletions openupgrade_framework/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Stefan Rijnhart <stefan@opener.amsterdam>
* Sylvain LE GAL <https://twitter.com/legalsylvain>
4 changes: 4 additions & 0 deletions openupgrade_framework/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Many developers have contributed to the OpenUpgrade framework in its previous
incarnation. Their original contributions may no longer needed, or they are
no longer recognizable in their current form but OpenUpgrade would not have
existed at this point without them.
27 changes: 27 additions & 0 deletions openupgrade_framework/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This module is a technical module that contains a number of monkeypatches
to improve the behaviour of Odoo when migrating your database using the
OpenUpgrade migration scripts:

* Prevent dropping columns or tables in the database when fields or models
are obsoleted in the Odoo data model of the target release. After the
migration, you can review and delete unused database tables and columns
using `database_cleanup`. See
https://odoo-community.org/shop/product/database-cleanup-918
* When data records are deleted during the migration (such as views or other
system records), this is done in a secure mode. If the deletion fails because
of some unforeseen dependency, the deletion will be cancelled and a message
is logged, after which the migration continues.
* Prevent a number of log messages that do not apply when using OpenUpgrade.
* Suppress log messages about failed view validation, which are to be expected
during a migration.
* Run migration scripts for modules that are installed as new dependencies
of upgraded modules (when there are such scripts for those particular
modules)
* Production databases generated with demo data, will be transformed to
non-demo ones. If you want to avoid that, you have to pass through the
environment variable OPENUPGRADE_USE_DEMO, the value "yes".

For detailed documentation see:

* https://github.com/OCA/OpenUpgrade/
* https://oca.github.io/OpenUpgrade
52 changes: 52 additions & 0 deletions openupgrade_framework/readme/DEVELOP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
The `odoo_patch` folder contains python files in a tree that mimicks the
folder tree of the Odoo project. It contains a number of monkey patches
to improve the migration of an Odoo database between two major versions.

So far, we are able to make everything work without overwriting large blocks
of code, but if larger patches need to be added, please use the method
described below:

To see the patches added, you can use ``meld`` tools:

``meld PATH_TO_ODOO_FOLDER/odoo/ PATH_TO_OPENUPGRADE_FRAMEWORK_MODULE/odoo_patch``


To make more easy the diff analysis :

* Make sure the python files has the same path as the original one.

* Keep the same indentation as the original file. (using ``if True:`` if required)

* Add the following two lines at the beginning of your file, to avoid flake8 / pylint
errors

.. code-block:: python
# flake8: noqa
# pylint: skip-file
* When you want to change the code. add the following tags:

For an addition:

.. code-block:: python
# <OpenUpgrade:ADD>
some code...
# </OpenUpgrade>
For a change:

.. code-block:: python
# <OpenUpgrade:CHANGE>
some code...
# </OpenUpgrade>
For a removal:

.. code-block:: python
# <OpenUpgrade:REMOVE>
# Comment the code, instead of removing it.
# </OpenUpgrade>
2 changes: 2 additions & 0 deletions openupgrade_framework/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module does not need to be installed on a database.
It simply needs to be available via your ``addons-path``.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added openupgrade_framework/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 93a53bc

Please sign in to comment.