-
- Downloads
[IMP] sale: reflection refund of invoices from SO in all cases
When creating a credit note from an invoice coming from a Sales Order, only the "modify" mode links the refund lines with the sale lines. This link make the invoiced quantity decreased on the sale line, which is a willing behavior. The 2 other modes ("cancel", and "create") does not do that link. As the behavior of the "modify" mode was introduced as bugfix years ago, it was time to clean that ! This commit - extends the behavior to every mode: all refund lines are now linked to their origin sale lines, so the invoiced quantities are correctly applied - clean the bricolage used to determine the invoice of the sales order (`_get_invoiced` method) by avoiding searching on the document source field. - provides some tests. The old one was moved and extended. Task-1859308 closes odoo/odoo#28471
Showing
- addons/account/wizard/account_invoice_refund.py 1 addition, 1 deletionaddons/account/wizard/account_invoice_refund.py
- addons/sale/models/account_invoice.py 6 additions, 3 deletionsaddons/sale/models/account_invoice.py
- addons/sale/models/sale.py 3 additions, 13 deletionsaddons/sale/models/sale.py
- addons/sale/tests/__init__.py 1 addition, 0 deletionsaddons/sale/tests/__init__.py
- addons/sale/tests/test_sale_refund.py 313 additions, 0 deletionsaddons/sale/tests/test_sale_refund.py
- addons/sale/tests/test_sale_to_invoice.py 2 additions, 59 deletionsaddons/sale/tests/test_sale_to_invoice.py
Loading
Please register or sign in to comment