Commit 4e55d7b0 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Klaus Wölfel

erp5_trade: use product line to select resource in inventory report

parent 2a7c192b
......@@ -6,16 +6,20 @@ node_uid = context.getDestinationUid()
valuation_method = context.getValuationMethod()
relative_url = context.getRelativeUrl()
at_date = context.getAtDate()
kw = {
'section_uid': section_uid,
'node_uid': node_uid,
'group_by_resource': 1,
'group_by_variation': 1,
'resourceType': portal.getPortalProductTypeList(),
'at_date': at_date
}
inventory_list = getCurrentInventoryList(
section_uid = section_uid,
node_uid = node_uid,
group_by_resource = 1,
group_by_variation = 1,
resourceType=portal.getPortalProductTypeList(),
resource_uid = context.getResourceUidList(),
at_date = at_date
)
product_line = context.getProductLine()
if product_line:
kw['resource_category'] = 'product_line/%s' % product_line
inventory_list = getCurrentInventoryList(**kw)
line_tag = '%s:lineUpdateTotalAssetPrice' % relative_url
#only after all calculation are finished then change report state
......
......@@ -106,7 +106,7 @@
<string>my_destination_title</string>
<string>my_destination_section_title</string>
<string>my_valuation_method</string>
<string>my_resource_title_list</string>
<string>my_product_line</string>
</list>
</value>
</item>
......
......@@ -9,18 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>allow_creation</string>
<string>height</string>
<string>portal_type</string>
<string>title</string>
<string>view_separator</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_resource_title_list</string> </value>
<value> <string>my_product_line</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -45,6 +39,10 @@
<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>
......@@ -61,21 +59,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
......@@ -85,44 +69,17 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_source_trade_title_list</string> </value>
<value> <string>my_product_line</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Resource</string>
<string>Resource</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Product or Service</string> </value>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
......@@ -130,17 +87,4 @@
</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: [(x, x) for x in (list(here.getPortalProductTypeList()) + list(here.getPortalServiceTypeList()))]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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