From c2aae9e46caa8585a39e7476eb059cb4287d958a Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 9 Dec 2011 15:22:22 +0530 Subject: [PATCH] [IMP] account : Improved the code bzr revid: mdi@tinyerp.com-20111209095222-43eo3pulebwdtapy --- addons/account/wizard/account_period_close.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_period_close.py b/addons/account/wizard/account_period_close.py index 5a46add8150..5217b119939 100644 --- a/addons/account/wizard/account_period_close.py +++ b/addons/account/wizard/account_period_close.py @@ -46,7 +46,7 @@ class account_period_close(osv.osv_memory): for form in self.read(cr, uid, ids, context=context): if form['sure']: for id in context['active_ids']: - account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id)], context=context) + account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id), ('state', '=', "draft")], context=context) if account_move_ids: raise osv.except_osv(_('Invalid action !'), _('In order to close a period, you must first post related journal items.'))