Commit 1fcb352a authored by Mame Coumba Sall's avatar Mame Coumba Sall

2008-12-19 mame

* add checkbox fields to check when we want the inventory_module report to display positive stock, negative stock or zero stock

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24901 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 70da9fc3
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>site = context.portal_categories.site.restrictedTraverse(site)\n <value> <string encoding="cdata"><![CDATA[
site = context.portal_categories.site.restrictedTraverse(site)\n
\n \n
def mycmp(line_a, line_b):\n def mycmp(line_a, line_b):\n
"""\n """\n
...@@ -67,7 +69,8 @@ def mycmp(line_a, line_b):\n ...@@ -67,7 +69,8 @@ def mycmp(line_a, line_b):\n
result = cmp(line_a.resource_title, line_b.resource_title)\n result = cmp(line_a.resource_title, line_b.resource_title)\n
return result\n return result\n
\n \n
result_list = context.portal_simulation.getCurrentInventoryList(\n result_list = []\n
for x in context.portal_simulation.getCurrentInventoryList(\n
stock_node_category_uid=site.getUid(),\n stock_node_category_uid=site.getUid(),\n
group_by_resource=1,\n group_by_resource=1,\n
group_by_variation=1,\n group_by_variation=1,\n
...@@ -75,12 +78,20 @@ result_list = context.portal_simulation.getCurrentInventoryList(\n ...@@ -75,12 +78,20 @@ result_list = context.portal_simulation.getCurrentInventoryList(\n
at_date=at_date,\n at_date=at_date,\n
# XXX resourceType= uses movement table.\n # XXX resourceType= uses movement table.\n
# resource_portal_type= does not work with cells (because resource is acquired from line)\n # resource_portal_type= does not work with cells (because resource is acquired from line)\n
resourceType=context.getPortalProductTypeList(), **kw)\n resourceType=context.getPortalProductTypeList(), **kw):\n
if positive_stock and x.getInventory() > 0:\n
result_list.append(x)\n
if negative_stock and x.getInventory() < 0:\n
result_list.append(x)\n
if zero_stock and x.getInventory()==0:\n
result_list.append(x)\n
\n \n
result_list = list(result_list)\n result_list = list(result_list)\n
result_list.sort(cmp=mycmp)\n result_list.sort(cmp=mycmp)\n
return result_list\n return result_list\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -90,7 +101,7 @@ return result_list\n ...@@ -90,7 +101,7 @@ return result_list\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>at_date=None, site=None, **kw</string> </value> <value> <string>at_date=None, site=None,positive_stock,negative_stock,zero_stock, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -110,7 +121,7 @@ return result_list\n ...@@ -110,7 +121,7 @@ return result_list\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>2</int> </value> <value> <int>5</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -118,12 +129,17 @@ return result_list\n ...@@ -118,12 +129,17 @@ return result_list\n
<tuple> <tuple>
<string>at_date</string> <string>at_date</string>
<string>site</string> <string>site</string>
<string>positive_stock</string>
<string>negative_stock</string>
<string>zero_stock</string>
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>mycmp</string> <string>mycmp</string>
<string>_apply_</string>
<string>result_list</string> <string>result_list</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>x</string>
<string>list</string> <string>list</string>
</tuple> </tuple>
</value> </value>
...@@ -139,6 +155,9 @@ return result_list\n ...@@ -139,6 +155,9 @@ return result_list\n
<tuple> <tuple>
<none/> <none/>
<none/> <none/>
<none/>
<none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -98,6 +98,9 @@ ...@@ -98,6 +98,9 @@
<list> <list>
<string>your_at_date</string> <string>your_at_date</string>
<string>your_site</string> <string>your_site</string>
<string>your_positive_stock</string>
<string>your_negative_stock</string>
<string>your_zero_stock</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_negative_stock</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>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>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</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>Negative Stock</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_positive_stock</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>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>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</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>Positive Stock</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_zero_stock</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>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>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</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>Zero Stock</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
547 550
\ No newline at end of file \ No newline at end of file
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