Commit a6851930 authored by Sebastien Robin's avatar Sebastien Robin

mrp: a production order has a specialise link for business template, so we...

mrp: a production order has a specialise link for business template, so we have to look for transformations
parent 1acab34f
production_order_line = state_change['object']
portal = production_order_line.getPortalObject()
if not production_order_line.hasSpecialise():
transformation = production_order_line.getSpecialiseValue(
portal_type=portal.getPortalTransformationTypeList())
if transformation is None:
portal = production_order_line.getPortalObject()
resource_uid = production_order_line.getResourceUid()
if resource_uid:
......@@ -8,6 +11,6 @@ if not production_order_line.hasSpecialise():
portal_type=portal.getPortalTransformationTypeList(),
validation_state="!=invalidated",
default_resource_uid=resource_uid)
if len(transformation_list) == 1:
if len(transformation_list) >= 1:
transformation = transformation_list[0].getRelativeUrl()
production_order_line.setSpecialise(transformation)
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