fix: store res.company.country_id for 19.0 account module compatibility

account_fiscal_country_id depends on country_id which must be stored to be
converted to SQL. Without store=True, installing account module fails with
ValueError: Cannot convert res.company.country_id to SQL.

🤖 assisted by claude
This commit is contained in:
Ernad Husremovic 2026-03-09 18:09:45 +01:00
parent 6219a6a26f
commit bbd1d1d065

View file

@ -60,7 +60,7 @@ class ResCompany(models.Model):
string="Fed. State", domain="[('country_id', '=?', country_id)]"
)
bank_ids = fields.One2many(related='partner_id.bank_ids', readonly=False)
country_id = fields.Many2one('res.country', compute='_compute_address', inverse='_inverse_country', string="Country")
country_id = fields.Many2one('res.country', compute='_compute_address', inverse='_inverse_country', string="Country", store=True)
# Technical field to hide country specific fields in company form view
country_code = fields.Char(related='country_id.code', depends=['country_id'])
email = fields.Char(related='partner_id.email', store=True, readonly=False)