From 8622d2a93737c2b01150425c9fd66f3cb016eb16 Mon Sep 17 00:00:00 2001 From: "Hardik Ansodariy (OpenERP)" Date: Wed, 18 Apr 2012 12:34:33 +0530 Subject: [PATCH] [FIX] account_move: Fixed the issue of allowing cancel journal entries of closed periods (Maintanace Case :573839) bzr revid: han@tinyerp.com-20120418070433-3b89k0dz72vhxku9 --- addons/account/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index c165a7f3b42..28237c5695e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1351,7 +1351,9 @@ class account_move(osv.osv): def button_cancel(self, cr, uid, ids, context=None): for line in self.browse(cr, uid, ids, context=context): - if not line.journal_id.update_posted: + if line.period_id.state == 'done': + raise osv.except_osv(_('Error !'), _('You can not modify a posted entry of closed periods')) + elif not line.journal_id.update_posted: raise osv.except_osv(_('Error !'), _('You can not modify a posted entry of this journal !\nYou should set the journal to allow cancelling entries if you want to do that.')) if ids: cr.execute('UPDATE account_move '\