Commit 021e0d41 authored by Sebastien Robin's avatar Sebastien Robin

add one tab on counter dates in order to display remaining operations.

fixed problem while checking if all counters are empty

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11910 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 686a6c79
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.5</float> </value>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>remaining_operations</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Remaining Operations</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/CounterDate_viewRemainingOperationList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -76,15 +76,18 @@ if site is None:\n
root_site_url = context.Baobab_getUserAssignedRootSiteList()[0]\n
site = context.portal_categories.restrictedTraverse(root_site_url)\n
root_site_uid = site.getUid()\n
portal_type_list = context.getPortalDeliveryTypeList()\n
document_list = [x.getObject() for x in context.portal_catalog(\n
portal_type_list = [x for x in context.getPortalDeliveryTypeList() if x!=\'Cash Movement\']\n
document_list = context.Baobab_getRemainingOperationList(source_uid=root_site_uid,\n
simulation_state=not_closed_state_list,\n
default_source_uid=root_site_uid,\n
portal_type=portal_type_list)]\n
document_list.extend([x.getObject() for x in context.portal_catalog(\n
simulation_state=not_closed_state_list,\n
default_destination_uid=root_site_uid,\n
portal_type=portal_type_list)])\n
portal_type = portal_type_list)\n
#document_list = [x.getObject() for x in context.portal_catalog(\n
# simulation_state=not_closed_state_list,\n
# default_source_uid=root_site_uid,\n
# portal_type=portal_type_list)]\n
#document_list.extend([x.getObject() for x in context.portal_catalog(\n
# simulation_state=not_closed_state_list,\n
# default_destination_uid=root_site_uid,\n
# portal_type=portal_type_list)])\n
for document in document_list:\n
# Cash movement in ordered stated are allowed\n
if document.getPortalType() in (\'Cash Movement\',):\n
......@@ -156,11 +159,11 @@ for document in document_list:\n
<string>context</string>
<string>root_site_url</string>
<string>root_site_uid</string>
<string>portal_type_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>portal_type_list</string>
<string>document_list</string>
<string>document</string>
<string>Products.ERP5Type.Message</string>
......
......@@ -100,6 +100,8 @@ for counter_vault in counter_vault_list:\n
group_by_variation=1,\n
ignore_variation=0)\n
if len(inventory_list)>0:\n
for inventory in inventory_list:\n
if inventory.total_qantity>0:\n
message = Message(domain=\'ui\',\n
message=\'Sorry, some resources are still remaining here : $counter_title\',\n
mapping={\'counter_title\':counter_title})\n
......@@ -193,6 +195,7 @@ if total_price > max_price:\n
<string>counter_title</string>
<string>inventory_list</string>
<string>len</string>
<string>inventory</string>
<string>message</string>
<string>max_price</string>
<string>usual_cash</string>
......
......@@ -70,9 +70,17 @@
<key> <string>_body</string> </key>
<value> <string># get all operations related to ths site\n
# as source\n
kwd_source = {\'source_uid\' : site_uid, \'delivery.start_date\' : date, \'simulation_state\' : \'confirmed\'}\n
if simulation_state is None:\n
simulation_state = [\'confirmed\']\n
kwd_source = {\'default_source_uid\' : site_uid,\'simulation_state\' : simulation_state}\n
kwd_destination = {\'default_destination_uid\' : site_uid,\'simulation_state\' : simulation_state}\n
if date is not None:\n
kwd_source[\'delivery.start_date\']=date\n
kwd_destination[\'delivery.start_date\']=date\n
if portal_type is not None:\n
kwd_source[\'portal_type\'] = portal_type\n
kwd_destination[\'portal_type\'] = portal_type\n
# as destination\n
kwd_destination = {\'destination_uid\' : site_uid, \'delivery.start_date\' : date, \'simulation_state\' : \'confirmed\'}\n
operation_list = list(context.portal_catalog(**kwd_source)) + list(context.portal_catalog(**kwd_destination))\n
operation_list_object = [x.getObject() for x in operation_list]\n
\n
......@@ -99,7 +107,7 @@ return operation_list_object\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>site_uid, date, simulation_state=[]</string> </value>
<value> <string>site_uid=None, date=None, simulation_state=None,portal_type=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -119,7 +127,7 @@ return operation_list_object\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>3</int> </value>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -128,8 +136,11 @@ return operation_list_object\n
<string>site_uid</string>
<string>date</string>
<string>simulation_state</string>
<string>portal_type</string>
<string>None</string>
<string>kwd_source</string>
<string>kwd_destination</string>
<string>_write_</string>
<string>list</string>
<string>_apply_</string>
<string>_getattr_</string>
......@@ -152,7 +163,10 @@ return operation_list_object\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<list/>
<none/>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>site_uid = context.getSiteUid()\n
operation_list = []\n
if site_uid is not None:\n
not_closed_state_list = (\'ordered\',\'planned\',\'confirmed\',\'started\',\'stopped\')\n
portal_type_list = [x for x in context.getPortalDeliveryTypeList() if x != \'Cash Movement\']\n
operation_list.extend(context.Baobab_getRemainingOperationList(\n
site_uid=site_uid,\n
simulation_state=not_closed_state_list,\n
portal_type=portal_type_list))\n
\n
\n
return operation_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>site_uid</string>
<string>operation_list</string>
<string>None</string>
<string>not_closed_state_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>portal_type_list</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CounterDate_getRemainingOperationList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CounterDate_viewRemainingOperationList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>CounterDate_viewRemainingOperationList</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
97
\ No newline at end of file
102
\ No newline at end of file
......@@ -54,6 +54,7 @@ Counter Date Module | sort_on
Counter Date Module | view
Counter Date | history
Counter Date | metadata
Counter Date | remaining_operations
Counter Date | view
Counter Module | list_ui
Counter Module | sort_on
......
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