[FIX] account_move: Fixed the issue of allowing cancel journal entries of closed periods (Maintanace Case :573839)

bzr revid: han@tinyerp.com-20120418070433-3b89k0dz72vhxku9
This commit is contained in:
Hardik Ansodariy (OpenERP)
2012-04-18 12:34:33 +05:30
parent ccafcb6d90
commit 8622d2a937
+3 -1
View File
@@ -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 '\