diff --git a/addons/account/account.py b/addons/account/account.py index 8c7f058acc6..dd9e869ae4a 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1026,6 +1026,9 @@ class account_period(osv.osv): 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