Commit a8b2267c authored by Jérome Perrin's avatar Jérome Perrin

Budget Consumption Report: allow filtering by budget model and budget type

parent e5be9d4f
......@@ -107,6 +107,8 @@
<value>
<list>
<string>your_validation_state</string>
<string>your_budget_type</string>
<string>your_specialise</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</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_budget_type</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>your_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDialogFieldLibrary</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>Budget Type</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -76,12 +76,16 @@ else:\n
# ... or on the budget module, and in this case, all budgets are used\n
defined_group = request[\'section_category\']\n
strict_section_membership = request.get(\'section_category_strict\', False)\n
validation_state = request.get(\'validation_state\', [])\n
\n
budget_list = portal.portal_catalog.searchResults(\n
portal_type=\'Budget\',\n
validation_state=validation_state)\n
\n
search_kw = dict(portal_type=\'Budget\',\n
validation_state=validation_state)\n
budget_type = request.get(\'budget_type\')\n
if budget_type:\n
search_kw[\'default_budget_type_uid\'] = portal.portal_categories.budget_type.restrictedTraverse(budget_type).getUid()\n
specialise = request.get(\'specialise\')\n
if specialise:\n
search_kw[\'default_specialise_uid\'] = portal.restrictedTraverse(specialise).getUid()\n
\n
budget_list = portal.portal_catalog.searchResults(**search_kw)\n
group_filtered_budget_list = []\n
filtered_budget_list = []\n
for budget in budget_list:\n
......
358
\ No newline at end of file
363
\ 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