Skip to content
Snippets Groups Projects
Commit 255816c0 authored by Jérome Maes's avatar Jérome Maes
Browse files

[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
parent a2c5b44d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment