diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py index ab5a666f7a4bc4ee8637bedc3f0a77bcf6c82d96..e6752e6e54b717b3d755675c554d437775057c27 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.py @@ -44,6 +44,10 @@ mirror_section = mirror_section or request.get('mirror_section') if mirror_section: search_kw['mirror_section_uid'] = portal.restrictedTraverse( mirror_section).getUid() +ledger = ledger or request.get('ledger') +if ledger: + search_kw['ledger_uid'] = [ + portal.portal_categories.restrictedTraverse(x).getUid() for x in ledger] if grouping == 'grouping': search_kw['grouping_reference'] = None diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.xml index 6412a5069cdf159cb31d0244b51ae3c4e0be1702..5fc1f96c92a3b9dc0f9021ae3b370d4f7a709c02 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getTransactionLineListForGroupingReference.xml @@ -50,7 +50,7 @@ </item> <item> <key> <string>_params</string> </key> - <value> <string>selection=None, grouping=\'grouping\', node=\'\', mirror_section=\'\', title=None, delivery_reference=None, debit_price=None, credit_price=None, date=None, **kw</string> </value> + <value> <string>selection=None, grouping=\'grouping\', node=\'\', mirror_section=\'\', ledger=\'\', title=None, delivery_reference=None, debit_price=None, credit_price=None, date=None, **kw</string> </value> </item> <item> <key> <string>id</string> </key> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog.xml index 1e69559db4c1947870ad4b4bef735c36468cd99e..3e9bd2b50a70939542064ef4633295151e776efd 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog.xml @@ -75,6 +75,7 @@ <list> <string>your_node</string> <string>your_mirror_section</string> + <string>your_ledger</string> </list> </value> </item> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog/your_ledger.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog/your_ledger.xml new file mode 100644 index 0000000000000000000000000000000000000000..798bcb9c77e878cfd57391e168f78ce17c632e1d --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewGroupingFastInputDialog/your_ledger.xml @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>your_ledger</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_ledger</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> diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.xml b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.xml new file mode 100644 index 0000000000000000000000000000000000000000..f49a34ad513f8caf433f8acca807d590a37ddbf5 --- /dev/null +++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.xml @@ -0,0 +1,58 @@ +<?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_ledger.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> diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.zpt b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.zpt new file mode 100644 index 0000000000000000000000000000000000000000..25c5ecc1944719818a29968494bb512bc36dc72c --- /dev/null +++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_grouping_reference/test_group_dialog_ledger.html.zpt @@ -0,0 +1,156 @@ +<html> +<head><title>Using Ledger in Grouping Dialog</title></head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="4"> +Using Ledger in Grouping Dialog +</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>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> + +<!-- in test ledger 2, we have no transactions. --> +<tr> + <td>select</td> + <td>field_your_ledger</td> + <td>label=Test Accounting/Test Ledger 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> + +<!-- in test ledger 1, we have 2 transactions. --> +<tr> + <td>select</td> + <td>field_your_ledger</td> + <td>label=Test Accounting/Test Ledger 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> + +<!-- in test ledger 1 and 2, we have 2 transactions. --> +<tr> + <td>addSelection</td> + <td>field_your_ledger</td> + <td>label=Test Accounting/Test Ledger 1</td> +</tr> +<tr> + <td>addSelection</td> + <td>field_your_ledger</td> + <td>label=Test Accounting/Test Ledger 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>2 records</td> +</tr> + +<!-- }}} --> + +</tbody></table> +</body> +</html> <!-- vim: syntax=html foldmethod=marker +--> \ No newline at end of file