Commit 9f0c9773 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2009-08-19 mame

*remove aggregate_quantity_list and only one field is made for item and quantity
*script to get items modified and renamed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28473 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c7af41ac
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
<list> <list>
<string>listbox_quantity_unit</string> <string>listbox_quantity_unit</string>
<string>listbox_variation_category_item_list</string> <string>listbox_variation_category_item_list</string>
<string>listbox_aggregate_quantity_list</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -136,10 +136,6 @@ ...@@ -136,10 +136,6 @@
<string>aggregate_title_list</string> <string>aggregate_title_list</string>
<string>Items aggregated</string> <string>Items aggregated</string>
</tuple> </tuple>
<tuple>
<string>aggregate_quantity_list</string>
<string>Items Quantity List</string>
</tuple>
<tuple> <tuple>
<string>getInventory</string> <string>getInventory</string>
<string>Stock</string> <string>Stock</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="LinesField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_aggregate_quantity_list</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>
<item>
<key> <string>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Aggregate Quantity List</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.Inventory_getAggregatedItemsQuantityList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.REQUEST.form["item_stock"]==1</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -151,9 +151,7 @@ ...@@ -151,9 +151,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -313,23 +311,7 @@ ...@@ -313,23 +311,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: cell.Inventory_getAggregatedItems()</string> </value> <value> <string>python: cell.Inventory_getAggregatedItemList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.REQUEST.form["item_stock"]==1</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -58,7 +58,7 @@ from Products.ERP5Type.Utils import cartesianProduct\n ...@@ -58,7 +58,7 @@ from Products.ERP5Type.Utils import cartesianProduct\n
from DateTime import DateTime\n from DateTime import DateTime\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
request = portal.REQUEST\n request = portal.REQUEST\n
at_date = request.form["at_date"]\n at_date = request.form["at_date"].Date()\n
at_date = DateTime().Date()\n at_date = DateTime().Date()\n
\n \n
tracking_parameters = {\n tracking_parameters = {\n
...@@ -67,19 +67,13 @@ tracking_parameters = {\n ...@@ -67,19 +67,13 @@ tracking_parameters = {\n
\'section_uid\' : context.section_uid,\n \'section_uid\' : context.section_uid,\n
\'at_date\': context.getStartDate(),\n \'at_date\': context.getStartDate(),\n
\'output\': 0,\n \'output\': 0,\n
\n
\'item_catalog_title\': request.get(\'title\') or \'\',\n
\'item_catalog_reference\': request.get(\'reference\') or \'\',\n
\'item_catalog_portal_type\': \'Item\',\n
}\n }\n
result_list = []\n result_list = []\n
item_dict ={}\n
check_variation = bool(context.getVariationCategoryList())\n check_variation = bool(context.getVariationCategoryList())\n
context.log(check_variation)\n
if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n
context.log(context.getObject())\n
acceptable_variation_category_list = \\\n acceptable_variation_category_list = \\\n
cartesianProduct(context.getObject().getCellRange(base_id=\'movement\'))\n cartesianProduct(context.getObject().getCellRange(base_id=\'movement\'))\n
context.log(acceptable_variation_category_list)\n
\n \n
for tracking_brain in portal.portal_simulation.getTrackingList(\n for tracking_brain in portal.portal_simulation.getTrackingList(\n
**tracking_parameters):\n **tracking_parameters):\n
...@@ -89,9 +83,8 @@ if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n ...@@ -89,9 +83,8 @@ if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n
item.Item_getVariationCategoryList(at_date=context.getStartDate())\\\n item.Item_getVariationCategoryList(at_date=context.getStartDate())\\\n
not in acceptable_variation_category_list:\n not in acceptable_variation_category_list:\n
continue\n continue\n
\n item_dict = "%s : %s"%(item.getTitle(),item.getQuantity(at_date=at_date))\n
result_list.append(item.getTitle())\n result_list.append(item_dict)\n
\n
return result_list\n return result_list\n
</string> </value> </string> </value>
</item> </item>
...@@ -147,6 +140,7 @@ return result_list\n ...@@ -147,6 +140,7 @@ return result_list\n
<string>_getitem_</string> <string>_getitem_</string>
<string>tracking_parameters</string> <string>tracking_parameters</string>
<string>result_list</string> <string>result_list</string>
<string>item_dict</string>
<string>bool</string> <string>bool</string>
<string>check_variation</string> <string>check_variation</string>
<string>True</string> <string>True</string>
...@@ -177,7 +171,7 @@ return result_list\n ...@@ -177,7 +171,7 @@ return result_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Inventory_getAggregatedItems</string> </value> <value> <string>Inventory_getAggregatedItemList</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Utils import cartesianProduct\n
from DateTime import DateTime\n
portal = context.getPortalObject()\n
request = portal.REQUEST\n
\n
at_date = request.form["at_date"]\n
context.log(at_date)\n
\n
tracking_parameters = {\n
\'node_uid\': context.node_uid,\n
\'resource_uid\': context.getResourceUid(),\n
\'section_uid\' : context.section_uid,\n
\'at_date\': context.getStartDate(),\n
\'output\': 0,\n
\n
\'item_catalog_title\': request.get(\'title\') or \'\',\n
\'item_catalog_reference\': request.get(\'reference\') or \'\',\n
\'item_catalog_portal_type\': \'Item\',\n
}\n
result_list = []\n
\n
check_variation = bool(context.getVariationCategoryList())\n
if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n
acceptable_variation_category_list = \\\n
cartesianProduct(context.getObject().getCellRange(base_id=\'movement\'))\n
\n
\n
for tracking_brain in portal.portal_simulation.getTrackingList(\n
**tracking_parameters):\n
item = tracking_brain.getObject()\n
\n
# XXX can this be done in SQL ?\n
# it could, by computing all variation texts, but I don\'t think this is\n
# really necessary.\n
if check_variation and \\\n
item.Item_getVariationCategoryList(at_date=context.getStartDate())\\\n
not in acceptable_variation_category_list:\n
continue\n
\n
result_list.append(item.getQuantity(at_date=DateTime().Date()))\n
\n
return result_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>at_date=None, site=None,positive_stock,negative_stock,zero_stock, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>at_date</string>
<string>site</string>
<string>positive_stock</string>
<string>negative_stock</string>
<string>zero_stock</string>
<string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>Products.ERP5Type.Utils</string>
<string>cartesianProduct</string>
<string>DateTime</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>request</string>
<string>_getitem_</string>
<string>tracking_parameters</string>
<string>result_list</string>
<string>bool</string>
<string>check_variation</string>
<string>True</string>
<string>acceptable_variation_category_list</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>tracking_brain</string>
<string>item</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Inventory_getAggregatedItemsQuantityList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -64,9 +64,6 @@ item_stock = context.REQUEST.form["item_stock"]\n ...@@ -64,9 +64,6 @@ item_stock = context.REQUEST.form["item_stock"]\n
if item_stock==1:\n if item_stock==1:\n
column_item_list.append((\'aggregate_title_list\',\n column_item_list.append((\'aggregate_title_list\',\n
\'Items aggregated\'))\n \'Items aggregated\'))\n
\n
column_item_list.append((\'aggregate_quantity_list\',\n
\'Items Quantity List\'))\n
\n \n
\n \n
return column_item_list\n return column_item_list\n
......
719 720
\ 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