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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bryan Kaperick
erp5
Commits
0cf62a74
Commit
0cf62a74
authored
Jun 01, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ProductionOrder_viewMaterialConsumption and display materials even when not in the inventory.
parent
f0ac3f85
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
339 additions
and
54 deletions
+339
-54
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
...s/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
+49
-27
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption.xml
...kins/erp5_mrp/ProductionOrder_viewMaterialConsumption.xml
+3
-1
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox.xml
...5_mrp/ProductionOrder_viewMaterialConsumption/listbox.xml
+8
-15
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_consumption_item.xml
...rder_viewMaterialConsumption/listbox_consumption_item.xml
+138
-0
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_quantity_unit_item.xml
...er_viewMaterialConsumption/listbox_quantity_unit_item.xml
+133
-0
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_variation_category_item_list.xml
...erialConsumption/listbox_variation_category_item_list.xml
+4
-10
bt5/erp5_mrp/bt/change_log
bt5/erp5_mrp/bt/change_log
+3
-0
bt5/erp5_mrp/bt/revision
bt5/erp5_mrp/bt/revision
+1
-1
No files found.
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_getConsumptionMovementList.xml
View file @
0cf62a74
...
...
@@ -50,44 +50,66 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
"""Returns list of resources\' inventories used in consumption for production\n
<value>
<string>
"""Returns list of resources\' inventories used in consumption for production\n
\n
Args:\n
- omit_order_resources [default: 1]\n
Do not show resources, which are on order lines.\n
"""\n
if omit_order_resources:\n
from Products.ZSQLCatalog.SQLCatalog import Query\n
from Products.ZSQLCatalog.SQLCatalog import NegatedQuery\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query
\n
from Products.ZSQLCatalog.SQLCatalog import NegatedQuery
\n
ignored_resource_uid_list = [q.getResourceUid() for q in context.getMovementList() if q.getResourceUid() is not None]
\n
kwargs[\'query\'] = NegatedQuery(Query(operator=\'IN\',**{\'stock.resource_uid\': ignored_resource_uid_list}))
\n
\n
simulation_tool = context.getPortalObject().portal_simulation\n
kw = {}\n
kwargs[\'group_by_date\'] = 1\n
kwargs[\'group_by_node\'] = 1\n
kwargs[\'group_by_variation\'] = 1\n
kwargs[\'group_by_resource\'] = 1\n
kwargs[\'section_uid\'] = context.getDestinationSectionUid()\n
\n
if omit_order_resources:\n
ignored_resource_uid_list = [q.getResourceUid() for q in context.getMovementList() \\\n
if q.getResourceUid() is not None]\n
inventory_dict = {}\n
for inventory in context.portal_simulation.getFutureInventoryList(*args,**kwargs):\n
inventory_dict[inventory.getResourceUid(), \\\n
tuple(sorted(inventory.getVariationCategoryList())), \\\n
inventory.getDestination()] = inventory\n
\n
result_list = inventory_dict.values()\n
consumption_dict = {}\n
for movement in context.getMovementList():\n
movement_quantity_unit = movement.getQuantityUnit()\n
movement_quantity = movement.getQuantity()\n
movement_destination = movement.getDestination()\n
\n
for material in movement.getSpecialiseValue().objectValues():\n
material_resource_uid = material.getResourceUid()\n
if not material_resource_uid:\n
continue\n
\n
inventory_dict_key = material_resource_uid, \\\n
tuple(sorted(material.getVariationCategoryList())), \\\n
movement_destination\n
\n
try:\n
obj = inventory_dict[inventory_dict_key]\n
except KeyError:\n
obj = material\n
result_list.append(obj)\n
\n
kw[\'query\'] = NegatedQuery(\n
Query(operator=\'IN\',**{\'stock.resource_uid\':ignored_resource_uid_list})\n
)\n
material_quantity_unit = material.getQuantityUnit()\n
if movement_quantity_unit == material_quantity_unit:\n
quantity = material.getQuantity()\n
else:\n
quantity = material.getResourceValue().convertQuantity(material.getQuantity(),\n
material_quantity_unit,\n
movement_quantity_unit)\n
\n
kw[\'explanation_uid\'] = [context.getUid()] + [q.getUid() for q in \\\n
context.getCausalityRelatedValueList(portal_type=context.getPortalDeliveryTypeList())]\n
consumption_dict[obj.getUid()] = quantity * movement_quantity\n
\n
kw[\'group_by_date\'] = 1\n
kw[\'group_by_node\'] = 1\n
kw[\'group_by_variation\'] = 1\n
kw[\'group_by_resource\'] = 1\n
kwargs.update(**kw)\n
if kwargs.get(\'src__\',0) == 1:\n
return simulation_tool.getFutureInventoryList(*args,**kwargs)\n
# XXX: below filtering to be replaced by HAVING expression\n
return [q for q in simulation_tool.getFutureInventoryList(*args,**kwargs) if q.inventory < 0.0]\n
]]>
</string>
</value>
context.REQUEST.set(\'consumption_dict\', consumption_dict)\n
return result_list\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
...
...
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption.xml
View file @
0cf62a74
...
...
@@ -91,7 +91,9 @@
<key>
<string>
hidden
</string>
</key>
<value>
<list>
<string>
listbox_movement_start_date
</string>
<string>
listbox_quantity_unit_item
</string>
<string>
listbox_consumption_item
</string>
<string>
listbox_variation_category_item_list
</string>
</list>
</value>
</item>
...
...
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox.xml
View file @
0cf62a74
...
...
@@ -10,12 +10,12 @@
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
<string>
columns
</string>
<string>
list_method
</string>
<string>
selection_name
</string>
<string>
editable_columns
</string>
<string>
list_action
</string>
<string>
list_method
</string>
<string>
selection_name
</string>
<string>
title
</string>
</list>
</value>
</item>
...
...
@@ -85,7 +85,7 @@
<string>
Resource
</string>
</tuple>
<tuple>
<string>
variation_
title
</string>
<string>
variation_
category_item_list
</string>
<string>
Variation
</string>
</tuple>
<tuple>
...
...
@@ -93,15 +93,11 @@
<string>
Node
</string>
</tuple>
<tuple>
<string>
movement.start_date
</string>
<string>
Date
</string>
</tuple>
<tuple>
<string>
inventory
</string>
<string>
Quantity
</string>
<string>
consumption_item
</string>
<string>
Consumption
</string>
</tuple>
<tuple>
<string>
quantity_unit
</string>
<string>
quantity_unit
_item
</string>
<string>
Unit
</string>
</tuple>
<tuple>
...
...
@@ -168,10 +164,7 @@
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<tuple>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
<tuple/>
</tuple>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
</pickle>
<pickle>
<dictionary>
...
...
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_consumption_item.xml
0 → 100644
View file @
0cf62a74
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
input_style
</string>
<string>
precision
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_consumption_item
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_style
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_quantity
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
input_style
</string>
</key>
<value>
<string>
-1234.5
</string>
</value>
</item>
<item>
<key>
<string>
precision
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
listbox_consumption_item
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: here.REQUEST.get(\'consumption_dict\').get(cell.getUid(), \'\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_quantity_unit_item.xml
0 → 100644
View file @
0cf62a74
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
display_width
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_quantity_unit_item
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
20
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
listbox_quantity_unit_item
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.getQuantityUnitValue().getTranslatedTitle()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_
movement_start_date
.xml
→
bt5/erp5_mrp/SkinTemplateItem/portal_skins/erp5_mrp/ProductionOrder_viewMaterialConsumption/listbox_
variation_category_item_list
.xml
View file @
0cf62a74
...
...
@@ -9,14 +9,12 @@
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
editable
</string>
</list>
<list/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_
movement_start_date
</string>
</value>
<value>
<string>
listbox_
variation_category_item_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
@@ -71,17 +69,13 @@
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_
start_date
</string>
</value>
<value>
<string>
my_
report_mode_listbox_variation_category_item_list
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
ProductionOrderLine_view
FieldLibrary
</string>
</value>
<value>
<string>
Base_viewTrade
FieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
...
...
bt5/erp5_mrp/bt/change_log
View file @
0cf62a74
2011-06-01 arnaud.fontaine
* Fix ProductionOrder_viewMaterialConsumption and display materials even when not in the inventory.
2011-05-23 tatuya
* Fix the issue that the Stock view on Production Order does not show anything.
...
...
bt5/erp5_mrp/bt/revision
View file @
0cf62a74
459
\ No newline at end of file
460
\ No newline at end of file
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