Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
9fef207
[16.0][FIX] openupgrade_framework : end-migration scripts are forced …
metaminux Aug 18, 2023
c2f89a6
[IMP] add tests for end migration scripts for newly installed modules
metaminux Aug 25, 2023
a3ad701
[OU-ADD] base_address_extended
etobella Mar 20, 2025
e04e9f5
Merge pull request #4868 from dixmit/16.0-add-base_address
MiquelRForgeFlow Mar 26, 2025
e79737d
[IMP] docsource: mark base_address_extended as done
MiquelRForgeFlow Mar 26, 2025
ea113b5
[OU-ADD] l10n_es: Add migration stcripts for the merge of IRNR taxes …
etobella Mar 29, 2025
eb64555
Merge pull request #4893 from dixmit/16.0-irnr
pedrobaeza Mar 30, 2025
4bc61a8
[IMP] pin random github actions to their SHA commit
hbrunn Mar 31, 2025
834d28c
Merge pull request #4903 from hbrunn/16.0-pin-external-actions
pedrobaeza Mar 31, 2025
0570f55
[OU-ADD] account_check_printing: Nothing to do
CarlosRoca13 Apr 1, 2025
14f0f89
[OU-FIX] sale_timesheet: Update security rule according to Odoo changes
carlos-lopez-tecnativa Apr 1, 2025
d6d56d8
Merge pull request #4911 from Tecnativa/16.0-fix-sale_timesheet
pedrobaeza Apr 1, 2025
e4a796c
Merge pull request #4909 from Tecnativa/16.0-MIG-account_check_printing
pedrobaeza Apr 1, 2025
a9d7ff2
[OU-ADD] survey_placeholder: Merge into survey
pilarvargas-tecnativa Apr 10, 2025
594b649
Merge pull request #4922 from Tecnativa/16.0-mig-survey_placeholder
pedrobaeza Apr 10, 2025
e6121c1
[OU-ADD] apriori: 'product_packaging_type' renamed to 'product_packag…
Apr 30, 2025
f57a29d
[OU-ADD] apriori: 'sale_by_packaging' renamed to 'sell_only_by_packag…
Apr 30, 2025
0e02216
[OU-ADD] website_sale_slides: Migration to 16.0
carlos-lopez-tecnativa May 6, 2025
f237b12
[OU-ADD] mass_mailing_slides : Nothing to do
carlos-lopez-tecnativa May 6, 2025
c158fd4
Merge pull request #4981 from Tecnativa/16.0-mig-mass_mailing_slides
MiquelRForgeFlow May 6, 2025
4fd6181
[OU-ADD] sale_quotation_builder : Nothing to do
carlos-lopez-tecnativa May 6, 2025
44ea2ff
Merge pull request #4982 from Tecnativa/16.0-mig-sale_quotation_builder
pedrobaeza May 6, 2025
8eac956
Merge pull request #4979 from Tecnativa/16.0-mig-website_sale_slides
pedrobaeza May 6, 2025
89fa306
[16.0][OU-FIX] hr: create_work_contact skip partners without work_ema…
FernandoRomera May 7, 2025
3eecfd0
Merge pull request #4985 from FernandoRomera/16.0-fromera-openupgrade…
pedrobaeza May 7, 2025
17a8f6e
[OU-ADD] l10n_de: Nothing to do
pedrobaeza May 7, 2025
cf08137
Merge pull request #4989 from Tecnativa/16.0-ou_add-l10n_de
pedrobaeza May 7, 2025
ffd8909
[OU-ADD] l10n_de_skr04: Nothing to do
pedrobaeza May 7, 2025
8659ac0
Merge pull request #4993 from Tecnativa/16.0-ou_add-l10n_de_skr04
pedrobaeza May 7, 2025
1a6c234
[OU-ADD] website_slides_survey: Migration to 16.0
carlos-lopez-tecnativa May 6, 2025
c3cc58e
[OU-IMP] website_slides: Finish migration scripts
carlos-lopez-tecnativa May 7, 2025
62b9e7b
Merge pull request #4980 from Tecnativa/16.0-mig-website_slides_survey
pedrobaeza May 7, 2025
dac0d0b
[OU-IMP] analytic: Define the appropriate value for the root_plan_id …
victoralmau May 14, 2025
b35e08f
[OU-FIX] hr: Avoid creating work contacts without data (email + phone)
victoralmau May 16, 2025
8222e46
Merge pull request #5043 from Tecnativa/16.0-ou-fix-hr-TT56359
pedrobaeza May 20, 2025
3e4efd3
[OU-ADD website_slides_forum: Nothing to do
pedrobaeza May 24, 2025
968eb5e
Merge pull request #5051 from Tecnativa/16.0-ou_add-website_slides_forum
pedrobaeza May 24, 2025
598f47a
Merge pull request #5033 from Tecnativa/16.0-ou-imp-analytic-root_pla…
pedrobaeza May 24, 2025
d2138d1
[OU-ADD] microsoft_account : Nothing to do
carlos-lopez-tecnativa May 26, 2025
0b9e6c8
[OU-ADD] microsoft_calendar : Nothing to do
carlos-lopez-tecnativa May 26, 2025
00016ec
Merge pull request #5063 from Tecnativa/16.0-mig-microsoft_account
MiquelRForgeFlow May 26, 2025
a71ab99
Merge pull request #5064 from Tecnativa/16.0-mig-microsoft_calendar
MiquelRForgeFlow May 26, 2025
aa9db9f
[FIX] apriori: delete extra space in a key entry
MiquelRForgeFlow May 29, 2025
a975643
Merge pull request #5077 from ForgeFlow/16.0-fix-apriori
MiquelRForgeFlow May 29, 2025
c0dedab
[16.0][OU-FIX] base_address_extended: regexp fix
rvalyi May 10, 2025
b5bea36
Merge pull request #5078 from ForgeFlow/16.0-base_address_extended-fix
MiquelRForgeFlow Jun 3, 2025
8469c1b
[UPD] addons table in README.md
OCA-git-bot Jun 3, 2025
dc0be13
[OU-ADD] repair: Migration scripts for v16
remi-filament Feb 14, 2024
381caca
Merge pull request #4302 from lefilament/16.0-add-repair
pedrobaeza Jun 12, 2025
380824d
Merge PR #4107 into 16.0
OCA-git-bot Jul 15, 2025
e5653f9
[BOT] post-merge updates
OCA-git-bot Jul 15, 2025
4347c4e
[MIG] l10n_it_riba: Rename to l10n_it_riba_oca
monen17 Jul 25, 2025
7748164
[OU-FIX] website: Exclude survey models from BS conversion
pedrobaeza Jul 25, 2025
de6bfad
Merge pull request #5210 from Tecnativa/16.0-ou_fix-website-survey
pedrobaeza Jul 25, 2025
4591d66
[OU-FIX] website: Exclude forum from BS conversion
pedrobaeza Jul 25, 2025
7acabf0
Merge pull request #5215 from Tecnativa/16.0-ou_fix-website-forum
pedrobaeza Jul 25, 2025
f92284a
[OU-FIX] website: Do BS conversion with sanitization override
pedrobaeza Jul 26, 2025
d93ec5b
[OU-FIX] website: Add website editors to sanitization override group
pedrobaeza Jul 26, 2025
e441ce2
Merge pull request #5216 from Tecnativa/16.0-ou_fix-website-sanitize
pedrobaeza Jul 26, 2025
a7afdee
[OU-IMP] base: Pre-create res.partner~company_registry
pedrobaeza Aug 12, 2025
3dce53b
Merge pull request #5297 from Tecnativa/16.0-ou_imp-base-company_regi…
pedrobaeza Aug 12, 2025
b9f3f14
[OU-FIX] purchase_requisition: Proper order group creation (and globa…
pedrobaeza Aug 14, 2025
4af8572
Merge pull request #5312 from Tecnativa/16.0-ou_fix-purchase_requisition
pedrobaeza Aug 15, 2025
2fd4903
Merge pull request #4964 from camptocamp/16-apriori-renamed-modules
MiquelRForgeFlow Aug 31, 2025
92d4387
[OU-IMP] account: performance
FernandoRomera Sep 2, 2025
ec09c12
Merge pull request #5357 from FernandoRomera/16.0-fromera-openupgrade…
pedrobaeza Sep 3, 2025
bc6a9fa
[FIX] Crash when company_registry already exists on res_partner
alexis-via Oct 2, 2025
a888723
Merge pull request #5393 from akretion/16-fix-res_partner-company_reg…
MiquelRForgeFlow Oct 8, 2025
f47c054
[OU-ADD] queue_job_context: Merged into queue_job
carlos-lopez-tecnativa Oct 15, 2025
d38e3d7
Merge pull request #5403 from Tecnativa/16.0-ou_add-queue_job_context
pedrobaeza Oct 15, 2025
694dbee
[OU-ADD] apriori: pos_cashback_warning renamed into pos_cashback
legalsylvain Feb 21, 2025
aab68a9
[OU-ADD] apriori: account_bank_statement_reopen_skip_undo_reconciliat…
david-banon-tecnativa Feb 12, 2026
efa01ea
Merge pull request #5517 from Tecnativa/16.0-ou-add-account_bank_stat…
pedrobaeza Feb 12, 2026
2aa6877
[ADD] pos_sale_order_load renamed into pos_picking_load.
legalsylvain Apr 28, 2026
fafc9d6
Merge pull request #5607 from grap/16.0-ADD-pos_picking_load-SLG
pedrobaeza May 4, 2026
fe6141f
Merge pull request #5199 from monen17/patch-1
MiquelRForgeFlow May 8, 2026
dc9556d
[FIX] fix pos.session cash register amounts
huguesdk May 22, 2026
ad4713d
Merge pull request #5668 from coopiteasy/16.0-fix-point_of_sale-pos_s…
pedrobaeza May 22, 2026
bd206f0
[IMP] account: migrate bank statement chatter attachments to attachme…
CarlosRoca13 Jun 12, 2026
981cb52
Merge pull request #5714 from Tecnativa/16.0-MIG-account-attachments
pedrobaeza Jun 13, 2026
185652f
[IMP] base: Load additional renames/merges from env.
david-banon-tecnativa Jul 7, 2026
065da75
Merge pull request #5776 from Tecnativa/16.0-imp-base-external_merges
pedrobaeza Jul 7, 2026
6054982
[OU-ADD] mass_mailing_themes: Nothing to do
pilarvargas-tecnativa Jul 9, 2026
89aeed4
Merge pull request #5801 from Tecnativa/16.0-ou-add-mass_mailing_themes
MiquelRForgeFlow Jul 9, 2026
dccee82
[IMP] point_of_sale: remove 15.0 noupdate rule
jguenat Jul 15, 2026
20a6a87
Merge pull request #5826 from jguenat/16.0-pos-remove_noupdate_ir_rule
MiquelRForgeFlow Jul 21, 2026
928b51d
[OU-IMP] website: reset unmodified COW templates to upstream
cristina-hidalgo-tecnativa Sep 4, 2026
d40bbb5
Merge pull request #5967 from Tecnativa/16.0-ou-imp-website-cow_views
pedrobaeza Sep 5, 2026
bc7e053
Merge remote-tracking branch 'OCA/16.0' into v16_v3tech_upgrade
royle-vietnam Oct 2, 2026
93eef0e
[IMP] base: delete the technical records of the modules removed witho…
royle-vietnam Sep 29, 2026
d03d93d
[FIX] openupgrade_framework: delete the archived children of a remove…
royle-vietnam Sep 30, 2026
f915c3c
[FIX] openupgrade_framework: release the savepoint of each obsolete r…
royle-vietnam Oct 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/documentation-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.0 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![hbrunn](https://github.com/hbrunn.png?size=30px)](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 | <a href='https://github.com/legalsylvain'><img src='https://github.com/legalsylvain.png' width='32' height='32' style='border-radius:50%;' alt='legalsylvain'/></a> <a href='https://github.com/StefanRijnhart'><img src='https://github.com/StefanRijnhart.png' width='32' height='32' style='border-radius:50%;' alt='StefanRijnhart'/></a> <a href='https://github.com/hbrunn'><img src='https://github.com/hbrunn.png' width='32' height='32' style='border-radius:50%;' alt='hbrunn'/></a> | 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)

Expand Down
28 changes: 14 additions & 14 deletions docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand All @@ -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. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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 | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -748,7 +748,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| repair | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| resource |Nothing to do | |
| resource | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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 | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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 | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand All @@ -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 | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
8 changes: 6 additions & 2 deletions openupgrade_framework/README.rst
Original file line number Diff line number Diff line change
@@ -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
=====================
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openupgrade_framework/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 12 additions & 2 deletions openupgrade_framework/odoo_patch/odoo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading
Loading