Commit e58d1a66 authored by Sebastien Robin's avatar Sebastien Robin

erp5_mrp: correctly filter operations and material on corresponding tabs of production orders

parent 37d4ee53
......@@ -54,17 +54,28 @@
Show only resources which are defined in transformation.\n
"""\n
movement_list = context.getMovementList()\n
portal = context.getPortalObject()\n
transformation_line_list_dict = {}\n
consumed_resource_list = []\n
\n
resource_portal_type_list = kwargs.get("resource_portal_type")\n
if resource_portal_type_list is None:\n
resource_portal_type_list = portal.getPortalResourceTypeList()\n
if isinstance(resource_portal_type_list, str):\n
resource_portal_type_list = [resource_portal_type_list]\n
resource_portal_type_set = set(resource_portal_type_list)\n
\n
for movement in movement_list:\n
transformation = movement.getSpecialiseValue()\n
if transformation is not None:\n
transformation_line_list = transformation.objectValues()\n
transformation_line_list_dict[movement] = transformation_line_list\n
filtered_transformation_line_list = []\n
for transformation_line in transformation_line_list:\n
transformation_resource = transformation_line.getResourceValue()\n
if transformation_resource is not None:\n
if transformation_resource is not None and transformation_resource.getPortalType() in resource_portal_type_set:\n
filtered_transformation_line_list.append(transformation_line)\n
consumed_resource_list.append(transformation_resource)\n
transformation_line_list_dict[movement] = filtered_transformation_line_list\n
else:\n
transformation_line_list_dict[movement] = ()\n
\n
......@@ -78,7 +89,7 @@ kwargs[\'group_by_variation\'] = 1\n
kwargs[\'section_uid\'] = context.getSourceSectionUid()\n
\n
inventory_dict = {}\n
for inventory in context.portal_simulation.getFutureInventoryList(*args,**kwargs):\n
for inventory in portal.portal_simulation.getFutureInventoryList(*args,**kwargs):\n
inventory_dict[inventory.resource_relative_url,\n
inventory.variation_text,\n
inventory.node_relative_url] = inventory\n
......@@ -127,7 +138,7 @@ return result_list\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>resource_portal_type, *args,**kwargs</string> </value>
<value> <string>*args,**kwargs</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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