openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #11467
[Bug 978885] Re: [account] Cancelled invoice cannot be deleted after 'Reset to Draft'
*** This bug is a duplicate of bug 946866 ***
https://bugs.launchpad.net/bugs/946866
As you said, when you validate it, internal_number field is filled by invoice number.
The proper solution is to delete internal_number when you cancel the invoice,
change in code to accomplish this.
In account_invoice.py in the 'action_cancel' method
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
should be change to:
self.write(cr, uid, ids, {'state':'cancel', 'internal_number':False
,'move_id':False})
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/978885
Title:
[account] Cancelled invoice cannot be deleted after 'Reset to Draft'
Status in OpenERP Addons (modules):
New
Bug description:
Create an invoice and validate it, so that it generates the financial
journals. Then click the 'Cancel' button on the invoice to remove the
posted entries and change the state of the invoice (the module
'account_cancel' should be installed and the invoice journal should
allow cancellation). Then click 'Reset to Draft' to change the invoice
to the 'draft' state. Now try deleting the journal.
Expected result: the invoice should be deleted.
Actual result: error message - "You can not delete an invoice which is open or paid. We suggest you to refund it instead."
The problem is in the 'unlink' method. This checks the state of the
invoice _and_ checks the 'internal_number' is False. The check on the
'internal_number' field is incorrect and should be removed.
In account_invoice.py in the 'unlink' method:
if t['state'] in ('draft', 'cancel') and t['internal_number']==
False:
should be changed to:
if t['state'] in ('draft', 'cancel'):
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/978885/+subscriptions
References