summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-10-26 13:31:40 +0000
committerNicolas Martinelli <nim@odoo.com>2020-10-27 08:13:04 +0000
commitc64b3c22bfab848e13145235acc03562aee43e76 (patch)
treed0675ad25305140e2ecd5705360f8dd282139620 /addons/web_editor/static/src/js
parent86423e2da90e1d023bd616cbc719c80f087a4206 (diff)
[FIX] sale: group SO with section in single invoice
- Create SO 1: - Section A, sequence 10 - Product A, sequence 11 - Create SO 2: - Section B, sequence 10 - Product B, sequence 11 - Select both SO - Create the invoice The resulting invoice lines are organized as follow: - Section A, sequence 10 - Section B, sequence 10 - Product A, sequence 11 - Product B, sequence 11 This is obviously not expected as it messes up the organization of the lines. This happens because the sequences of the SO lines are kept at invoice creation, while it is necessary to resequence the invoice lines to keep them organized. To do so, we loop on the invoice lines before their creation in order to assign a sequence corresponding to the order in which they have been added in the list. Since the invoice lines are added one SO after the other, this allows us to keep the appropriate ordering. Note that we only resequence if there are less invoices to create than SO, meaning that several SO have been merged. Indeed, in case a single invoice is created from a single SO, there is no need to resequence. This assumption is not completely true: if not all selected SO were invoiceable, the number of invoices created is also smaller than the number of SO. However, resequencing should be safe so in the worst case we might resequence an invoice while it was not necessary. We also leave the possibility for third-party addons to alter the resequencing thanks to the `_get_invoice_line_sequence` method. opw-2363443 closes odoo/odoo#60785 X-original-commit: 97c2f5ea51a669830b3e6d6d2d7d857742a41481 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
0 files changed, 0 insertions, 0 deletions