From 0231e94fc239cfb73caec9fb92f0285dad182df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 13 Jun 2008 14:26:56 +0200 Subject: [PATCH] Better condition to call _check when writing period --- period.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/period.py b/period.py index d60ca9f129..464da748f0 100644 --- a/period.py +++ b/period.py @@ -129,9 +129,10 @@ class Period(OSV): def write(self, cursor, user, ids, vals, context=None): move_obj = self.pool.get('account.move') - if vals != {'state': 'close'} \ - and vals != {'state': 'open'}: - self._check(cursor, user, ids, context=context) + for key in vals.keys(): + if key in ('start_date', 'end_date', 'fiscalyear'): + self._check(cursor, user, ids, context=context) + break if vals.get('state') == 'open': for period in self.browse(cursor, user, ids, context=context):