Commit f277e8da authored by Sebastien Robin's avatar Sebastien Robin

2009-10-27 Seb

* Allows to select the state of project when call the milestone report

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30044 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc26619d
...@@ -62,12 +62,14 @@ listbox = []\n ...@@ -62,12 +62,14 @@ listbox = []\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery\n
query_kw = {}\n query_kw = {}\n
query_kw[\'simulation_state\'] = [\'draft\', \'cancelled\']\n
\n \n
project_list = portal.portal_catalog(portal_type=\'Project\',\n sql_kw = {}\n
validation_state = NegatedQuery(Query(**query_kw)))\n if project_validation_state_list is not None and \\\n
len(project_validation_state_list):\n
sql_kw[\'validation_state\'] = project_validation_state_list\n
\n
project_list = portal.portal_catalog(portal_type=\'Project\', **sql_kw)\n
project_uid_list = [x.uid for x in project_list]\n project_uid_list = [x.uid for x in project_list]\n
\n \n
\n \n
...@@ -92,7 +94,9 @@ select_dict = {}\n ...@@ -92,7 +94,9 @@ select_dict = {}\n
select_dict[\'movement.stop_date\'] = None\n select_dict[\'movement.stop_date\'] = None\n
select_dict[\'catalog.title\'] = None\n select_dict[\'catalog.title\'] = None\n
select_dict[\'parent_title\'] = None\n select_dict[\'parent_title\'] = None\n
milestone_list = [x for x in portal.portal_catalog(parent_uid=project_uid_list,\n milestone_list = []\n
if len(project_uid_list):\n
milestone_list = [x for x in portal.portal_catalog(parent_uid=project_uid_list,\n
portal_type=\'Project Milestone\', select_dict=select_dict, **sql_kw)]\n portal_type=\'Project Milestone\', select_dict=select_dict, **sql_kw)]\n
\n \n
milestone_list.sort(key = lambda x: (x.parent_title, x.stop_date, x.title))\n milestone_list.sort(key = lambda x: (x.parent_title, x.stop_date, x.title))\n
...@@ -119,7 +123,7 @@ return context.ProjectModule_viewMilestoneReport()\n ...@@ -119,7 +123,7 @@ return context.ProjectModule_viewMilestoneReport()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>from_date=None, at_date=None, **kw</string> </value> <value> <string>from_date=None, at_date=None, project_validation_state_list=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
...@@ -147,7 +151,7 @@ return context.ProjectModule_viewMilestoneReport()\n ...@@ -147,7 +151,7 @@ return context.ProjectModule_viewMilestoneReport()\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>2</int> </value> <value> <int>3</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -155,17 +159,17 @@ return context.ProjectModule_viewMilestoneReport()\n ...@@ -155,17 +159,17 @@ return context.ProjectModule_viewMilestoneReport()\n
<tuple> <tuple>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>project_validation_state_list</string>
<string>kw</string> <string>kw</string>
<string>listbox</string> <string>listbox</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>translateString</string> <string>translateString</string>
<string>portal</string> <string>portal</string>
<string>Products.ZSQLCatalog.SQLCatalog</string>
<string>Query</string>
<string>NegatedQuery</string>
<string>ComplexQuery</string>
<string>query_kw</string> <string>query_kw</string>
<string>sql_kw</string>
<string>None</string>
<string>len</string>
<string>_write_</string> <string>_write_</string>
<string>_apply_</string> <string>_apply_</string>
<string>project_list</string> <string>project_list</string>
...@@ -174,10 +178,9 @@ return context.ProjectModule_viewMilestoneReport()\n ...@@ -174,10 +178,9 @@ return context.ProjectModule_viewMilestoneReport()\n
<string>_getiter_</string> <string>_getiter_</string>
<string>x</string> <string>x</string>
<string>project_uid_list</string> <string>project_uid_list</string>
<string>sql_kw</string>
<string>query_list</string> <string>query_list</string>
<string>None</string> <string>Query</string>
<string>len</string> <string>ComplexQuery</string>
<string>select_dict</string> <string>select_dict</string>
<string>milestone_list</string> <string>milestone_list</string>
<string>milestone</string> <string>milestone</string>
...@@ -197,6 +200,7 @@ return context.ProjectModule_viewMilestoneReport()\n ...@@ -197,6 +200,7 @@ return context.ProjectModule_viewMilestoneReport()\n
<tuple> <tuple>
<none/> <none/>
<none/> <none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<value> <value>
<list> <list>
<string>left</string> <string>left</string>
<string>right</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -76,6 +77,14 @@ ...@@ -76,6 +77,14 @@
<list> <list>
<string>my_from_date</string> <string>my_from_date</string>
<string>my_at_date</string> <string>my_at_date</string>
<string>my_project_validation_state_list</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>your_format</string> <string>your_format</string>
<string>your_portal_skin</string> <string>your_portal_skin</string>
</list> </list>
......
<?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>default</string>
<string>items</string>
<string>size</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_project_validation_state_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>
</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>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</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>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </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: [x[1] for x in field.get_value(\'items\') if x[1] not in (\'draft\', \'invalidated\')]</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: here.Base_getTranslatedWorkflowStateItemList(wf_id=\'project_workflow\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: len(field.get_value(\'items\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
683 684
\ 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