Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
erp5
Commits
e58d1a66
Commit
e58d1a66
authored
Mar 21, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_mrp: correctly filter operations and material on corresponding tabs of production orders
parent
37d4ee53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
...s/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
+15
-4
No files found.
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
View file @
e58d1a66
...
@@ -54,17 +54,28 @@
...
@@ -54,17 +54,28 @@
Show only resources which are defined in transformation.\n
Show only resources which are defined in transformation.\n
"""\n
"""\n
movement_list = context.getMovementList()\n
movement_list = context.getMovementList()\n
portal = context.getPortalObject()\n
transformation_line_list_dict = {}\n
transformation_line_list_dict = {}\n
consumed_resource_list = []\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
for movement in movement_list:\n
transformation = movement.getSpecialiseValue()\n
transformation = movement.getSpecialiseValue()\n
if transformation is not None:\n
if transformation is not None:\n
transformation_line_list = transformation.objectValues()\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
for transformation_line in transformation_line_list:\n
transformation_resource = transformation_line.getResourceValue()\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
consumed_resource_list.append(transformation_resource)\n
transformation_line_list_dict[movement] = filtered_transformation_line_list\n
else:\n
else:\n
transformation_line_list_dict[movement] = ()\n
transformation_line_list_dict[movement] = ()\n
\n
\n
...
@@ -78,7 +89,7 @@ kwargs[\'group_by_variation\'] = 1\n
...
@@ -78,7 +89,7 @@ kwargs[\'group_by_variation\'] = 1\n
kwargs[\'section_uid\'] = context.getSourceSectionUid()\n
kwargs[\'section_uid\'] = context.getSourceSectionUid()\n
\n
\n
inventory_dict = {}\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_dict[inventory.resource_relative_url,\n
inventory.variation_text,\n
inventory.variation_text,\n
inventory.node_relative_url] = inventory\n
inventory.node_relative_url] = inventory\n
...
@@ -127,7 +138,7 @@ return result_list\n
...
@@ -127,7 +138,7 @@ return result_list\n
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
resource_portal_type,
*args,**kwargs
</string>
</value>
<value>
<string>
*args,**kwargs
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment