From 88ffbe507879ccbfd017b9d8f64a99ab57e8088d Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 4 Apr 2022 20:42:47 +0200 Subject: [PATCH] [OU-FIX] account_payment_order: Rename record rules XML-IDs When coming from Odoo 8.0 with `account_payment` module installed, you have 2 record rules for accesing payment orders and lines: https://github.com/odoo/odoo/blob/9e8f70e4849b0eeaca8b5cf51372ecfa23dc561b/addons/account_payment/security/account_payment_security.xml#L16-L28 so we need to convert them to the new existing rules for not having duplicates, or remove them: https://github.com/OCA/bank-payment/blob/8b6300243a5e4764723c9d45473cc29db5206123/account_payment_order/security/payment_security.xml#L17-L27 I have decided to rename the XML-IDs for preserving the old ones. --- .../migrations/9.0.1.0.0/pre-migration.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/account_payment_order/migrations/9.0.1.0.0/pre-migration.py b/account_payment_order/migrations/9.0.1.0.0/pre-migration.py index e93c18f40..841787a21 100644 --- a/account_payment_order/migrations/9.0.1.0.0/pre-migration.py +++ b/account_payment_order/migrations/9.0.1.0.0/pre-migration.py @@ -61,6 +61,18 @@ column_renames_payment_transfer = { ], } +xmlids_renames = [ + ( + "account_payment_order.payment_order_comp_rule", + "account_payment_order.account_payment_order_company_rule", + ), + ( + "account_payment_order.payment_line_comp_rule", + "account_payment_order.account_payment_line_company_rule", + ), +] + + # They are being handled after module rename, so source module name is correct EXISTING_PAYMENT_MODE_TYPE_XML_IDS = { 'account_payment_order.manual_bank_tranfer': @@ -238,4 +250,5 @@ def migrate(env, version): merge_modules=True) openupgrade.rename_models(env.cr, models_renames) openupgrade.rename_tables(env.cr, table_renames) + openupgrade.rename_xmlids(env.cr, xmlids_renames) populate_computed_fields(env)