Commit 55a03d29 authored by Jérome Perrin's avatar Jérome Perrin

fix stock report by site with items, it was not working when multiple movements were moving items

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41320 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2504d127
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>columns</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>title</string>
<string>selection_name</string>
<string>list_method</string> <string>list_method</string>
<string>selection_name</string>
<string>sort_columns</string> <string>sort_columns</string>
<string>columns</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -71,10 +75,26 @@ ...@@ -71,10 +75,26 @@
<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>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -179,7 +199,7 @@ ...@@ -179,7 +199,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: field.get_orig_value(\'columns\') + (context.REQUEST.form.get("item_stock") == 1 and [(\'aggregate_title_list\',\'Items aggregated\')] or [])</string> </value> <value> <string>python: field.get_orig_value(\'columns\') + (context.REQUEST.form.get("item_stock") == 1 and [(\'aggregate_title_list\', \'Aggregated Items\')] or [])</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: cell.Inventory_getAggregatedItemList()</string> </value> <value> <string>python: cell.Inventory_getAggregatedItemList(at_date=request[\'at_date\'])</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,40 +50,35 @@ ...@@ -50,40 +50,35 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Document import newTempBase\n <value> <string>from DateTime import DateTime\n
from Products.ERP5Type.Utils import cartesianProduct\n
from DateTime import DateTime\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
request = portal.REQUEST\n request = portal.REQUEST\n
#at_date = DateTime(request.form["at_date"].Date())\n
at_date = DateTime().Date()\n
\n \n
tracking_parameters = {\n if not at_date:\n
\'node_uid\': context.node_uid,\n at_date=DateTime()\n
\'resource_uid\': context.getResourceUid(),\n \n
\'section_uid\' : context.section_uid,\n brain = context\n
\'at_date\': context.getStartDate(),\n \n
\'output\': 1,\n tracking_parameters = dict(\n
}\n node_uid=brain.node_uid,\n
resource_uid=brain.resource_uid,\n
at_date=at_date,\n
output=True,)\n
\n
result_list = []\n result_list = []\n
item_dict ={}\n
check_variation = bool(context.getVariationCategoryList())\n
\n \n
if check_variation==True and context.getPortalType()!=\'Simulation Movement\':\n current_variation = context.getVariationCategoryList()\n
acceptable_variation_category_list = \\\n \n
cartesianProduct(context.getObject().getCellRange(base_id=\'movement\'))\n for tracking_brain in portal.portal_simulation.getCurrentTrackingList(\n
\n
for tracking_brain in portal.portal_simulation.getCurrentTrackingList(\n
**tracking_parameters):\n **tracking_parameters):\n
item = tracking_brain.getObject()\n item = tracking_brain.getObject()\n
\n \n
if current_variation and\\\n
item.Item_getVariationCategoryList(at_date=at_date) != current_variation:\n
continue\n
\n \n
if check_variation and \\\n item_dict = "%s : %s"% ( item.getReference(), item.getQuantity(at_date=at_date) )\n
item.Item_getVariationCategoryList(at_date=context.getStartDate())\\\n result_list.append(item_dict)\n
!=context.getVariationCategoryList():\n
continue\n
item_dict = "%s : %s"%(item.getReference(),item.getQuantity(at_date=at_date))\n
result_list.append(item_dict)\n
\n \n
return result_list\n return result_list\n
</string> </value> </string> </value>
...@@ -96,7 +91,7 @@ return result_list\n ...@@ -96,7 +91,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, positive_stock=None, negative_stock=None, zero_stock=None, **kw</string> </value> <value> <string>at_date=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -116,38 +111,30 @@ return result_list\n ...@@ -116,38 +111,30 @@ return result_list\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>5</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>at_date</string> <string>at_date</string>
<string>site</string>
<string>positive_stock</string>
<string>negative_stock</string>
<string>zero_stock</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>Products.ERP5Type.Utils</string>
<string>cartesianProduct</string>
<string>DateTime</string> <string>DateTime</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>request</string> <string>request</string>
<string>brain</string>
<string>dict</string>
<string>True</string>
<string>tracking_parameters</string> <string>tracking_parameters</string>
<string>result_list</string> <string>result_list</string>
<string>item_dict</string> <string>current_variation</string>
<string>bool</string>
<string>check_variation</string>
<string>True</string>
<string>acceptable_variation_category_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>_apply_</string> <string>_apply_</string>
<string>tracking_brain</string> <string>tracking_brain</string>
<string>item</string> <string>item</string>
<string>item_dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -161,10 +148,6 @@ return result_list\n ...@@ -161,10 +148,6 @@ return result_list\n
<value> <value>
<tuple> <tuple>
<none/> <none/>
<none/>
<none/>
<none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1078 1080
\ 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