Better condition to call _check when writing period

This commit is contained in:
Cédric Krier
2008-06-13 14:26:56 +02:00
parent 277da7d3a2
commit 0231e94fc2
+4 -3
View File
@@ -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):