[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!!!
This commit is contained in:
Alexis de Lattre
2018-05-31 21:46:42 +02:00
parent 82cfb1f2e4
commit 180224e22b

View File

@@ -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)