From 4d364497dbb8a928fdeb669e70b566d5f44b0697 Mon Sep 17 00:00:00 2001 From: fromera Date: Fri, 31 Jul 2020 14:56:45 +0200 Subject: [PATCH] [FIX] version [FIX] new line [FIX] new line [FIX] without openupgrade [FIX] without openupgrade [FIX] without openupgrade [FIX] without openupgrade [FIX] without openupgrade --- .../13.0.1.0.0/noupdate_changes.xml | 20 -------------- .../migrations/13.0.1.0.0/post-migration.py | 8 ------ .../migrations/13.0.1.1.3/post-migration.py | 27 +++++++++++++++++++ 3 files changed, 27 insertions(+), 28 deletions(-) delete mode 100644 account_asset_management/migrations/13.0.1.0.0/noupdate_changes.xml delete mode 100644 account_asset_management/migrations/13.0.1.0.0/post-migration.py create mode 100644 account_asset_management/migrations/13.0.1.1.3/post-migration.py diff --git a/account_asset_management/migrations/13.0.1.0.0/noupdate_changes.xml b/account_asset_management/migrations/13.0.1.0.0/noupdate_changes.xml deleted file mode 100644 index bf718c49b..000000000 --- a/account_asset_management/migrations/13.0.1.0.0/noupdate_changes.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] - - - ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] - - - ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] - - - diff --git a/account_asset_management/migrations/13.0.1.0.0/post-migration.py b/account_asset_management/migrations/13.0.1.0.0/post-migration.py deleted file mode 100644 index 7da14b1ae..000000000 --- a/account_asset_management/migrations/13.0.1.0.0/post-migration.py +++ /dev/null @@ -1,8 +0,0 @@ -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from openupgradelib import openupgrade # pylint: disable=W7936 - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.load_data( - env.cr, "account_asset_management", "migrations/13.0.1.0.0/noupdate_changes.xml" - ) \ No newline at end of file diff --git a/account_asset_management/migrations/13.0.1.1.3/post-migration.py b/account_asset_management/migrations/13.0.1.1.3/post-migration.py new file mode 100644 index 000000000..2eff856c7 --- /dev/null +++ b/account_asset_management/migrations/13.0.1.1.3/post-migration.py @@ -0,0 +1,27 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, api + + +def migrate(cr, version): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + domain = "['|',('company_id','=',False),('company_id','in',company_ids)]" + rule = env.ref( + "account_asset_management.account_asset_profile_multi_company_rule", + raise_if_not_found=False, + ) + if rule: + rule.write({"domain_force": domain}) + rule = env.ref( + "account_asset_management.account_asset_multi_company_rule", + raise_if_not_found=False, + ) + if rule: + rule.write({"domain_force": domain}) + rule = env.ref( + "account_asset_management.account_asset_group_multi_company_rule", + raise_if_not_found=False, + ) + if rule: + rule.write({"domain_force": domain})