From f1930ad52e70de9033ec8e543c3abb5d532dcc2d Mon Sep 17 00:00:00 2001 From: Andrea Date: Fri, 10 Apr 2020 09:33:19 +0200 Subject: [PATCH] [FIX] multicompany rule --- account_payment_order/README.rst | 1 + .../migrations/12.0.1.2.0/post-migration.py | 18 ------------------ .../migrations/13.0.1.0.0/noupdate_changes.xml | 18 ++++++++++++++++++ .../migrations/13.0.1.0.0/post-migration.py | 11 +++++++++++ account_payment_order/readme/CONTRIBUTORS.rst | 1 + .../security/payment_security.xml | 6 +++--- .../static/description/index.html | 1 + 7 files changed, 35 insertions(+), 21 deletions(-) delete mode 100644 account_payment_order/migrations/12.0.1.2.0/post-migration.py create mode 100644 account_payment_order/migrations/13.0.1.0.0/noupdate_changes.xml create mode 100644 account_payment_order/migrations/13.0.1.0.0/post-migration.py diff --git a/account_payment_order/README.rst b/account_payment_order/README.rst index 743bb7de5..13cf5b16d 100644 --- a/account_payment_order/README.rst +++ b/account_payment_order/README.rst @@ -102,6 +102,7 @@ Contributors * `DynApps `_: * Raf Ven +* Andrea Stirpe Maintainers ~~~~~~~~~~~ diff --git a/account_payment_order/migrations/12.0.1.2.0/post-migration.py b/account_payment_order/migrations/12.0.1.2.0/post-migration.py deleted file mode 100644 index 575e13c76..000000000 --- a/account_payment_order/migrations/12.0.1.2.0/post-migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2019 Tecnativa - Pedro M. Baeza -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.set_xml_ids_noupdate_value( - env, - "account_payment_order", - [ - "bank_payment_line_seq", - "account_payment_line_seq", - "account_payment_order_seq", - ], - True, - ) diff --git a/account_payment_order/migrations/13.0.1.0.0/noupdate_changes.xml b/account_payment_order/migrations/13.0.1.0.0/noupdate_changes.xml new file mode 100644 index 000000000..c0c9f5870 --- /dev/null +++ b/account_payment_order/migrations/13.0.1.0.0/noupdate_changes.xml @@ -0,0 +1,18 @@ + + + + ['|',('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_payment_order/migrations/13.0.1.0.0/post-migration.py b/account_payment_order/migrations/13.0.1.0.0/post-migration.py new file mode 100644 index 000000000..a49b21956 --- /dev/null +++ b/account_payment_order/migrations/13.0.1.0.0/post-migration.py @@ -0,0 +1,11 @@ +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade # pylint: disable=W7936 + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data( + env.cr, "account_payment_order", "migrations/13.0.1.0.0/noupdate_changes.xml" + ) diff --git a/account_payment_order/readme/CONTRIBUTORS.rst b/account_payment_order/readme/CONTRIBUTORS.rst index 0a2cbd827..b5827224e 100644 --- a/account_payment_order/readme/CONTRIBUTORS.rst +++ b/account_payment_order/readme/CONTRIBUTORS.rst @@ -16,3 +16,4 @@ * `DynApps `_: * Raf Ven +* Andrea Stirpe diff --git a/account_payment_order/security/payment_security.xml b/account_payment_order/security/payment_security.xml index f9638412e..3513f33d7 100644 --- a/account_payment_order/security/payment_security.xml +++ b/account_payment_order/security/payment_security.xml @@ -16,21 +16,21 @@ ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] Payment line multi-company rule ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] Bank payment line multi-company rule ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] diff --git a/account_payment_order/static/description/index.html b/account_payment_order/static/description/index.html index d1e6c4fc6..ca3f8ad11 100644 --- a/account_payment_order/static/description/index.html +++ b/account_payment_order/static/description/index.html @@ -447,6 +447,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Raf Ven <raf.ven@dynapps.be>
  • +
  • Andrea Stirpe <a.stirpe@onestein.nl>