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

pdm: make stock browser a report dialog

Having this as a dialog will make it possible for user to supply some
parameters.
In the old UI, this was relying on domain tree to let the user select
the sites they want to see, but in ERP5JS domain trees only work on
list mode listboxes.
Also, we have plans to make this browser more interactive, to let the
user choose more parameters (section category, quantity unit for
conversions etc) in the report dialog, but this was not possible in a
view action.
parent a7a7d7c3
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Resource_viewInventory</string> </value>
<value> <string>string:${object_url}/Resource_viewInventoryDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -77,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Resource_viewMovementHistory</string> </value>
<value> <string>string:${object_url}/Resource_viewMovementHistoryDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Resource_viewInventory?reset=1</string> </value>
<value> <string>string:${object_url}/Resource_viewInventoryDialog?reset=1</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -77,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Resource_viewMovementHistory</string> </value>
<value> <string>string:${object_url}/Resource_viewMovementHistoryDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Resource_viewInventory?reset=1</string> </value>
<value> <string>string:${object_url}/Resource_viewInventoryDialog?reset=1</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -35,8 +35,22 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......@@ -105,7 +119,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_viewInventory</string> </value>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......@@ -113,11 +127,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Resource_viewInventory</string> </value>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......@@ -139,6 +153,10 @@
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -363,6 +363,10 @@
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -373,6 +377,12 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
......@@ -429,17 +439,25 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string>Resource_viewInventory</string> </value>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
......@@ -453,6 +471,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
......@@ -473,6 +495,10 @@
<key> <string>report_tree</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
......@@ -515,10 +541,22 @@
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Stock per Variation</string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
......
......@@ -35,8 +35,22 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......@@ -104,7 +118,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_viewMovementHistory</string> </value>
<value> <string>Resource_viewMovementHistoryDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......@@ -112,11 +126,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Resource_viewMovementHistory</string> </value>
<value> <string>Resource_viewMovementHistoryDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......@@ -128,7 +142,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Resource Inventory</string> </value>
<value> <string>Movement History</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......@@ -138,6 +152,10 @@
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -436,7 +436,7 @@
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string>Resource_viewInventory</string> </value>
<value> <string>Resource_viewInventoryDialog</string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
......
......@@ -76,7 +76,7 @@ Test stock browser for components portal type
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -75,7 +75,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -76,7 +76,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -75,7 +75,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -76,7 +76,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -75,7 +75,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -75,7 +75,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -75,7 +75,7 @@ Test stock browser for confirmed state
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/go_to_stock_view" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>assertElementPresent</td>
......
......@@ -67,9 +67,9 @@
<tal:block metal:define-macro="go_to_stock_view">
<tr>
<td colspan="3"><b>Go to Stock view</b></td>
<td colspan="3"><b>Go to Stock report</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Views'}">
<tal:block tal:define="click_configuration python: {'text': 'Export'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
......
......@@ -62,7 +62,12 @@
</tr>
<tr>
<td>open</td>
<td>${base_url}/product_module/erp5_pdm_ui_test_product/Resource_viewInventory</td>
<td>${base_url}/product_module/erp5_pdm_ui_test_product/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@name="Base_doReport:method"]</td>
<td></td>
</tr>
<tr>
......@@ -71,6 +76,7 @@
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="toggleSaleSupplyLineBasePricePerSlice">
<tr>
<td>click</td>
......
......@@ -261,7 +261,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
if cname_id in ('transformed_resource_title', ):
return resource.absolute_url()
# A resource is defined, so try to display the movement list
form_id = 'Resource_viewMovementHistory'
form_id = 'Resource_viewMovementHistoryDialog'
query_kw = self.getListItemParamDict(cname_id,
selection_index,
selection_name
......
......@@ -5,7 +5,7 @@
skins_tool = context.portal_skins
selection_name_dict = {}
ok_to_share_selection_form_list = ['Resource_viewInventory', 'Resource_viewMovementHistory']
ok_to_share_selection_form_list = ['Resource_viewInventoryDialog', 'Resource_viewMovementHistoryDialog']
for skin_name, skin_path_list in skins_tool.getSkinPaths():
skins_tool.changeSkin(skin_name)
......
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