Skip to content
Snippets Groups Projects
Commit 1da687b6 authored by Wolfgang Taferner's avatar Wolfgang Taferner Committed by Nicolas Martinelli
Browse files

[FIX] stock: filtered related product_id field will overwrite on create


Assume a situation where you trigger a method which is going to create a
nested picking with move_lines included and having a filter set which
means that your context includes {'default_product_id': 20}

{
 'location_dest_id': 9,
 'location_id': 19,
 'move_lines': [(0,
                 0,
                 {'location_dest_id': 1,
                  'location_id': 2,
                  'name': u'name',
                  'partner_id': 1,
                  'product_id': 10,
                  'product_uom': 1,
                  'product_uom_qty': 1.0})],
 'origin': u'Origin',
 'partner_id': 1,
 'picking_type_id': 59
}

Before the creation of the objects it will inject the default product in
the top level of the dict which should create a picking with one or more
move_lines.

Based on this this injection will overwrite all product_id values of the
created move lines as the picking is created last and the default value
will write ALL move lines with this specific product from the context.

closes odoo/odoo#44989

X-original-commit: 05e957f0
Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 5f0451c5
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment