From 90160a47bbb710d7987301dfa75cab67c6822206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 12 Jun 2020 20:00:51 +0900 Subject: [PATCH] pdm: allow to select node category in stock browser dialog This allows to filter the node by site in new and old interface in a consistent way. The domain tree is also removed for consistency (so that we don't have different features on new and old interface) Old UI tests have also been updated to use more meaningful macro names. --- .../erp5_pdm/Base_viewPDMFieldLibrary.xml | 1 + .../my_dialog_mode_node_category.xml | 135 ++++++++++++++++++ .../Resource_getFutureInventoryList.py | 15 ++ .../Resource_getFutureInventoryList.xml | 62 ++++++++ .../erp5_pdm/Resource_statInventory.py | 12 +- .../erp5_pdm/Resource_statInventory.xml | 2 +- .../erp5_pdm/Resource_viewInventoryDialog.xml | 9 +- .../Resource_viewInventoryDialog/listbox.xml | 40 +----- .../your_node_category.xml | 120 ++++++++++++++++ .../stock_browser_zuite/confirmed_state.zpt | 8 +- .../stock_browser_zuite/delivered_state.zpt | 8 +- .../stock_browser_zuite/draft_state.zpt | 8 +- .../stock_browser_zuite/ordered_state.zpt | 8 +- .../stock_browser_zuite/planned_state.zpt | 8 +- .../stock_browser_zuite/ready_state.zpt | 8 +- .../stock_browser_zuite/started_state.zpt | 8 +- .../stock_browser_zuite/stopped_state.zpt | 8 +- .../PdmZuite_CommonTemplate.zpt | 5 - .../PdmZuite_checkStockBrowser.zpt | 23 ++- 19 files changed, 407 insertions(+), 81 deletions(-) create mode 100644 bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary/my_dialog_mode_node_category.xml create mode 100644 bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.py create mode 100644 bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.xml create mode 100644 bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/your_node_category.xml diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary.xml index 8a6e33e760..58ab9b820f 100644 --- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary.xml +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary.xml @@ -229,6 +229,7 @@ <string>my_base_price_per_slice</string> <string>my_report_mode_listbox_variation_category_item_list</string> <string>my_view_mode_read_only_title</string> + <string>my_dialog_mode_node_category</string> </list> </value> </item> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary/my_dialog_mode_node_category.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary/my_dialog_mode_node_category.xml new file mode 100644 index 0000000000..52d236b309 --- /dev/null +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Base_viewPDMFieldLibrary/my_dialog_mode_node_category.xml @@ -0,0 +1,135 @@ +<?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>items</string> + <string>required</string> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_dialog_mode_node_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>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">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</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>my_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>required</string> </key> + <value> <int>1</int> </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>Site</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>python: getattr(here.portal_categories.site, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\', base=True)</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.py b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.py new file mode 100644 index 0000000000..9ebe536f5e --- /dev/null +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.py @@ -0,0 +1,15 @@ +from Products.PythonScripts.standard import Object +portal = context.getPortalObject() + +inventory_kw = { + 'selection_domain': selection_domain, + 'group_by_section': False, + 'group_by_node': True, + 'group_by_variation': True, + 'resource_uid': context.getUid(), +} + +if node_category: + inventory_kw['node_category'] = node_category + +return portal.portal_simulation.getFutureInventoryList(**inventory_kw) diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.xml new file mode 100644 index 0000000000..774807f032 --- /dev/null +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getFutureInventoryList.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </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>_params</string> </key> + <value> <string>node_category=None, selection_domain=None, **kw</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Resource_getFutureInventoryList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.py b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.py index 471fbfb628..1a778cb473 100644 --- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.py +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.py @@ -1,10 +1,16 @@ from Products.PythonScripts.standard import Object +inventory_kw = { + 'selection_domain': selection_domain +} +if node_category: + inventory_kw['node_category'] = node_category + obj = Object(uid="new_") obj["node_title"] = "" obj["section_title"] = "" obj["variation_text"] = "" -obj["getCurrentInventory"] = context.getCurrentInventory(selection_domain=kw.get('selection_domain', None)) -obj["getAvailableInventory"] = context.getAvailableInventory(selection_domain=kw.get('selection_domain', None)) -obj["inventory"] = context.getFutureInventory(selection_domain=kw.get('selection_domain', None)) +obj["getCurrentInventory"] = context.getCurrentInventory(**inventory_kw) +obj["getAvailableInventory"] = context.getAvailableInventory(**inventory_kw) +obj["inventory"] = context.getFutureInventory(**inventory_kw) return [obj,] diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.xml index 76aff791f9..289c3e832e 100644 --- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.xml +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_statInventory.xml @@ -50,7 +50,7 @@ </item> <item> <key> <string>_params</string> </key> - <value> <string>**kw</string> </value> + <value> <string>node_category=None, selection_domain=None, **kw</string> </value> </item> <item> <key> <string>id</string> </key> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog.xml index 3a9241cdd8..e2f1466ac3 100644 --- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog.xml +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog.xml @@ -86,9 +86,7 @@ <item> <key> <string>center</string> </key> <value> - <list> - <string>my_title</string> - </list> + <list/> </value> </item> <item> @@ -105,7 +103,10 @@ <item> <key> <string>left</string> </key> <value> - <list/> + <list> + <string>my_title</string> + <string>your_node_category</string> + </list> </value> </item> <item> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/listbox.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/listbox.xml index 2c5cc13e8c..8eaee0ca31 100644 --- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/listbox.xml +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/listbox.xml @@ -351,9 +351,7 @@ </item> <item> <key> <string>count_method</string> </key> - <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> - </value> + <value> <string></string> </value> </item> <item> <key> <string>css_class</string> </key> @@ -386,17 +384,12 @@ <item> <key> <string>domain_root_list</string> </key> <value> - <list> - <tuple> - <string>site</string> - <string>Site</string> - </tuple> - </list> + <list/> </value> </item> <item> <key> <string>domain_tree</string> </key> - <value> <int>1</int> </value> + <value> <int>0</int> </value> </item> <item> <key> <string>editable</string> </key> @@ -462,7 +455,7 @@ <item> <key> <string>list_method</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> </value> </item> <item> @@ -538,7 +531,7 @@ <item> <key> <string>stat_method</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> @@ -571,13 +564,7 @@ </record> <record id="2" aka="AAAAAAAAAAI="> <pickle> - <tuple> - <tuple> - <string>Products.Formulator.TALESField</string> - <string>TALESMethod</string> - </tuple> - <none/> - </tuple> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> </pickle> <pickle> <dictionary> @@ -596,25 +583,12 @@ <dictionary> <item> <key> <string>method_name</string> </key> - <value> <string>getFutureInventoryCount</string> </value> + <value> <string>Resource_getFutureInventoryList</string> </value> </item> </dictionary> </pickle> </record> <record id="4" aka="AAAAAAAAAAQ="> - <pickle> - <global name="Method" module="Products.Formulator.MethodField"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>method_name</string> </key> - <value> <string>getFutureInventoryList</string> </value> - </item> - </dictionary> - </pickle> - </record> - <record id="5" aka="AAAAAAAAAAU="> <pickle> <global name="Method" module="Products.Formulator.MethodField"/> </pickle> diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/your_node_category.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/your_node_category.xml new file mode 100644 index 0000000000..842801452a --- /dev/null +++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_viewInventoryDialog/your_node_category.xml @@ -0,0 +1,120 @@ +<?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>default</string> + <string>required</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>your_node_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>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> <string></string> </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_dialog_mode_node_category</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewPDMFieldLibrary</string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</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> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>preferences/getPreferredNodeCategory</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/confirmed_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/confirmed_state.zpt index dcc745c685..53c8a2193d 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/confirmed_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/confirmed_state.zpt @@ -14,23 +14,23 @@ Test stock browser for confirmed state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: -1.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/delivered_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/delivered_state.zpt index 1ff190b4f7..950cece780 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/delivered_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/delivered_state.zpt @@ -14,23 +14,23 @@ Test stock browser for delivered state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: -1.0; available_inventory python: -1.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 1.0; available_inventory python: 1.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/draft_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/draft_state.zpt index 1e0cb961e8..666f4fa398 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/draft_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/draft_state.zpt @@ -14,15 +14,15 @@ Test stock browser for draft state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 0;"> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 0;"> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ordered_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ordered_state.zpt index d28d228cab..9d465a96e2 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ordered_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ordered_state.zpt @@ -14,23 +14,23 @@ Test stock browser for ordered state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/planned_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/planned_state.zpt index 6f7716fb14..7f050f4fe2 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/planned_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/planned_state.zpt @@ -14,23 +14,23 @@ Test stock browser for planned state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ready_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ready_state.zpt index dbb843dea9..0ef2693eaf 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ready_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/ready_state.zpt @@ -14,23 +14,23 @@ Test stock browser for ready state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: -1.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/started_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/started_state.zpt index b7cccca1d8..454bede869 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/started_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/started_state.zpt @@ -14,23 +14,23 @@ Test stock browser for started state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: -1.0; available_inventory python: -1.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 0.0; available_inventory python: 0.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/stopped_state.zpt b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/stopped_state.zpt index 2894319a18..46f78fffb8 100644 --- a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/stopped_state.zpt +++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/stock_browser_zuite/stopped_state.zpt @@ -14,23 +14,23 @@ Test stock browser for stopped state <!-- }}} --> <!-- Check source --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_source_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; movement_count python: 1; current_inventory python: -1.0; available_inventory python: -1.0; future_inventory python: -1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> <!-- Check destination --> -<tal:block tal:define="link_title python: 'erp5_pdm_ui_test_destination_site'; +<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; movement_count python: 1; current_inventory python: 1.0; available_inventory python: 1.0; future_inventory python: 1.0; "> - <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/init" /> + <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> </tal:block> </tbody></table> diff --git a/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_CommonTemplate.zpt b/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_CommonTemplate.zpt index a65fb8ce83..cb88020005 100644 --- a/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_CommonTemplate.zpt +++ b/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_CommonTemplate.zpt @@ -70,11 +70,6 @@ <td>//button[@name="Base_doReport:method"]</td> <td></td> </tr> - <tr> - <td>clickAndWait</td> - <td>//input[@class="listbox-tree-domain-tree-mode"]</td> - <td></td> - </tr> </tal:block> <tal:block metal:define-macro="toggleSaleSupplyLineBasePricePerSlice"> diff --git a/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_checkStockBrowser.zpt b/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_checkStockBrowser.zpt index fa2d41bac5..12c82874ef 100644 --- a/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_checkStockBrowser.zpt +++ b/bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_checkStockBrowser.zpt @@ -1,11 +1,16 @@ <tal:block xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal"> - <tal:block metal:define-macro="init" tal:define="base_url python: '/' + here.getPortalObject().getId()"> + <tal:block metal:define-macro="check_inventory" tal:define="base_url python: '/' + here.getPortalObject().getId()"> - <!-- Click on + link --> + <!-- Select node category in dialog --> + <tr> + <td>select</td> + <td>//select[@name="field_your_node_category"]</td> + <td tal:content='node_category'></td> + </tr> <tr> <td>clickAndWait</td> - <td tal:content='string://button[@value="site/${link_title}.0"]'>link=node</td> + <td>Base_callDialogMethod:method</td> <td></td> </tr> @@ -50,6 +55,18 @@ <td>//a[@class="listbox_title"]</td> <td></td> </tr> + + <!-- Select node category in dialog (again) --> + <tr> + <td>select</td> + <td>//select[@name="field_your_node_category"]</td> + <td tal:content='node_category'></td> + </tr> + <tr> + <td>clickAndWait</td> + <td>Base_callDialogMethod:method</td> + <td></td> + </tr> </tal:block> </tal:block> </tal:block> -- 2.30.9