[FIX] stock: warehouse delivery steps
Since that commit: dd7f4d501a4d23b04a1899be8fd51cc583673c9d A picking type cannot make the scan of the source location mandatory if the scan of the destination source is optional. An error is raised in case the user tries to edit and save a picking types with this erronous config but there is also an issue if the user tries to set the outgoing shipments in 2 or 3 steps. The method `_create_or_update_sequences_and_picking_types` was the cause of this issue because of an `update` on the `stock.picking.type`. We try to update `restrict_scan_source_location` to "mandatory" and `restrict_scan_dest_location` to "no" for the pick operation, the issue is with `update`, each field is write one by one, and so, it will write on `restrict_scan_source_location` first while `restrict_scan_dest_location` is still set on "optional". To fix that, we replace the `update` by a `write`. closes odoo/odoo#101663 X-original-commit: 07fb4af8c68ae1296e796c2f3714823ed828e680 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit is contained in:
@@ -336,7 +336,7 @@ class Warehouse(models.Model):
|
||||
|
||||
for picking_type, values in data.items():
|
||||
if self[picking_type]:
|
||||
self[picking_type].update(values)
|
||||
self[picking_type].write(values)
|
||||
else:
|
||||
data[picking_type].update(create_data[picking_type])
|
||||
sequence = IrSequenceSudo.create(sequence_data[picking_type])
|
||||
|
||||
Reference in New Issue
Block a user