Commit f806a36a authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Cédric Le Ninivin

erp5_trade: use product line to select resource in inventory report

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