b5332aca63da7a2926ffd3450d0e66cde2582f75
- 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#60789 X-original-commit: 97c2f5ea51a669830b3e6d6d2d7d857742a41481 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%