Commit 8dc7e6f4 authored by Jérome Perrin's avatar Jérome Perrin

accounting: allow searching by section category in grouping dialog

parent c564c658
......@@ -28,8 +28,13 @@ for column in portal.portal_selections.getSelectionSortOrder(
continue
sort_on.append((column_id, column[1]))
section_category = portal.portal_preferences.getPreferredAccountingTransactionSectionCategory()
section_category_strict = portal.portal_preferences.getPreferredAccountingSectionCategoryStrict()
section_category = kw.get(
'section_category',
portal.portal_preferences.getPreferredAccountingTransactionSectionCategory())
section_category_strict = kw.get(
'section_category_strict',
portal.portal_preferences.getPreferredAccountingSectionCategoryStrict())
section_uid = portal.Base_getSectionUidListForSectionCategory(
section_category, section_category_strict)
......
......@@ -99,7 +99,8 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_grouping</string>
<string>your_section_category</string>
<string>your_section_category_strict</string>
</list>
</value>
</item>
......@@ -107,6 +108,7 @@
<key> <string>right</string> </key>
<value>
<list>
<string>your_grouping</string>
<string>your_total_selected_amount</string>
</list>
</value>
......
<?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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_section_category</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>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_section_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>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>preferences/getPreferredAccountingTransactionSectionCategory</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.portal_categories.group.getCategoryChildIndentedTitleItemList(base=1)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_section_category_strict</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_section_category_strict</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>AccountModule_viewDialogFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_group_dialog_filter_by_section_category.html</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html>
<head><title>Filtering Grouping Dialog by section category</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="4">
Filtering Grouping Dialog by section category
</td></tr>
</thead><tbody tal:define="init_method string:AccountingZuite_createAccountingTransactionList?add_draft_transactions:int=0&add_related_payments:int=1&set_ledger:int=1">
<!-- Setup {{{ -->
<tal:block metal:use-macro="here/AccountingZuite_CommonTemplate/macros/init"/>
<tr>
<td>selectAndWait</td>
<td>select_module</td>
<td>Organisations</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Folder_show:method</td>
<td></td>
</tr>
<tr>
<td>type</td>
<!-- title -->
<td>//tr[@class='listbox-search-line']/th[2]/input</td>
<td>Client 1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@class="listbox-select-action"]</td>
<td></td>
</tr>
<!-- }}} -->
<!-- {{{ Select Client 1 Organisation and use grouping fast input -->
<tr>
<td>clickAndWait</td>
<td>link=Client 1</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//img[@alt='Grouping Reference Fast Input']</td>
<td></td>
</tr>
<!-- The mode should be 'grouping' by default -->
<tr>
<td>verifyValue</td>
<td>//input[@name='field_your_grouping' and @value='grouping']</td>
<td>on</td>
</tr>
<tr>
<td>verifySelected</td>
<td>//select[@name='field_your_section_category']</td>
<td>Demo Group</td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name='field_your_section_category_strict']</td>
<td>off</td>
</tr>
<tr>
<td>verifyText</td>
<td>//label[contains(text(),"Total Selected Amount")]/../div[1]/</td>
<td>0.00</td>
</tr>
<tr>
<td>select</td>
<td>field_your_node</td>
<td>label=41 - Receivable</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id="dialog_update_button"]</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Updated</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- "My Organisation" belongs to Demo Group/Subsidiairy #1, if we select Demo Group we have two transactions. -->
<tr>
<td>select</td>
<td>field_your_section_category</td>
<td>label=Demo Group/Subsidiairy #1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id="dialog_update_button"]</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Updated</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- select Demo Group strict we have no transactions. -->
<tr>
<td>select</td>
<td>field_your_section_category</td>
<td>label=Demo Group</td>
</tr>
<tr>
<td>click</td>
<td>field_your_section_category_strict</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id="dialog_update_button"]</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Updated</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>0 records</td>
</tr>
<!-- select Demo Group non strict we have two transactions. -->
<tr>
<td>select</td>
<td>field_your_section_category</td>
<td>label=Demo Group</td>
</tr>
<tr>
<td>assertValue</td>
<td>field_your_section_category_strict</td>
<td>on</td>
</tr>
<tr>
<td>click</td>
<td>field_your_section_category_strict</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id="dialog_update_button"]</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Updated</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<!-- select Demo Group/Subsidiairy #2 we have no transactions. -->
<tr>
<td>select</td>
<td>field_your_section_category</td>
<td>label=Demo Group/Subsidiairy #2</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@id="dialog_update_button"]</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Updated</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>0 records</td>
</tr>
</tbody></table>
</body>
</html> <!-- vim: syntax=html foldmethod=marker
-->
\ 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