From 00ce67ee43698b5c5469d4dccd098f9977d5e176 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Tue, 31 Oct 2017 10:28:31 +0100 Subject: [PATCH] [FIX] l10n_fr_certification: allow multi write on account.journal Closes #20594 --- addons/l10n_fr_certification/models/account.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/l10n_fr_certification/models/account.py b/addons/l10n_fr_certification/models/account.py index 07d5fc04e41..94db3c46273 100644 --- a/addons/l10n_fr_certification/models/account.py +++ b/addons/l10n_fr_certification/models/account.py @@ -144,8 +144,9 @@ class AccountJournal(models.Model): @api.multi def write(self, vals): # restrict the operation in case we are trying to write a forbidden field - if self.company_id.country_id.code == 'FR' and vals.get('update_posted'): - raise UserError(ERR_MSG % (self._name, 'update_posted')) + for rec in self: + if rec.company_id.country_id.code == 'FR' and vals.get('update_posted'): + raise UserError(ERR_MSG % (self._name, 'update_posted')) return super(AccountJournal, self).write(vals) @api.model