From 6f0aa910bcded3fa62b75d94dccf6956c5499c82 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 3 Jun 2020 11:57:10 +0200 Subject: [PATCH] Fix bug on move copy, reset package level On stock.move, the `package_level_id` field did not have a `copy=False` attribute when version 13.0 of Odoo was released. So when we create a new move, the package level of the move being copied was linked as well to the new move. It has been fixed recently in odoo in https://github.com/odoo/odoo/commit/ecf726ae8221e6871c1e391294c633d8b6bcaa9a but to be on the safe side if the code is not up-to-date, it's anyway better to force a False value. --- stock_dynamic_routing/models/stock_move.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stock_dynamic_routing/models/stock_move.py b/stock_dynamic_routing/models/stock_move.py index 4aefb18c4354..d9ca4900684a 100644 --- a/stock_dynamic_routing/models/stock_move.py +++ b/stock_dynamic_routing/models/stock_move.py @@ -436,4 +436,8 @@ def _prepare_routing_move_values(self, picking_type, source, destination): "location_dest_id": destination.id, "state": "waiting", "picking_type_id": picking_type.id, + # copy=False was missing on this field up to + # https://github.com/odoo/odoo/commit/ecf726ae8221e6871c1e391294c633d8b6bcaa9a + # to be on the safe side, force it to False + "package_level_id": False }