From 74f8854b5f0f2230013b86e75ff07583e43b3027 Mon Sep 17 00:00:00 2001
From: remi-filament <30716308+remi-filament@users.noreply.github.com>
Date: Wed, 27 Mar 2024 09:48:28 +0100
Subject: [PATCH] [OU-FIX] *: update multi-company ir_rules
---
docsource/modules130-140.rst | 6 +--
.../account/14.0.1.1/noupdate_changes.xml | 16 +++++++
.../analytic/14.0.1.1/noupdate_changes.xml | 15 +++++++
.../analytic/14.0.1.1/post-migration.py | 6 +++
.../base/14.0.1.3/noupdate_changes.xml | 7 +++
.../scripts/crm/14.0.1.2/noupdate_changes.xml | 10 +++--
.../delivery/14.0.1.0/noupdate_changes.xml | 7 +--
.../event/14.0.1.3/noupdate_changes.xml | 4 +-
.../fleet/14.0.0.1/noupdate_changes.xml | 16 +++++--
.../scripts/hr/14.0.1.1/noupdate_changes.xml | 23 +++++-----
.../hr_contract/14.0.1.0/noupdate_changes.xml | 7 +--
.../hr_expense/14.0.2.0/noupdate_changes.xml | 9 ++++
.../hr_expense/14.0.2.0/post-migration.py | 1 +
.../hr_holidays/14.0.1.5/noupdate_changes.xml | 17 ++++---
.../14.0.1.0/noupdate_changes.xml | 3 ++
.../lunch/14.0.1.0/noupdate_changes.xml | 5 ++-
.../maintenance/14.0.1.0/noupdate_changes.xml | 23 +++++-----
.../scripts/mrp/14.0.2.0/noupdate_changes.xml | 27 +++++++-----
.../14.0.1.0.1/noupdate_changes.xml | 7 +--
.../product/14.0.1.2/noupdate_changes.xml | 15 ++++---
.../purchase/14.0.1.2/noupdate_changes.xml | 16 ++++---
.../14.0.0.1/noupdate_changes.xml | 2 +
.../14.0.0.1/post-migration.py | 8 ++++
.../sale/14.0.1.1/noupdate_changes.xml | 14 +++---
.../14.0.1.0/noupdate_changes.xml | 7 +--
.../sales_team/14.0.1.0/noupdate_changes.xml | 6 +++
.../sales_team/14.0.1.0/post-migration.py | 6 +++
.../stock/14.0.1.1/noupdate_changes.xml | 44 +++++++++++--------
.../14.0.1.1/noupdate_changes.xml | 1 +
29 files changed, 231 insertions(+), 97 deletions(-)
create mode 100644 openupgrade_scripts/scripts/analytic/14.0.1.1/noupdate_changes.xml
create mode 100644 openupgrade_scripts/scripts/analytic/14.0.1.1/post-migration.py
create mode 100644 openupgrade_scripts/scripts/hr_expense/14.0.2.0/noupdate_changes.xml
create mode 100644 openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/post-migration.py
create mode 100644 openupgrade_scripts/scripts/sales_team/14.0.1.0/noupdate_changes.xml
create mode 100644 openupgrade_scripts/scripts/sales_team/14.0.1.0/post-migration.py
diff --git a/docsource/modules130-140.rst b/docsource/modules130-140.rst
index 6fb2300040fe..9b835a04a41c 100644
--- a/docsource/modules130-140.rst
+++ b/docsource/modules130-140.rst
@@ -48,7 +48,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
| |new| adyen_platforms | |
+--------------------------------------------+-------------------------------------------------+
-|analytic | Nothing to do |
+|analytic | Done |
+--------------------------------------------+-------------------------------------------------+
|association | Nothing to do |
+--------------------------------------------+-------------------------------------------------+
@@ -164,7 +164,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|hr_contract | Done |
+--------------------------------------------+-------------------------------------------------+
-|hr_expense | Nothing to do |
+|hr_expense | Done |
+--------------------------------------------+-------------------------------------------------+
| |del| hr_expense_check | Done. Merged into hr_expense |
+--------------------------------------------+-------------------------------------------------+
@@ -582,7 +582,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|purchase_product_matrix | |
+--------------------------------------------+-------------------------------------------------+
-|purchase_requisition | Nothing to do |
+|purchase_requisition | Done |
+--------------------------------------------+-------------------------------------------------+
|purchase_requisition_stock | Nothing to do |
+--------------------------------------------+-------------------------------------------------+
diff --git a/openupgrade_scripts/scripts/account/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/account/14.0.1.1/noupdate_changes.xml
index b5a9e7a9593d..8c564fc66c4b 100644
--- a/openupgrade_scripts/scripts/account/14.0.1.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/account/14.0.1.1/noupdate_changes.xml
@@ -8,15 +8,19 @@
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids)]
[('parent_state', 'not in', ('cancel', 'draft')), ('move_id.move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('move_id.message_partner_ids','child_of',[user.commercial_partner_id.id])]
@@ -26,18 +30,26 @@
+ [('company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids)]
+
+
+ [('company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids + [False])]
@@ -82,12 +94,15 @@
+ [('company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids)]
@@ -111,5 +126,6 @@
+ [('company_id', 'in', company_ids)]
diff --git a/openupgrade_scripts/scripts/analytic/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/analytic/14.0.1.1/noupdate_changes.xml
new file mode 100644
index 000000000000..554ba33ebf2f
--- /dev/null
+++ b/openupgrade_scripts/scripts/analytic/14.0.1.1/noupdate_changes.xml
@@ -0,0 +1,15 @@
+
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+ [('company_id', 'in', company_ids)]
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
diff --git a/openupgrade_scripts/scripts/analytic/14.0.1.1/post-migration.py b/openupgrade_scripts/scripts/analytic/14.0.1.1/post-migration.py
new file mode 100644
index 000000000000..e39aab21b2b9
--- /dev/null
+++ b/openupgrade_scripts/scripts/analytic/14.0.1.1/post-migration.py
@@ -0,0 +1,6 @@
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ openupgrade.load_data(env.cr, "analytic", "14.0.1.1/noupdate_changes.xml")
diff --git a/openupgrade_scripts/scripts/base/14.0.1.3/noupdate_changes.xml b/openupgrade_scripts/scripts/base/14.0.1.3/noupdate_changes.xml
index cc534268f748..48ad83b11a68 100644
--- a/openupgrade_scripts/scripts/base/14.0.1.3/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/base/14.0.1.3/noupdate_changes.xml
@@ -66,9 +66,16 @@
30
+
+ [('company_id', 'in', company_ids + [False])]
+
+ [('company_id', 'in', company_ids + [False])]
+
+ ['|', ('partner_share', '=', False), ('company_id', 'in', company_ids + [False])]
+
diff --git a/openupgrade_scripts/scripts/crm/14.0.1.2/noupdate_changes.xml b/openupgrade_scripts/scripts/crm/14.0.1.2/noupdate_changes.xml
index 614d8d92e2fb..3c584df66202 100644
--- a/openupgrade_scripts/scripts/crm/14.0.1.2/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/crm/14.0.1.2/noupdate_changes.xml
@@ -1,8 +1,12 @@
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+
+ [('company_id', 'in', company_ids + [False])]
+
diff --git a/openupgrade_scripts/scripts/delivery/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/delivery/14.0.1.0/noupdate_changes.xml
index 1116002a739c..119557c99a00 100644
--- a/openupgrade_scripts/scripts/delivery/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/delivery/14.0.1.0/noupdate_changes.xml
@@ -1,8 +1,9 @@
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
order
diff --git a/openupgrade_scripts/scripts/event/14.0.1.3/noupdate_changes.xml b/openupgrade_scripts/scripts/event/14.0.1.3/noupdate_changes.xml
index 34e088567d7e..8c446c8594c7 100644
--- a/openupgrade_scripts/scripts/event/14.0.1.3/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/event/14.0.1.3/noupdate_changes.xml
@@ -1,12 +1,12 @@
- ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids + [False])]
- ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids + [False])]
diff --git a/openupgrade_scripts/scripts/fleet/14.0.0.1/noupdate_changes.xml b/openupgrade_scripts/scripts/fleet/14.0.0.1/noupdate_changes.xml
index f2ab7f421838..22b05321ff96 100644
--- a/openupgrade_scripts/scripts/fleet/14.0.0.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/fleet/14.0.0.1/noupdate_changes.xml
@@ -9,7 +9,17 @@
4
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+ [('vehicle_id.company_id', 'in', company_ids + [False])]
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
diff --git a/openupgrade_scripts/scripts/hr/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/hr/14.0.1.1/noupdate_changes.xml
index b48bc425aa05..4aaa3aee27c2 100644
--- a/openupgrade_scripts/scripts/hr/14.0.1.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/hr/14.0.1.1/noupdate_changes.xml
@@ -3,17 +3,20 @@
-
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
- ['|',('company_id', '=',False),('company_id', 'in', company_ids)]
+
+ [('company_id', 'in', company_ids + [False])]
+
+
+ [('company_id', 'in', company_ids + [False])]
-
diff --git a/openupgrade_scripts/scripts/hr_contract/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/hr_contract/14.0.1.0/noupdate_changes.xml
index 7997c79bccba..6d36525c39c3 100644
--- a/openupgrade_scripts/scripts/hr_contract/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/hr_contract/14.0.1.0/noupdate_changes.xml
@@ -3,9 +3,10 @@
model.with_context(from_cron=True).update_state()
-
+
+ [('company_id', 'in', company_ids)]
+
+
diff --git a/openupgrade_scripts/scripts/hr_expense/14.0.2.0/noupdate_changes.xml b/openupgrade_scripts/scripts/hr_expense/14.0.2.0/noupdate_changes.xml
new file mode 100644
index 000000000000..7b4f670abaa0
--- /dev/null
+++ b/openupgrade_scripts/scripts/hr_expense/14.0.2.0/noupdate_changes.xml
@@ -0,0 +1,9 @@
+
+
+
+ [('company_id', 'in', company_ids)]
+
+
+ [('company_id', 'in', company_ids)]
+
+
diff --git a/openupgrade_scripts/scripts/hr_expense/14.0.2.0/post-migration.py b/openupgrade_scripts/scripts/hr_expense/14.0.2.0/post-migration.py
index a74d1024670b..3dcffb91cd43 100644
--- a/openupgrade_scripts/scripts/hr_expense/14.0.2.0/post-migration.py
+++ b/openupgrade_scripts/scripts/hr_expense/14.0.2.0/post-migration.py
@@ -12,3 +12,4 @@ def migrate(env, version):
except Exception:
# this means default_code is required
product.default_code = "EXP_GEN/1"
+ openupgrade.load_data(env.cr, "hr_expense", "14.0.2.0/noupdate_changes.xml")
diff --git a/openupgrade_scripts/scripts/hr_holidays/14.0.1.5/noupdate_changes.xml b/openupgrade_scripts/scripts/hr_holidays/14.0.1.5/noupdate_changes.xml
index 75fd9bd4246e..ffb4f03ae8cc 100644
--- a/openupgrade_scripts/scripts/hr_holidays/14.0.1.5/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/hr_holidays/14.0.1.5/noupdate_changes.xml
@@ -19,9 +19,10 @@
both
both
-->
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
[
'|',
@@ -44,6 +45,9 @@
Allocations: base.group_user create/write
+
+ [('holiday_status_id.company_id', 'in', company_ids + [False])]
+
[
('holiday_type', '=', 'employee'),
@@ -57,9 +61,10 @@
]
Allocations: holiday user : create/write
-
+
+ [('holiday_status_id.company_id', 'in', company_ids + [False])]
+
+
diff --git a/openupgrade_scripts/scripts/hr_recruitment/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/hr_recruitment/14.0.1.0/noupdate_changes.xml
index a61db1d37278..0822225424ff 100644
--- a/openupgrade_scripts/scripts/hr_recruitment/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/hr_recruitment/14.0.1.0/noupdate_changes.xml
@@ -149,6 +149,9 @@
+
+ [('company_id', 'in', company_ids + [False])]
+
diff --git a/openupgrade_scripts/scripts/lunch/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/lunch/14.0.1.0/noupdate_changes.xml
index 1ff8ed024b94..7e5df5934465 100644
--- a/openupgrade_scripts/scripts/lunch/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/lunch/14.0.1.0/noupdate_changes.xml
@@ -2,15 +2,18 @@
+ [('company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids + [False])]
- ['|', ('company_id', '=', False), ('company_id', 'in', company_ids), '|', ('category_id.company_id', '=', False), ('category_id.company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids + [False]), ('category_id.company_id', 'in', company_ids + [False])]
+ [('company_id', 'in', company_ids + [False])]
diff --git a/openupgrade_scripts/scripts/maintenance/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/maintenance/14.0.1.0/noupdate_changes.xml
index db095ac92657..f7429cdd41d2 100644
--- a/openupgrade_scripts/scripts/maintenance/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/maintenance/14.0.1.0/noupdate_changes.xml
@@ -1,25 +1,28 @@
-
-
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
- -->
+ [('company_id', 'in', company_ids + [False])]
+
+
-
- ['|', '|', ('owner_user_id', '=', user.id), ('message_partner_ids', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)]
-
diff --git a/openupgrade_scripts/scripts/mrp/14.0.2.0/noupdate_changes.xml b/openupgrade_scripts/scripts/mrp/14.0.2.0/noupdate_changes.xml
index 6c400fbf5f29..8f8afec3400a 100644
--- a/openupgrade_scripts/scripts/mrp/14.0.2.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/mrp/14.0.2.0/noupdate_changes.xml
@@ -1,30 +1,35 @@
-
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+
-
@@ -24,4 +21,8 @@
+
+ [('company_id', 'in', company_ids)]
+
+
diff --git a/openupgrade_scripts/scripts/product/14.0.1.2/noupdate_changes.xml b/openupgrade_scripts/scripts/product/14.0.1.2/noupdate_changes.xml
index 3cff9696634a..a5dc91b703d1 100644
--- a/openupgrade_scripts/scripts/product/14.0.1.2/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/product/14.0.1.2/noupdate_changes.xml
@@ -4,18 +4,23 @@
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
diff --git a/openupgrade_scripts/scripts/purchase/14.0.1.2/noupdate_changes.xml b/openupgrade_scripts/scripts/purchase/14.0.1.2/noupdate_changes.xml
index 7937adbe773a..5d0d366711d5 100644
--- a/openupgrade_scripts/scripts/purchase/14.0.1.2/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/purchase/14.0.1.2/noupdate_changes.xml
@@ -31,18 +31,22 @@
Portal Purchase Order Lines
-
-
+ [('company_id', 'in', company_ids)]
+
-
+ [('company_id', 'in', company_ids)]
+
-
- -->
+ [('company_id', 'in', company_ids)]
+
+
[('move_id.move_type', 'in', ('in_invoice', 'in_refund', 'in_receipt'))]
diff --git a/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/noupdate_changes.xml b/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/noupdate_changes.xml
index 01a16b70e5b4..d1c8d380785d 100644
--- a/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/noupdate_changes.xml
@@ -2,8 +2,10 @@
+ [('company_id', 'in', company_ids)]
+ [('company_id', 'in', company_ids)]
diff --git a/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/post-migration.py b/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/post-migration.py
new file mode 100644
index 000000000000..e12fcf503985
--- /dev/null
+++ b/openupgrade_scripts/scripts/purchase_requisition/14.0.0.1/post-migration.py
@@ -0,0 +1,8 @@
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ openupgrade.load_data(
+ env.cr, "purchase_requisition", "14.0.0.1/noupdate_changes.xml"
+ )
diff --git a/openupgrade_scripts/scripts/sale/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/sale/14.0.1.1/noupdate_changes.xml
index 77b3e1d88bc7..ff7ad123c070 100644
--- a/openupgrade_scripts/scripts/sale/14.0.1.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/sale/14.0.1.1/noupdate_changes.xml
@@ -132,12 +132,14 @@
-
-
+
+ [('company_id', 'in', company_ids)]
+
+
+
+ [('company_id', 'in', company_ids)]
+
+
[('move_type', 'in', ('out_invoice', 'out_refund'))]
diff --git a/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml
index 428fa47ce72e..0fadad619bf2 100644
--- a/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/sale_management/14.0.1.0/noupdate_changes.xml
@@ -1,6 +1,7 @@
-
+
+ [('company_id', 'in', company_ids + [False])]
+
+
diff --git a/openupgrade_scripts/scripts/sales_team/14.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/sales_team/14.0.1.0/noupdate_changes.xml
new file mode 100644
index 000000000000..883848b63ed9
--- /dev/null
+++ b/openupgrade_scripts/scripts/sales_team/14.0.1.0/noupdate_changes.xml
@@ -0,0 +1,6 @@
+
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
diff --git a/openupgrade_scripts/scripts/sales_team/14.0.1.0/post-migration.py b/openupgrade_scripts/scripts/sales_team/14.0.1.0/post-migration.py
new file mode 100644
index 000000000000..7f97eaeb1917
--- /dev/null
+++ b/openupgrade_scripts/scripts/sales_team/14.0.1.0/post-migration.py
@@ -0,0 +1,6 @@
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ openupgrade.load_data(env.cr, "sales_team", "14.0.1.0/noupdate_changes.xml")
diff --git a/openupgrade_scripts/scripts/stock/14.0.1.1/noupdate_changes.xml b/openupgrade_scripts/scripts/stock/14.0.1.1/noupdate_changes.xml
index e1ef75ef368f..bf734aab87d2 100644
--- a/openupgrade_scripts/scripts/stock/14.0.1.1/noupdate_changes.xml
+++ b/openupgrade_scripts/scripts/stock/14.0.1.1/noupdate_changes.xml
@@ -34,38 +34,42 @@
-
-
+ [('company_id', 'in', company_ids)]
+
-
+
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+
+
+ [('company_id', 'in', company_ids + [False])]
+
+
- ['|',('company_id','=',False),('company_id', 'in', company_ids)]
-
+ [('company_id', 'in', company_ids + [False])]
+
[('company_id', 'in', company_ids)]
-
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+ [('company_id', 'in', company_ids + [False])]
+
-
+