def action_draft(self, cr, uid, ids, *args):
mode = 'draft'
+ for period in self.browse(cr, uid, ids):
+ if period.fiscalyear_id.state == 'done':
+ raise osv.except_osv(_('Warning !'), _('You can not re-open a period which belongs to closed fiscal year'))
cr.execute('update account_journal_period set state=%s where period_id in %s', (mode, tuple(ids),))
cr.execute('update account_period set state=%s where id in %s', (mode, tuple(ids),))
return True