Commit 8159b324 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_mrp: Update Transformation on Order Line if resource changed

parent 471bd309
...@@ -3,7 +3,8 @@ portal = production_order_line.getPortalObject() ...@@ -3,7 +3,8 @@ portal = production_order_line.getPortalObject()
transformation = production_order_line.getSpecialiseValue( transformation = production_order_line.getSpecialiseValue(
portal_type=portal.getPortalTransformationTypeList()) portal_type=portal.getPortalTransformationTypeList())
if transformation is None: if transformation is None \
or (transformation.getResource() != production_order_line.getResource()):
resource_uid = production_order_line.getResourceUid() resource_uid = production_order_line.getResourceUid()
if resource_uid: if resource_uid:
transformation_list = portal.portal_catalog( transformation_list = portal.portal_catalog(
...@@ -13,3 +14,5 @@ if transformation is None: ...@@ -13,3 +14,5 @@ if transformation is None:
if len(transformation_list) == 1: if len(transformation_list) == 1:
transformation = transformation_list[0].getRelativeUrl() transformation = transformation_list[0].getRelativeUrl()
production_order_line.setSpecialise(transformation) production_order_line.setSpecialise(transformation)
return
production_order_line.setSpecialise(None)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment