Amit Parik (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-946866-amp into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #946866 in OpenERP Addons: "[6.1][Account] unable to delete draft invoice"
  https://bugs.launchpad.net/openobject-addons/+bug/946866

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-946866-amp/+merge/99671

Fixes the delete invoice problem

Once the invoice is confirmed the internal number id generated and after that 
when we cancel it internal_number doesn't set as a False.
That's why when we cancelled the invoice and then try to delete it or "set to 
draft" the invoice and then try to delete. It doesn't allow to delete.

This fix is solved this problem.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-946866-amp/+merge/99671
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-946866-amp.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-02-28 14:08:16 +0000
+++ account/account_invoice.py	2012-03-28 06:39:22 +0000
@@ -1030,7 +1030,7 @@
                         raise osv.except_osv(_('Error !'), _('You can not cancel an invoice which is partially paid! You need to unreconcile related payment entries first!'))
 
         # First, set the invoices as cancelled and detach the move ids
-        self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
+        self.write(cr, uid, ids, {'state':'cancel', 'move_id':False, 'internal_number': False})
         if move_ids:
             # second, invalidate the move(s)
             account_move_obj.button_cancel(cr, uid, move_ids, context=context)

_______________________________________________
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