Add patch issue12310.diff.

Task #159716
This commit is contained in:
Juanjo Garcia 2023-06-07 17:27:08 +02:00
parent 50b3d550cc
commit 54045267c4
2 changed files with 23 additions and 0 deletions

21
issue12310.diff Normal file
View File

@ -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

2
series
View File

@ -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.