From 180224e22b19028fbb16b42eba3ebdebdd18e4f8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 31 May 2018 21:46:42 +0200 Subject: [PATCH] [FIX] potentiel record rule error when saving account config page Scenario: if you have account_invoice_inter_company from OCA/multi-company, and you use it to make inter-company invoices. Without the related=True on the country_id field, when saving the account config page, it will trigger a write on the country of the partner which will, via invalidate the computed field 'src_dest_country_id' which will trigger a write on an invoices in another company, which will result in a record rule error!!! --- intrastat_product/models/account_config_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_product/models/account_config_settings.py b/intrastat_product/models/account_config_settings.py index 7036cf7..acb37ce 100644 --- a/intrastat_product/models/account_config_settings.py +++ b/intrastat_product/models/account_config_settings.py @@ -30,4 +30,4 @@ class AccountConfigSettings(models.TransientModel): intrastat_accessory_costs = fields.Boolean( related='company_id.intrastat_accessory_costs') country_id = fields.Many2one( - related='company_id.country_id') + related='company_id.country_id', readonly=True)