Commit 356e5a33 authored by Sebastien Robin's avatar Sebastien Robin

mrp: it was bad idea to set transformation on line if several transformations are found

Some tests where explicitely checking that transformation is not set in case
several are found. It is indeed better to ask user decision in such case.
parent 11489b1d
...@@ -11,6 +11,6 @@ if transformation is None: ...@@ -11,6 +11,6 @@ if transformation is None:
portal_type=portal.getPortalTransformationTypeList(), portal_type=portal.getPortalTransformationTypeList(),
validation_state="!=invalidated", validation_state="!=invalidated",
default_resource_uid=resource_uid) default_resource_uid=resource_uid)
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)
  • What about the fact that resource.getDefaultTransformationValue(context) looks better in that we can then customize easily with a type-based method ? I remind that by default, Resource.getDefaultTransformationValue returns the first found (i.e. it does not return None if it finds many).

    /cc @cedric.leninivin

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