Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -533,5 +538,6 @@ diff --git a/.github/workflows/documentation-commit.yml b/.github/workflows/documentation-commit.yml
index e8539577ce6b..d09f8178a470 100644
--- a/.github/workflows/documentation-commit.yml
+++ b/.github/workflows/documentation-commit.yml
@@ -60,7 +60,7 @@ jobs:
# try to build the documentation
sh ./build_openupgrade_docs
- name: Commit changes
- uses: EndBug/add-and-commit@v9
+ uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 #v9
with:
add: "docs"
default_author: github_actions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e8911142dd8c..a032e3ca565c 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -25,21 +25,22 @@ jobs:
PGPASSWORD: "odoo"
PGUSER: "odoo"
OPENUPGRADE_USE_DEMO: "yes"
+ services:
+ postgres:
+ image: postgres:14.0
+ env:
+ POSTGRES_USER: odoo
+ POSTGRES_PASSWORD: odoo
+ POSTGRES_DB: odoo
+ ports:
+ - 5432:5432
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- - name: Configure Postgres
- uses: harmon758/postgresql-action@v1
- with:
- postgresql version: "14"
- postgresql user: ${DB_USERNAME}
- postgresql password: ${DB_PASSWORD}
- - name: Wait / Sleep
- uses: jakejarvis/wait-action@v0.1.0
- with:
- time: "10s"
+ - name: Sleep for 10 seconds
+ run: sleep 10s
- name: DB Creation
run: createdb $DB
- name: DB Restore
@@ -96,6 +97,12 @@ jobs:
for snippet in openupgrade/openupgrade_scripts/scripts/*/*/tests/data*.py; do
odoo-old/odoo-bin shell -d $DB < $snippet
done
+ - name: Test end-migration script for newly installed module (i.e. "spreadsheet" for v16)
+ run: |
+ END_SCRIPT_TEST=openupgrade/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py
+ NEW_MODULE_SCRIPT_DIR=openupgrade/openupgrade_scripts/scripts/spreadsheet/16.0.1.0/
+ mkdir -p $NEW_MODULE_SCRIPT_DIR
+ cp $END_SCRIPT_TEST $NEW_MODULE_SCRIPT_DIR
- name: OpenUpgrade test
run: |
# select modules and perform the upgrade
diff --git a/README.md b/README.md
index 67eb848e571b..09dcdca07c5a 100644
--- a/README.md
+++ b/README.md
@@ -26,8 +26,8 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
-[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.0 | [](https://github.com/legalsylvain) [](https://github.com/StefanRijnhart) [](https://github.com/hbrunn) | Module to integrate in the server_wide_modules option to make upgrades between two major revisions.
-[openupgrade_scripts](openupgrade_scripts/) | 16.0.1.0.4 | | Module that contains all the migrations analysis and scripts for migrating Odoo SA modules.
+[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.1 |
| Module to integrate in the server_wide_modules option to make upgrades between two major revisions.
+[openupgrade_scripts](openupgrade_scripts/) | 16.0.1.0.5 | | Module that contains all the migrations analysis and scripts for migrating Odoo SA modules.
[//]: # (end addons)
diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst
index 62c0d70c66fa..99ee21b79cb6 100644
--- a/docsource/modules150-160.rst
+++ b/docsource/modules150-160.rst
@@ -8,7 +8,7 @@ Module coverage 15.0 -> 16.0
+=================================================+======================+=================================================+
| account |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| account_check_printing | |No DB layout changes. |
+| account_check_printing | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| account_debit_note |Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -76,7 +76,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| base_address_city | |Merged into base_address_extended. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| base_address_extended |Nothing to do | |
+| base_address_extended | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| base_automation |Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -274,7 +274,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_cz | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| l10n_de | | |
+| l10n_de | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| l10n_de_purchase | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -284,7 +284,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_de_skr03 | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| l10n_de_skr04 | | |
+| l10n_de_skr04 | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| l10n_de_stock | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -554,17 +554,17 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| mass_mailing_sale_sms | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| mass_mailing_slides |Nothing to do | |
+| mass_mailing_slides | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| mass_mailing_sms | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| |new| mass_mailing_themes | | |
+| |new| mass_mailing_themes | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| membership | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| microsoft_account | |No DB layout changes. |
+| microsoft_account | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| microsoft_calendar | |No DB layout changes. |
+| microsoft_calendar | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| microsoft_outlook | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -748,7 +748,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| repair | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| resource |Nothing to do | |
+| resource | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -790,7 +790,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale_purchase_stock |Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| sale_quotation_builder |Done | |
+| sale_quotation_builder | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale_sms | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -846,7 +846,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| stock |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| stock_account |Nothing to do | |
+| stock_account | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| stock_dropshipping | Nothing to do |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -990,7 +990,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_sale_product_configurator |Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| website_sale_slides |Done | |
+| website_sale_slides | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_sale_stock |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
@@ -1002,9 +1002,9 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_slides |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| website_slides_forum |Nothing to do | |
+| website_slides_forum | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
-| website_slides_survey |Done | |
+| website_slides_survey | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| website_sms | Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
diff --git a/openupgrade_framework/README.rst b/openupgrade_framework/README.rst
index 0f7a338d304c..5b2787a2bc64 100644
--- a/openupgrade_framework/README.rst
+++ b/openupgrade_framework/README.rst
@@ -1,3 +1,7 @@
+.. image:: https://odoo-community.org/readme-banner-image
+ :target: https://odoo-community.org/get-involved?utm_source=readme
+ :alt: Odoo Community Association
+
=====================
Openupgrade Framework
=====================
@@ -7,13 +11,13 @@ Openupgrade Framework
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:5b5aa97d1e9d7df96e3076992e0c0b2a86d4712d4ecc2dc56bf863600ac0684f
+ !! source digest: sha256:945275c27187090272d2b06ad20e5f5e1447983d05ac4a7d08e38f9b4aa0468f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
-.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2FOpenUpgrade-lightgray.png?logo=github
diff --git a/openupgrade_framework/__manifest__.py b/openupgrade_framework/__manifest__.py
index 550b052db116..9b160416253f 100644
--- a/openupgrade_framework/__manifest__.py
+++ b/openupgrade_framework/__manifest__.py
@@ -9,7 +9,7 @@
"maintainers": ["legalsylvain", "StefanRijnhart", "hbrunn"],
"website": "https://github.com/OCA/OpenUpgrade",
"category": "Migration",
- "version": "16.0.1.0.0",
+ "version": "16.0.1.0.1",
"license": "AGPL-3",
"depends": ["base"],
"images": ["static/description/banner.jpg"],
diff --git a/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py b/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py
index 4860c1d25645..3decbfbdc83e 100644
--- a/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py
+++ b/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py
@@ -86,3 +86,26 @@ def _raise_view_error(
NameManager.check = check
_raise_view_error._original_method = View._raise_view_error
View._raise_view_error = _raise_view_error
+
+
+def unlink(self):
+ """Remove the archived children of a view deleted with its module too.
+
+ The cascade of the core (under the module uninstall flag, which the end of
+ an update sets) goes through inherit_children_ids, which leaves out the
+ archived views (e.g. an option of the website editor turned off): their
+ foreign key then keeps the parent from being deleted, and the log shows
+ 'violates foreign key constraint ir_ui_view_inherit_id_fkey'.
+ """
+ if self.env.context.get("_force_unlink"):
+ archived = (
+ self.with_context(active_test=False).inherit_children_ids
+ - self.inherit_children_ids
+ )
+ if archived:
+ archived.unlink()
+ return unlink._original_method(self)
+
+
+unlink._original_method = View.unlink
+View.unlink = unlink
diff --git a/openupgrade_framework/odoo_patch/odoo/models.py b/openupgrade_framework/odoo_patch/odoo/models.py
index 1f008ec4667d..378e283ddb1e 100644
--- a/openupgrade_framework/odoo_patch/odoo/models.py
+++ b/openupgrade_framework/odoo_patch/odoo/models.py
@@ -21,16 +21,26 @@ def unlink(self):
"""
if not self.env.context.get(MODULE_UNINSTALL_FLAG):
return BaseModel.unlink._original_method(self)
- savepoint = str(uuid4)
+ savepoint = str(uuid4())
try:
self.env.cr.execute( # pylint: disable=sql-injection
'SAVEPOINT "%s"' % savepoint
)
- return BaseModel.unlink._original_method(self)
+ result = BaseModel.unlink._original_method(self)
+ # release it: a savepoint left open per deleted record keeps a
+ # transactionid lock until the end of the update, enough to exhaust
+ # the lock table of the cluster on a large update
+ self.env.cr.execute( # pylint: disable=sql-injection
+ 'RELEASE SAVEPOINT "%s"' % savepoint
+ )
+ return result
except Exception as e:
self.env.cr.execute( # pylint: disable=sql-injection
'ROLLBACK TO SAVEPOINT "%s"' % savepoint
)
+ self.env.cr.execute( # pylint: disable=sql-injection
+ 'RELEASE SAVEPOINT "%s"' % savepoint
+ )
_logger.warning(
"Could not delete obsolete record with ids %s of model %s: %s",
self.ids,
diff --git a/openupgrade_framework/odoo_patch/odoo/modules/migration.py b/openupgrade_framework/odoo_patch/odoo/modules/migration.py
index 675f22e7dc24..6a815143b1e0 100644
--- a/openupgrade_framework/odoo_patch/odoo/modules/migration.py
+++ b/openupgrade_framework/odoo_patch/odoo/modules/migration.py
@@ -21,6 +21,11 @@ def migrate_module(self, pkg, stage):
module_scripts = {}
if to_install:
pkg.state = "to upgrade"
+ # end scripts: the state Odoo looks at is the one the module was loaded with
+ load_state_to_install = getattr(pkg, "load_state", False)
+ if load_state_to_install == "to install":
+ pkg.load_state = "to upgrade"
+ if to_install or load_state_to_install == "to install":
for key in ("module", "module_upgrades"):
if key in self.migrations[pkg.name]:
module_scripts[key] = self.migrations[pkg.name][key]
@@ -32,6 +37,9 @@ def migrate_module(self, pkg, stage):
finally:
if to_install:
pkg.state = "to install"
+ if load_state_to_install == "to install":
+ pkg.load_state = "to install"
+ if module_scripts:
self.migrations[pkg.name].update(module_scripts)
diff --git a/openupgrade_framework/static/description/index.html b/openupgrade_framework/static/description/index.html
index bbaf2d261e66..bff009a5d0cb 100644
--- a/openupgrade_framework/static/description/index.html
+++ b/openupgrade_framework/static/description/index.html
@@ -3,7 +3,7 @@
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:
@@ -417,12 +422,12 @@This module does not need to be installed on a database. It simply needs to be available via your addons-path.
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.
@@ -485,7 +490,7 @@Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -493,9 +498,9 @@
Do not contact contributors directly about support or help with technical issues.
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.