From feb4f730b5e46c4825a88bb8bee7a9410dc62f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 29 May 2017 13:21:20 +0200 Subject: [PATCH] [IMP] a_i_c_chronology: improve/fox onchange --- account_invoice_constraint_chronology/model/account.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/account_invoice_constraint_chronology/model/account.py b/account_invoice_constraint_chronology/model/account.py index 04bbbd186..81884b497 100644 --- a/account_invoice_constraint_chronology/model/account.py +++ b/account_invoice_constraint_chronology/model/account.py @@ -10,10 +10,7 @@ class AccountJournal(models.Model): check_chronology = fields.Boolean(string='Check Chronology', default=False) - @api.multi @api.onchange('type') - def on_change_type(self): - for rec in self: - if rec.type not in ['sale', 'purchase']: - rec.check_chronology = False - return True + def _onchange_type(self): + if self.type not in ['sale', 'purchase']: + self.check_chronology = False