8fe8ca9948466064675beb3931b457b67ebdedc6
Let’s say you have 10 units of products item1 and item2 in your stock.
If you create a sale order with two order lines: 1 item1 and 1 item2,
it’ll create one picking with two pack operations: 1 item1 and 1 item2.
Validate the picking, everything goes fine.
Now if you go back to the sale order and increase the quantity of the
two order lines, let’s say you sold now 2 item1 and 2 item2, it’ll
create two picking having each one a single pack operation: the first
with a pack operation for 1 unit of item1, the second one with a pack
operation of 1unit for item2.
The expected result would be that a single new picking with the two pack
operations is created.
This bug is due to the fact that there’s a check on sale order line
write that’ll call _action_procurement_create if you indeed increased
the quantity of any line. This method will at some point call
assign_picking on the model stock move. This method will try to find a
non-done picking with the same procurement group as the one we’re
working (the procurement group for our sale order). For the first write
on sale.order.line, it won’t find one because there aren’t, so it’ll
create one. For the second write on sale.order.line (so, for the second
line) it should find the picking created by the first write, but it
won’t and so it’ll create a second picking.
The fact that it didn't find the picking create by the previous line
is due to the fact that we do not update the computed fields
between write on a one2many field since rev 7b8afc2 and that “group_id”
on the model stock.picking is a computed field (a related).
As we prefer to keep the behavior of not recomputing the computed fields
between writes on a one2many (it’s a trade-off for performance reason,
except in edge cases the recomputation is useless), we explicitly
trigger the recomputation before looking for a candidate picking in the
stock.move action_assign, so that the next searchs on picking.group_id
will be succesful.
This commit also introduces a test for this case.
Closes #14718
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
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.
If you are a developer you may type the following command at your terminal:
wget -O- https://raw.githubusercontent.com/odoo/odoo/9.0/odoo.py | python
Then follow the developer tutorials
For Odoo employees
To add the odoo-dev remote use this command:
$ ./odoo.py setup_git_dev
To fetch odoo merge pull requests refs use this command:
$ ./odoo.py setup_git_review
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%