Divyesh Makwana(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-901166-mdi into 
lp:openobject-addons.

Requested reviews:
  Divyesh Makwana(OpenERP) (mdi-openerp)
  Purnendu Singh (OpenERP) (psi-tinyerp)
  Mustufa Rangwala (Open ERP) (mra-tinyerp)
  qdp (OpenERP) (qdp)
Related bugs:
  Bug #901166 in OpenERP Addons: "[Trunk 6.1] Able to reconcile unposted 
entries"
  https://bugs.launchpad.net/openobject-addons/+bug/901166

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-901166-mdi/+merge/85851

Hello Sir,

I have fix the issue: https://bugs.launchpad.net/openobject-addons/+bug/901166 
"Able to reconcile unposted entries".

Thanks and Regards,

Divyesh Makwana(MDI)
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-901166-mdi/+merge/85851
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-901166-mdi.
=== modified file 'account/wizard/account_reconcile.py'
--- account/wizard/account_reconcile.py	2011-11-03 09:56:12 +0000
+++ account/wizard/account_reconcile.py	2011-12-15 12:47:40 +0000
@@ -65,13 +65,26 @@
                 account_id = line.account_id.id
         return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit}
 
+    def check_unreconcile_entries(self, cr, uid, ids, context=None):
+        if context is None:
+            context = {}
+        account_move_line_obj = self.pool.get('account.move.line')
+        if context.get('active_ids',False) :
+            for line in account_move_line_obj.browse(cr, uid, context['active_ids'], context=context):
+                if line.move_id.state == "draft":
+                    raise osv.except_osv(_('Error !'), _('You cannot reconcile the unposted entries.'))
+        return True
+
     def trans_rec_addendum_writeoff(self, cr, uid, ids, context=None):
+        self.check_unreconcile_entries(cr, uid, ids, context=context)
         return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_addendum(cr, uid, ids, context)
 
     def trans_rec_reconcile_partial_reconcile(self, cr, uid, ids, context=None):
+        self.check_unreconcile_entries(cr, uid, ids, context=context)
         return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_reconcile_partial(cr, uid, ids, context)
 
     def trans_rec_reconcile_full(self, cr, uid, ids, context=None):
+        self.check_unreconcile_entries(cr, uid, ids, context=context)
         account_move_line_obj = self.pool.get('account.move.line')
         period_obj = self.pool.get('account.period')
         date = False

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to