From 71006a184ea164abd3e40985611a55abe142a1bb 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 --- account_asset_management/__manifest__.py | 2 +- .../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 +++++++++++++++++++ 4 files changed, 28 insertions(+), 29 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/__manifest__.py b/account_asset_management/__manifest__.py index 4d08c978..bdb235a7 100644 --- a/account_asset_management/__manifest__.py +++ b/account_asset_management/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Assets Management", - "version": "13.0.1.1.2", + "version": "13.0.1.2.0", "license": "AGPL-3", "depends": ["account"], "excludes": ["account_asset"], 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 bf718c49..00000000 --- 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 7da14b1a..00000000 --- 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 00000000..2eff856c --- /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})