Skip to content

Commit

Permalink
[OU-FIX] *: update multi-company ir_rules
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-filament committed Mar 27, 2024
1 parent 2bd4547 commit 74f8854
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 97 deletions.
6 changes: 3 additions & 3 deletions docsource/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
| |new| adyen_platforms | |
+--------------------------------------------+-------------------------------------------------+
|analytic | Nothing to do |
|analytic | Done |
+--------------------------------------------+-------------------------------------------------+
|association | Nothing to do |
+--------------------------------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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 |
+--------------------------------------------+-------------------------------------------------+
Expand Down Expand Up @@ -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 |
+--------------------------------------------+-------------------------------------------------+
Expand Down
16 changes: 16 additions & 0 deletions openupgrade_scripts/scripts/account/14.0.1.1/noupdate_changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
</record>
<record id="account_bank_statement_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_bank_statement_line_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_fiscal_position_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_invoice_line_rule_portal" model="ir.rule">
<field name="domain_force">[('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])]</field>
Expand All @@ -26,18 +30,26 @@
</record>
<record id="account_move_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="account_move_line_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="account_payment_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_payment_term_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="account_reconcile_model_template_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="account_root_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="email_template_edi_invoice" model="mail.template">
<field name="body_html" type="html">
Expand Down Expand Up @@ -82,12 +94,15 @@
</record>
<record id="invoice_analysis_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="journal_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="journal_group_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="mail_template_data_payment_receipt" model="mail.template">
<field name="body_html" type="xml">
Expand All @@ -111,5 +126,6 @@
</record>
<record id="tax_comp_rule" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions openupgrade_scripts/scripts/analytic/14.0.1.1/noupdate_changes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="analytic_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="analytic_group_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="analytic_line_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="analytic_tag_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,16 @@
<record id="paperformat_us" model="report.paperformat">
<field name="margin_bottom">30</field>
</record>
<record id="res_currency_rate_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="res_partner_bank_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<field name="global"/>
</record>
<record id="res_partner_rule" model="ir.rule">
<field name="domain_force">['|', ('partner_share', '=', False), ('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="res_partner_rule_private_employee" model="ir.rule">
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
Expand Down
10 changes: 7 additions & 3 deletions openupgrade_scripts/scripts/crm/14.0.1.2/noupdate_changes.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<!-- <record id="crm_activity_report_rule_multi_company" model="ir.rule">
<field name="global"/>
</record> -->
<record id="crm_activity_report_rule_multi_company" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="crm_lead_company_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="frequency_field_country_id" model="crm.lead.scoring.frequency.field">
<field name="field_id" ref="crm.field_crm_lead__country_id"/>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<!-- <record id="delivery_carrier_comp_rule" model="ir.rule">
<field name="global"/>
</record> -->
<record id="delivery_carrier_comp_rule" model="ir.rule">
<field name="domain_force"> [('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="product_product_delivery" model="product.product">
<field name="invoice_policy">order</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="event_event_company_rule" model="ir.rule">
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="event_registration_company_rule" model="ir.rule">
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="event_registration_mail_template_badge" model="mail.template">
<field name="body_html" type="html">
Expand Down
16 changes: 13 additions & 3 deletions openupgrade_scripts/scripts/fleet/14.0.0.1/noupdate_changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
<record id="fleet_vehicle_state_new_request" model="fleet.vehicle.state">
<field name="sequence">4</field>
</record>
<!-- <record id="ir_rule_fleet_vehicle" model="ir.rule">
<field name="global"/>
</record> -->
<record id="ir_rule_fleet_log_contract" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_fleet_log_services" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_fleet_odometer" model="ir.rule">
<field name="domain_force">[('vehicle_id.company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_fleet_vehicle" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
</odoo>
23 changes: 13 additions & 10 deletions openupgrade_scripts/scripts/hr/14.0.1.1/noupdate_changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
<record id="employee_admin" model="hr.employee">
<field name="address_home_id" ref="res_partner_admin_private_address"/>
</record>
<!-- <record id="hr_dept_comp_rule" model="ir.rule">
<field name="global"/>
</record> -->
<!-- <record id="hr_employee_comp_rule" model="ir.rule">
<field name="global"/>
</record> -->
<record id="hr_dept_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="hr_employee_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="hr_employee_public_comp_rule" model="ir.rule">
<field name="domain_force">['|',('company_id', '=',False),('company_id', 'in', company_ids)]</field>
<!-- <field name="global"/> -->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="hr_job_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<!-- <record id="hr_job_comp_rule" model="ir.rule">
<field name="global"/>
</record> -->
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<record id="ir_cron_data_contract_update_state" model="ir.cron">
<field name="code">model.with_context(from_cron=True).update_state()</field>
</record>
<!--<record id="ir_rule_hr_contract_multi_company" model="ir.rule">
<field name="global"/>
</record>-->
<record id="ir_rule_hr_contract_multi_company" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
<!-- <field name="global"/> -->
</record>
<record id="mt_department_contract_pending" model="mail.message.subtype">
<field name="parent_id" ref="mt_contract_pending"/>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="hr_expense_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record id="hr_expense_report_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<field name="allocation_validation_type">both</field>
<field name="leave_validation_type">both</field>
</record> -->
<!-- <record id="hr_holidays_status_rule_multi_company" model="ir.rule">
<field name="global"/>
</record> -->
<record id="hr_holidays_status_rule_multi_company" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="hr_leave_allocation_rule_employee" model="ir.rule">
<field name="domain_force">[
'|',
Expand All @@ -44,6 +45,9 @@
<field name="name">Allocations: base.group_user create/write</field>
<field name="perm_unlink" eval="False"/>
</record>
<record id="hr_leave_allocation_rule_multicompany" model="ir.rule">
<field name="domain_force">[('holiday_status_id.company_id', 'in', company_ids + [False])]</field>
</record>
<record id="hr_leave_allocation_rule_officer_update" model="ir.rule">
<field name="domain_force">[
('holiday_type', '=', 'employee'),
Expand All @@ -57,9 +61,10 @@
]</field>
<field name="name">Allocations: holiday user : create/write</field>
</record>
<!--<record id="hr_leave_rule_multicompany" model="ir.rule">
<field name="global"/>
</record>-->
<record id="hr_leave_rule_multicompany" model="ir.rule">
<field name="domain_force">[('holiday_status_id.company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="hr_leave_rule_user_read" model="ir.rule">
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
</table>
</field>
</record>
<record id="hr_applicant_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="mt_department_new" model="mail.message.subtype">
<field name="parent_id" ref="mt_job_new"/>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
<odoo>
<record id="ir_rule_lunch_location_multi_company" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_lunch_product_multi_company" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_lunch_product_report_multi_company" model="ir.rule">
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids), '|', ('category_id.company_id', '=', False), ('category_id.company_id', 'in', company_ids)]</field>
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False]), ('category_id.company_id', 'in', company_ids + [False])]</field>
</record>
<record id="ir_rule_lunch_supplier_multi_company" model="ir.rule">
<!-- <field name="global"/>-->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<!-- No real changes, so no need to write the records -->
<!-- <record id="maintenance_equipment_category_comp_rule" model="ir.rule">
<field name="global"/>
<record id="equipment_request_rule_user" model="ir.rule">
<field name="domain_force">['|', '|', ('owner_user_id', '=', user.id), ('message_partner_ids', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)]</field>
</record>
<record id="maintenance_equipment_category_comp_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="maintenance_equipment_comp_rule" model="ir.rule">
<field name="global"/>
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="maintenance_request_comp_rule" model="ir.rule">
<field name="global"/>
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="maintenance_team_comp_rule" model="ir.rule">
<field name="global"/>
</record> -->
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
<!-- <field name="global"/> -->
</record>
<record id="mt_cat_mat_assign" model="mail.message.subtype">
<field name="parent_id" ref="mt_mat_assign"/>
</record>
<record id="mt_cat_req_created" model="mail.message.subtype">
<field name="parent_id" ref="mt_req_created"/>
</record>
<record id="equipment_request_rule_user" model="ir.rule">
<field name="domain_force">['|', '|', ('owner_user_id', '=', user.id), ('message_partner_ids', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)]</field>
</record>
</odoo>
Loading

0 comments on commit 74f8854

Please sign in to comment.