Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
6dce086
[OU-ADD] pos_sale : Nothing to do
carlos-lopez-tecnativa Aug 14, 2025
cd1ae7e
Merge pull request #5311 from Tecnativa/17.0-ou-add-pos_sale
pedrobaeza Aug 14, 2025
7200597
[OU-FIX] l10n_de_mis_*_report: Rename XML-IDs pre-merge
pedrobaeza Aug 15, 2025
03bd8c9
Merge pull request #5314 from Tecnativa/17.0-ou-fix-l10n_de_mis_repor…
pedrobaeza Aug 15, 2025
b3dca53
[OU-ADD] pos_restaurant: Migration to 17.0
carlos-lopez-tecnativa Aug 14, 2025
c62af45
[OU-IMP] point_of_sale: correct implementation of the last_order_prep…
carlos-lopez-tecnativa Aug 18, 2025
cb5682d
[OU-ADD] pos_epson_printer : Nothing to do
carlos-lopez-tecnativa Aug 18, 2025
4f44919
[OU-ADD] pos_hr_restaurant : Nothing to do
carlos-lopez-tecnativa Aug 18, 2025
40642b9
Merge pull request #5315 from Tecnativa/17.0-ou-add-pos_epson_printer
pedrobaeza Aug 18, 2025
176b35b
Merge pull request #5316 from Tecnativa/17.0-ou-add-pos_hr_restaurant
pedrobaeza Aug 18, 2025
911fb0a
Merge pull request #5313 from Tecnativa/17.0-ou-add-pos_restaurant
pedrobaeza Aug 20, 2025
e07a76d
[OU-ADD] sale_stock_margin: Nothing to do
carlos-lopez-tecnativa Aug 22, 2025
5c9f9ab
[OU-ADD] pos_mrp: Nothing to do
carlos-lopez-tecnativa Aug 22, 2025
67c9b6c
[OU-ADD] website_crm_livechat: Nothing to do
carlos-lopez-tecnativa Aug 22, 2025
9a5e439
[OU-ADD] website_sale_picking: Migration scripts
carlos-lopez-tecnativa Aug 22, 2025
1ad6c28
Merge pull request #5328 from Tecnativa/17.0-ou-add-sale_stock_margin
pedrobaeza Aug 23, 2025
b4843f1
Merge pull request #5329 from Tecnativa/17.0-ou-add-pos_mrp
pedrobaeza Aug 23, 2025
a63dc5d
Merge pull request #5330 from Tecnativa/17.0-ou-add-website_crm_livechat
pedrobaeza Aug 23, 2025
24dcb3e
Merge pull request #5331 from Tecnativa/17.0-ou-add-website_sale_picking
pedrobaeza Aug 23, 2025
1beb458
[OU-ADD] web_editor: Move custom assets
etobella Aug 25, 2025
61d508b
[OU-ADD] pos_epson_printer_restaurant: Migration to 17.0
carlos-lopez-tecnativa Aug 22, 2025
3e7ff1b
Merge pull request #5327 from Tecnativa/17.0-ou-add-pos_epson_printer…
pedrobaeza Aug 25, 2025
8399487
[OU-ADD] spreadsheet_dashboard_im_livechat: Nothing to do
pedrobaeza Aug 26, 2025
ea06db6
Merge pull request #5351 from Tecnativa/17.0-ou_add-spreadsheet_dashb…
pedrobaeza Aug 26, 2025
5e1aa62
Merge pull request #5346 from dixmit/17.0-assets
pedrobaeza Aug 28, 2025
b097c5d
[OU-FIX] account: Use migrate_translations_to_jsonb to migrate transl…
victoralmau Aug 27, 2025
2a8b5d2
Merge PR #5355 into 17.0
OCA-git-bot Sep 8, 2025
03827ee
[OU-FIX] account: Avoid the error when executing the migrate_translat…
victoralmau Sep 9, 2025
fd8e091
Merge pull request #5369 from Tecnativa/17.0-ou-fix-account-TT57778-v2
pedrobaeza Sep 11, 2025
7294531
[OU-FIX] account: Remove the unnecessary _convert_account_tax_descrip…
victoralmau Sep 15, 2025
1fa8d7c
Merge pull request #5377 from Tecnativa/17.0-ou-fix-account-TT57778-v3
pedrobaeza Sep 15, 2025
ad52095
[OU-IMP] maintenance: Compatibility with maintenance_plan
victoralmau Sep 25, 2025
31939fc
Merge pull request #5387 from Tecnativa/17.0-ou-imp-maintenance-maint…
pedrobaeza Sep 25, 2025
19dc8e1
[OU-ADD] auth_ldap: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
a655bae
[OU-ADD] l10n_latam_base: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
4866ed6
[OU-ADD] l10n_latam_invoice_document: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
c595708
[OU-ADD] account_debit_note: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
0794d61
[OU-ADD] account_fleet: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
fca766b
[OU-ADD] website_sale_product_configurator: Nothing to do
carlos-lopez-tecnativa Oct 22, 2025
c444830
Merge pull request #5417 from Tecnativa/17.0-ou-add-website_sale_prod…
pedrobaeza Oct 22, 2025
d34f0f3
Merge pull request #5415 from Tecnativa/17.0-ou-add-account_debit_note
pedrobaeza Oct 22, 2025
31994ce
Merge pull request #5413 from Tecnativa/17.0-ou-add-l10n_latam_base
pedrobaeza Oct 23, 2025
10795fc
Merge pull request #5416 from Tecnativa/17.0-ou-add-account_fleet
pedrobaeza Oct 23, 2025
4232c49
Merge pull request #5412 from Tecnativa/17.0-ou-add-auth_ldap
pedrobaeza Oct 23, 2025
a72ced3
Merge pull request #5414 from Tecnativa/17.0-ou-add-l10n_latam_invoic…
pedrobaeza Oct 23, 2025
ab225bb
[OU-ADD] spreadsheet_dashboard_pos_hr: Nothing to do
pedrobaeza Nov 17, 2025
00f3890
Merge pull request #5454 from Tecnativa/17.0-ou_add-spreadsheet_dashb…
pedrobaeza Nov 18, 2025
bb0cf4b
[OU-ADD] pos_sale_product_configurator: Nothing to do
pedrobaeza Nov 18, 2025
f37e4f9
Merge pull request #5456 from Tecnativa/18.0-ou_add-pos_sale_product_…
pedrobaeza Nov 18, 2025
7b0ce92
[OU-ADD] l10n_es_pos: Renamed to l10n_es_pos_oca
pedrobaeza Nov 26, 2025
4a07782
[PERF] account: optimize migration performance by pre-creating column
royle-vietnam Dec 5, 2025
3e483a4
Merge pull request #5465 from royle-vietnam/v17_imp_account_oca
pedrobaeza Dec 5, 2025
6f05c71
[FIX] sale: move deposit_default_product_id setting from
royle-vietnam Dec 10, 2025
a8144e5
Merge pull request #5468 from royle-vietnam/v17_fix_sale_oca
pedrobaeza Dec 12, 2025
cc25748
[OU-IMP] hr: Add computation of some fields
etobella Dec 1, 2025
78e3767
Merge pull request #5463 from dixmit/17.0-hr-imp
pedrobaeza Dec 12, 2025
fe4cc24
[OU-FIX] base: Cover private contact with no name
pedrobaeza Dec 13, 2025
5da9ed6
Merge pull request #5473 from Tecnativa/17.0-ou_fix-base-private_cont…
pedrobaeza Dec 13, 2025
385af7a
[OU-ADD] l10n_pt: Migration scripts
pedrobaeza Dec 27, 2025
b675566
Merge pull request #5478 from Tecnativa/17.0-ou_add-l10n_pt
pedrobaeza Dec 27, 2025
f1bc4c2
[OU-IMP] hr: Private data use mobile
pedrobaeza Feb 10, 2026
148fb2f
Merge pull request #5511 from Tecnativa/17.0-ou_imp-hr-private_cleaning
pedrobaeza Feb 10, 2026
ddc8873
[OU-ADD] product_email_template: Nothing to do
david-banon-tecnativa Feb 10, 2026
fae1e4b
[OU-ADD] pos_discount: Nothing to do
david-banon-tecnativa Feb 10, 2026
de14610
Merge pull request #5512 from Tecnativa/17.0-ou-add-product_email_tem…
pedrobaeza Feb 12, 2026
a26e578
Merge pull request #5514 from Tecnativa/17.0-ou-add-pos_discount
pedrobaeza Feb 12, 2026
cef29d9
[OU-ADD] spreadsheet_dashboard: Asing new group to Settings users
christian-ramos-tecnativa Feb 19, 2026
29bfed4
Merge pull request #5523 from Tecnativa/17.0-ou-spreadsheet_dashboard
pedrobaeza Feb 19, 2026
7f19134
[OU-ADD] l10n_co: Migration scripts
david-banon-tecnativa Feb 23, 2026
8713ed9
[OU-ADD] l10n_pe: Migration scripts
david-banon-tecnativa Feb 23, 2026
1862615
[OU-ADD] l10n_fr: Migration scripts
remi-filament Feb 23, 2026
2ade21a
Merge pull request #5530 from Tecnativa/17.0-ou-add-l10n_co
pedrobaeza Feb 23, 2026
c154451
Merge pull request #5532 from Tecnativa/17.0-ou-add-l10n_pe
pedrobaeza Feb 23, 2026
bd11972
[OU-FIX] l10n_co: Wrong field name
david-banon-tecnativa Feb 24, 2026
c53b4b7
Merge pull request #5535 from Tecnativa/17.0-ou-fix-l10n_co
pedrobaeza Feb 24, 2026
e5fc004
[OU-ADD] l10n_mx: Migration scripts
david-banon-tecnativa Feb 23, 2026
964c369
[OU-ADD] l10n_fr_hr_holidays: Migration scripts
remi-filament Feb 25, 2026
1360408
Merge pull request #5534 from Tecnativa/17.0-ou-add-l10n_mx
pedrobaeza Feb 26, 2026
a69acfb
[OU-IMP] mail_template_multi_attachment: Merge into mail
david-banon-tecnativa Feb 25, 2026
7ac8b00
Merge pull request #5540 from Tecnativa/17.0-ou-imp-mail_template_mul…
pedrobaeza Feb 26, 2026
d67274e
[OU-FIX] l10n_mx: Add missing tags to safely remove
pedrobaeza Mar 3, 2026
ed5692c
Merge pull request #5550 from Tecnativa/17.0-ou_fix-l10n_mx
pedrobaeza Mar 3, 2026
2a00364
[FIX] account: Only set res_field=invoice_pdf_report_file on customer…
alexis-via Mar 4, 2026
d318996
Merge pull request #5551 from akretion/17-account-fix_attachment-invo…
pedrobaeza Mar 5, 2026
895aec5
Merge PR #5533 into 17.0
OCA-git-bot Mar 16, 2026
860f20c
[IMP] apriori: rename mail_template_attachment_i18n
MiquelRForgeFlow Apr 16, 2026
f9f4006
Merge pull request #5591 from ForgeFlow/17.0-mig-mail_template_attach…
MiquelRForgeFlow Apr 16, 2026
c93597d
[17.0][FIX] stock: prefill picked for done moves to avoid massive rec…
aneavanzosc Apr 23, 2026
14b556d
[IMP] stock: apply pre-commit fixes
aneavanzosc Apr 23, 2026
09153ae
[IMP] stock: prefill picked using add_columns with default True
aneavanzosc Apr 24, 2026
0e563f2
Merge pull request #5600 from aneavanzosc/17.0-stock
pedrobaeza Apr 28, 2026
1425153
[FIX] docsource: mark as done merged done modules
MiquelRForgeFlow May 6, 2026
1bae96f
Merge pull request #5614 from ForgeFlow/17.0-mig-more
MiquelRForgeFlow May 6, 2026
cb8fd36
[MIG] project_hr_expense: nothing to do
MiquelRForgeFlow May 7, 2026
83c0120
[MIG] project_sale_expense: nothing to do
MiquelRForgeFlow May 7, 2026
5aec356
[MIG] sale_project_stock: nothing to do
MiquelRForgeFlow May 7, 2026
4ab221d
Merge PR #5616 into 17.0
OCA-git-bot May 7, 2026
7b061ce
[FIX] stock: picked not synchronized between stock.move and stock.mov…
CarlosRoca13 Jun 24, 2026
61715ec
Merge pull request #5749 from Tecnativa/17.0-fix-stock-picked_not_syn…
pedrobaeza Jun 24, 2026
ae5c387
[FIX] don't set install_filename when loading views from openupgrade_…
hbrunn Nov 7, 2025
f0257a9
Merge pull request #5754 from aurelien-tempo/17.0
pedrobaeza Jun 30, 2026
eaecad0
[FIX] openupgrade_framework: Allow missing path_info
pedrobaeza Jul 1, 2026
f6e178e
Merge pull request #5764 from Tecnativa/17.0-fix-openupgrade_framewor…
pedrobaeza Jul 1, 2026
abbb443
[IMP] base: Load additional renames/merges from env.
david-banon-tecnativa Jul 7, 2026
0da3937
Merge pull request #5775 from Tecnativa/17.0-imp-base-external_merges
pedrobaeza Jul 7, 2026
4ee8f18
[OU-ADD] mass_mailing_themes: Nothing to do
pilarvargas-tecnativa Jul 9, 2026
e825b59
Merge pull request #5799 from Tecnativa/17.0-ou-add-mass_mailing_themes
MiquelRForgeFlow Jul 9, 2026
292aa7d
[OU-ADD] project_list: Merged into project
rrebollo Jul 9, 2026
c8f4806
Merge pull request #5804 from BinhexTeam/17.0-ou-add-project_list-merged
pedrobaeza Jul 9, 2026
a00c02e
[OU-IMP] stock: Create and pre-compute stock.move.line~quantity_produ…
pedrobaeza Aug 13, 2026
7cbe356
Merge pull request #5908 from Tecnativa/17.0-ou-imp-stock
pedrobaeza Aug 13, 2026
036b3c5
[OU-IMP] point_of_sale: Set the appropriate value for point_of_sale.l…
victoralmau Aug 14, 2026
2f87030
Merge pull request #5911 from Tecnativa/17.0-ou-imp-point_of_sale-TT6…
pedrobaeza Aug 14, 2026
b0f4297
[IMP] website: activate default header for websites using deprecated
hbrunn Aug 26, 2026
7532f7f
[IMP] apriori: base_vat_optional_vies -> base_vat
MiquelRForgeFlow Sep 3, 2026
9600bc2
[OU-IMP] website: reset unmodified COW templates to upstream
cristina-hidalgo-tecnativa Sep 4, 2026
946f938
Merge pull request #5966 from Tecnativa/17.0-ou-imp-website-cow_views
pedrobaeza Sep 5, 2026
4e89799
Merge pull request #5962 from ForgeFlow/17.0-mig-base_vat_optional_vies
MiquelRForgeFlow Sep 8, 2026
540dff0
Merge pull request #5946 from hbrunn/17.0-website-deprecated-headers
pedrobaeza Sep 22, 2026
f390822
Merge pull request #5539 from lefilament/17.0-add-l10n_fr_hr_holidays
pedrobaeza Sep 22, 2026
81f6d38
Merge remote-tracking branch 'OCA/17.0' into v17_v3tech_upgrade
royle-vietnam Oct 2, 2026
19cf7cc
[IMP] base: delete the technical records of the modules removed witho…
royle-vietnam Sep 29, 2026
8adc8b6
[FIX] apriori: to_mail_notif_and_email is back in 17.0, to_uom_subscr…
royle-vietnam Sep 30, 2026
38b3e03
[OU-FIX] payment: move the 9.0 payment_method table out of the way
royle-vietnam Sep 30, 2026
4e9213e
[OU-FIX] hr: keep a private address typed as the contact name
royle-vietnam Sep 30, 2026
4f3398c
[FIX] openupgrade_framework: delete the archived children of a remove…
royle-vietnam Sep 30, 2026
e963498
[OU-FIX] hr_attendance: drop the links the target group has before th…
royle-vietnam Sep 30, 2026
41b8c0f
[OU-FIX] payment_custom: a payment method of its own for each custom …
royle-vietnam Sep 30, 2026
b9b40db
[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
228 changes: 114 additions & 114 deletions docsource/modules160-170.rst

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from odoo import api
from odoo.exceptions import ValidationError
from odoo.modules.module import get_resource_from_path
from odoo.tools import mute_logger

from odoo.addons.base.models.ir_ui_view import NameManager, View
Expand Down Expand Up @@ -85,6 +86,22 @@ def _check_field_paths(self, node, field_paths, model_name, use):
pass


def _inverse_arch(self):
"""
Remove install_filename from context if it's from openupgrade_scripts.
Without this, arch_fs will point to openupgrade_scripts' file which most likely
won't exist when the migrated database is deployed, which breaks resetting views
"""
if "install_filename" in self._context:
path_info = get_resource_from_path(self._context["install_filename"])
if path_info and path_info[0] == "openupgrade_scripts":
# Needs to override the context to remove the install_filename
self = self.with_context( # pylint: disable=context-overridden
{k: v for k, v in self._context.items() if k != "install_filename"}
)
return _inverse_arch._original_method(self)


_check_xml._original_method = View._check_xml
View._check_xml = _check_xml
check._original_method = NameManager.check
Expand All @@ -93,3 +110,28 @@ def _check_field_paths(self, node, field_paths, model_name, use):
View._raise_view_error = _raise_view_error
_check_field_paths._original_method = View._check_field_paths
View._check_field_paths = _check_field_paths
_inverse_arch._original_method = View._inverse_arch
View._inverse_arch = _inverse_arch


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 @@ -19,16 +19,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
22 changes: 21 additions & 1 deletion openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# odoo/enterprise
# OCA/delivery-carrier
"delivery_carrier_customer_info": "partner_delivery_info",
# OCA/l10n-spain
"l10n_es_pos": "l10n_es_pos_oca",
# OCA/server-tools
"mail_template_attachment_i18n": "mail_template_attachment_per_lang",
# OCA/social
"mail_activity_unlink_log": "mail_activity_cancel_tracking",
# Viindoo/tvtmaaddons
Expand Down Expand Up @@ -56,6 +60,8 @@
"website_sale_digital": "website_sale",
"website_sale_loyalty_delivery": "website_sale_loyalty",
"website_sale_stock_product_configurator": "website_sale_product_configurator",
# OCA/account-financial-tools
"base_vat_optional_vies": "base_vat",
# OCA/account-invoicing
"account_invoice_fiscal_position_update": "account",
# OCA/e-commerce
Expand All @@ -78,6 +84,8 @@
# OCA/product-attribute
"product_catalog": "product",
"product_catalog_sale": "sale",
# OCA/project
"project_list": "project",
# OCA/purchase-workflow
"purchase_discount": "purchase",
# OCA/sale-promotion
Expand All @@ -88,6 +96,7 @@
# OCA/social
"mail_activity_plan": "mail",
"mass_mailing_custom_unsubscribe_event": "mass_mailing",
"mail_template_multi_attachment": "mail",
# OCA/stock-logistics-warehouse
"stock_lot_filter_available": "stock",
# OCA/web
Expand All @@ -105,9 +114,10 @@
"to_hr_payroll_patch1": "to_hr_payroll",
"to_hr_timesheet_payroll_patch1": "to_hr_timesheet_payroll",
"to_location_warehouse": "viin_stock",
"to_mail_notif_and_email": "mail",
"to_sale_loyalty_patch_1": "viin_loyalty",
"to_stock_report_common": "viin_stock",
# removed from 17.0 (35c195ede0) without successor
"to_uom_subscription": "uom",
"to_vietnam_bank_icons": "payment",
"to_vietnamese_number2words": "base",
"to_website_recaptcha": "google_recaptcha",
Expand Down Expand Up @@ -207,3 +217,13 @@
"repair.line": "stock.move",
# OCA/...
}

# Modules of merged_modules that are not merged into anything: they are
# removed without a successor on our addons paths. The technical records they
# own (record rules, scheduled and server actions, views, menus, mail
# templates...) are deleted by the update even when they are noupdate, and the
# xml ids of records of models that go with them are detached: see
# release_records_of_lost_modules in the pre-migration of base.
lost_modules = [
"to_uom_subscription",
]
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def _am_update_invoice_pdf_report_file(env):
res_id = am.id
FROM account_move am
WHERE am.message_main_attachment_id = ia.id
AND am.move_type IN ('out_invoice', 'out_refund')
""",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---Models in module 'account_debit_note'---
---Fields in module 'account_debit_note'---
---XML records in module 'account_debit_note'---
NEW ir.actions.server: account_debit_note.action_move_debit_note
# NOTHING TO DO: New feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---Models in module 'account_fleet'---
---Fields in module 'account_fleet'---
---XML records in module 'account_fleet'---
---nothing has changed in this module--
# NOTHING TO DO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---Models in module 'auth_ldap'---
---Fields in module 'auth_ldap'---
---XML records in module 'auth_ldap'---
---nothing has changed in this module--
103 changes: 100 additions & 3 deletions openupgrade_scripts/scripts/base/17.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,32 @@
}


def _handle_l10n_de_mis_reports_xmlids(cr):
"""Before executing the merged modules, we need to rename some XML-IDs with the same
name of l10n_de_skr03_mis_reports/l10n_de_skr04_mis_reports into
l10n_de_mis_reports.
"""
if not openupgrade.is_module_installed(
cr, "l10n_de_skr03_mis_reports"
) and not openupgrade.is_module_installed(cr, "l10n_de_skr04_mis_reports"):
return
_xmlids_renames = []
# fmt: off
bs_names = ["anlagevermoegen", "immaterielle", "schutzrechte", "konzessionen", "firmenwert", "geleistetet_anzahlungen", "total_immaterielle", "grundstueck", "maschinen", "ausstattung", "anlagen_im_bau", "total_sachanlagen", "anteile", "ausleihungen", "beteiligungen", "ausleihungen_beteiligung", "wertpapiere_av", "sonstige_ausleihungen", "total_finanzanlagen", "total_anlagevermoegen", "umlaufvermoegen", "i_vorraete", "roh_hilfs_betriebsstoffe", "unfertige_leistungen", "fertige_erzeugnisse", "anzahlungen", "total_vorraete", "ii_forderungen", "forderungen_ll", "forderungen_unternehmen", "forderungen_beteiligungen", "total_forderungen", "iii_wertpapiere", "wertpapiere_uv_anteile", "wertpapiere_uv_sonstige", "total_wertpapiere_uv", "liquide_mittel", "total_umlaufvermoegen", "rechnungsabgrenzung_aktiva", "aktive_latente_steuern", "fehlbetrag", "aktivseite", "eigenkapital", "gezeichnetes_kapital", "variables_kapital", "gewinnruecklage", "ruecklage_gesetzlich", "ruecklage_eigene_anteile", "ruecklage_satzung", "ruecklage_andere_gewinne", "gewinn_des_jahres", "total_gewinnruecklage", "gewinn_verlustvortrag", "jahresgewinn_verlust", "sopo_mit_ruecklage", "total_eigenkapital", "rueckstellungen", "rueckstellungen_pensionen", "rueckstellungen_steuern", "rueckstellungen_sonstige", "total_rueckstellungen", "verbindlichkeiten", "verbindlichkeiten_anleihen", "verbindlichkeiten_bank", "verbindlichkeiten_ll", "verbindlichkeiten_wechsel", "verbindlichkeiten_sonstige", "total_verbindlichkeiten", "rechnungsabgrenzung_passiva", "passive_latente_steuern", "passivseite"] # noqa: E501
pl_names = ["betriebliche_erloese", "umsatzerloese", "bestandsveraenderungen", "eigenleistungen", "sonstige_ertraege", "total_erloese", "betriebsaufwand", "materialaufwand", "materialaufwand_a", "materialaufwand_b", "personalaufwand", "personalaufwand_a", "personalaufwand_b", "abschreibungen", "abschreibungen_a", "abschreibungen_b", "sonstige_aufwendungen", "total_aufwendungen", "total_betriebsergebnis", "ertraege_beteiligungen", "ertraege_wertpapiere", "zinsertraege", "zinsaufwendungen", "ergebnis_gewoehnliche", "ao_ergebnis", "ao_ergebnis_erloese", "ao_ergebnis_aufwendungen", "total_ao_ergebnis", "steuern", "steuern_ertrag", "sonstige_steuern", "gewinn_verlust", "gewinnvortrag_vj", "entnahme_kapitalruecklage", "entnahme_gewinnruecklage", "einstellung_ruecklage", "bilanzgewinn"] # noqa: E501
# fmt: on
for coa in ("skr03", "skr04"):
for report in ("mis_report_bs", "mis_report_pl"):
for name in [""] + bs_names + pl_names:
_xmlids_renames.append(
(
f"l10n_de_{coa}_mis_reports.{report}{'_' if name else ''}{name}", # noqa: E501
f"l10n_de_mis_reports.{report}_{coa}{'_' if name else ''}{name}", # noqa: E501
)
)
openupgrade.rename_xmlids(cr, _xmlids_renames)


def _fill_ir_server_object_lines_into_action_server(cr):
openupgrade.logged_query(
cr,
Expand Down Expand Up @@ -225,10 +251,16 @@ def _handle_partner_private_type(cr):
AND name IN %s
AND translate = TRUE
""",
(tuple(private_fields),),
(tuple(private_fields + ["name"]),),
)
translated_fields = [field[0] for field in cr.fetchall()]

# name of private contact may be null, which is forbidden by res_partner_check_name
if "name" in translated_fields:
query += ", name = COALESCE(name, jsonb_build_object('en_US', '*****'))"
else:
query += ", name = COALESCE(name, '*****')"

for field in private_fields:
# For non-translated fields, replace all values with '*****'
if field not in translated_fields:
Expand Down Expand Up @@ -369,6 +401,64 @@ def _reset_stale_noupdate(cr):
)


_TECHNICAL_MODELS = (
"ir.actions.act_url",
"ir.actions.act_window",
"ir.actions.client",
"ir.actions.report",
"ir.actions.server",
"ir.actions.todo",
"ir.cron",
"ir.filters",
"ir.model.access",
"ir.property",
"ir.rule",
"ir.ui.menu",
"ir.ui.view",
"mail.template",
"website.menu",
)


def release_records_of_lost_modules(cr):
"""A module that is removed without a successor is merged into the module
it extended (apriori.lost_modules), and the update of that module deletes
the records it no longer finds in the data files, except the noupdate
ones: release the technical records, so that they are deleted too, and
detach the xml ids of the records of models that go with the module (the
rows stay). Business records stay.
"""
from odoo.addons.openupgrade_scripts import apriori as _apriori

lost_modules = tuple(getattr(_apriori, "lost_modules", []))
if not lost_modules:
return
openupgrade.logged_query(
cr,
"""
UPDATE ir_model_data SET noupdate = FALSE
WHERE noupdate AND module IN %s AND model IN %s
""",
(lost_modules, _TECHNICAL_MODELS),
)
openupgrade.logged_query(
cr,
"""
DELETE FROM ir_model_data d
WHERE d.module IN %s AND d.model IN (
SELECT m.model
FROM ir_model m
JOIN ir_model_data md ON md.model = 'ir.model'
AND md.res_id = m.id AND md.module IN %s
WHERE NOT EXISTS (
SELECT 1 FROM ir_model_data o
WHERE o.model = 'ir.model' AND o.res_id = m.id
AND o.module NOT IN %s))
""",
(lost_modules,) * 3,
)


@openupgrade.migrate(use_env=False)
def migrate(cr, version):
"""
Expand All @@ -382,8 +472,15 @@ def migrate(cr, version):
"recommended to run the Odoo with --load=openupgrade_framework "
"when migrating your database."
)
openupgrade.update_module_names(cr, renamed_modules.items())
openupgrade.update_module_names(cr, merged_modules.items(), merge_modules=True)
release_records_of_lost_modules(cr)
openupgrade.update_module_names(
cr, renamed_modules.items(), environment_namespec=True
)

_handle_l10n_de_mis_reports_xmlids(cr)
openupgrade.update_module_names(
cr, merged_modules.items(), merge_modules=True, environment_namespec=True
)
openupgrade.clean_transient_models(cr)
openupgrade.rename_xmlids(cr, _xmlids_renames)
openupgrade.copy_columns(cr, _column_copies)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def _partner_fill_vies_valid(env):
) IN (SELECT code FROM eu_countries)
) THEN TRUE
ELSE FALSE
END;
END
WHERE vies_valid IS NULL;
""",
)

Expand Down
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/base_vat/17.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@


def _partner_create_vies_valid_column(env):
if openupgrade.column_exists(env.cr, "res_partner", "vies_passed"):
# coming from base_vat_optional_vies module
openupgrade.rename_fields(
env,
[
(
"res.partner",
"res_partner",
"vies_passed",
"vies_valid",
),
],
)
return
openupgrade.logged_query(
env.cr,
"""
Expand Down
Loading
Loading