Skip to Content
Menu
This question has been flagged
1 Reply
3226 Views

We have edit the account_invoice code inorder that the user could edit the invoice even when he validate the invoice evrything is well the only pb is how to update the residual field after making some change could you help me in this please.


Avatar
Discard

Residual field is a function field I suppose based on full and partial reconcile payments. Editing invoice residual field is not a good idea. If you could elaborate what are you trying to achieve then probably I try to help you. 

When you edit quantity the amount total and residual amount both should be automatically updated unless you have overridden the function method which resist the update. For e.g Invoice: INV001 Product 1: 1 X£10 = £10 Tax(20%) = £2 Total = £12 Overdue = £12 Amended invoice Product 1: 2X£10 = £20 Tax(20%) = £4 Total = £24 Overdue = £24 When you pay invoice INV001 it should have value £24. Just curious to know, how are you updating the quantity odoo? Do you use odoo frontend or database query or erppeek? Regards, Kinner

Author

I had inherit the module account_invoice and I Had edit it like this invoice_line = fields.One2many('account.invoice.line', 'invoice_id', string='Invoice Lines', readonly=True, states={'draft': [('readonly', False)],'open': [('readonly', False)],'paid': [('readonly', False)]}, copy=True) tax_line = fields.One2many('account.invoice.tax', 'invoice_id', string='Tax Lines', readonly=True, states={'draft': [('readonly', False)],'open': [('readonly', False)],'paid': [('readonly', False)]}, copy=True) and by editing invoice_line I would change the quantity even that the invoice is open