From 54045267c4e562943994f375c4703084180ea353 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia Date: Wed, 7 Jun 2023 17:27:08 +0200 Subject: [PATCH] Add patch issue12310.diff. Task #159716 --- issue12310.diff | 21 +++++++++++++++++++++ series | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 issue12310.diff diff --git a/issue12310.diff b/issue12310.diff new file mode 100644 index 0000000..7cd877b --- /dev/null +++ b/issue12310.diff @@ -0,0 +1,21 @@ +diff --git a/tryton/modules/stock_product_location/production.py b/tryton/modules/stock_product_location/production.py +index b4bd9e159a..060b0b152e 100644 +--- a/tryton/modules/stock_product_location/production.py ++++ b/tryton/modules/stock_product_location/production.py +@@ -13,8 +13,16 @@ class Production(metaclass=PoolMeta): + move = super(Production, self)._explode_move_values( + from_location, to_location, company, bom_io, quantity) + if move and isinstance(bom_io, ProductionBomOutput): ++ location_found = False + for product_location in bom_io.product.locations: + if product_location.warehouse != to_location.warehouse: + continue ++ location_found = True + move.to_location = product_location.location ++ if not location_found: ++ for product_location in bom_io.product.template.locations: ++ if (product_location.warehouse != to_location.warehouse or ++ product_location.product): ++ continue ++ move.to_location = product_location.location + return move diff --git a/series b/series index 38942ef..c5b9464 100644 --- a/series +++ b/series @@ -61,3 +61,5 @@ counterpart_party_payment_clearing.diff # [account_payment_clearing] Add the pos account_move_reschedule_line.diff # [account] Fix bug when reschedule the move_lines based on amount. country.diff # [counrty] backport counrty module from v6.8. Is needed for the use of account_stock_eu module. + +issue12310.diff # [stock_product_location] Check product.product locations and product.template locations too.