Fix delete fiscalyear for issue415

This commit is contained in:
Cédric Krier committed 2008-10-07 12:25:54 +02:00
1 parent 77265f1eec
commit e853b46065
1 file changed
+10
+10
View File
@@ -110,6 +110,16 @@ class FiscalYear(OSV):
return super(FiscalYear, self).write(cursor, user, ids, vals,
context=context)
def delete(self, cursor, user, ids, context=None):
period_obj = self.pool.get('account.period')
period_ids = []
for fiscalyear in self.browse(cursor, user, ids, context=context):
period_ids.extend([x.id for x in fiscalyear.periods])
period_obj.delete(cursor, user, period_ids, context=context)
return super(FiscalYear, self).delete(cursor, user, ids,
context=context)
def create_period(self, cursor, user, ids, context=None, interval=1):
'''
Create periods for the fiscal years with month interval