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

Fix a warning with Catalog and redirects to erp5_xhtml_style interface from ZMI views

When editing components, this warning is displayed on the console:
```
Ambiguous name for method of Products.ERP5.Document.SQLMethod.SQLMethod: 'manage_main' != 'manage'
```
fix by adding the same `_setName` that the [parent class does](https://github.com/zopefoundation/Products.ZSQLMethods/blob/2.13/src/Products/ZSQLMethods/SQL.py#L143).


While looking a this, I realized that clicking on the breadcrumb in the ZMI, any part of

![image](/uploads/5e42659d8124b7566fb09cc76958a345/image.png)

would redirect to the ERP5 xhtml style view.

/reviewed-on !782
parents 97480b84 0c0fa0d2
...@@ -77,10 +77,12 @@ class SQLMethod(XMLObject, ZSQL, ExpressionMixin): ...@@ -77,10 +77,12 @@ class SQLMethod(XMLObject, ZSQL, ExpressionMixin):
# Override manage and manage_main with ZSQL manage and manage_main respectively # Override manage and manage_main with ZSQL manage and manage_main respectively
manage = manage_main = ZSQL.manage manage = manage_main = ZSQL.manage
manage_main._setName('manage_main')
# View content list, Force /view, Standard option in SQLMethod # View content list, replace /view, Standard option in SQLMethod
manage_options = ({'icon':'', 'label':'View','action':'view'},) \ manage_options = ( ZSQL.manage_options[0], ) + \
+ ZSQL.manage_options ({'icon':'', 'label':'View','action':'view'},) + \
ZSQL.manage_options[2:]
# Declarative properties # Declarative properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
......
...@@ -151,8 +151,8 @@ class ERP5Catalog(Folder, Catalog): ...@@ -151,8 +151,8 @@ class ERP5Catalog(Folder, Catalog):
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
# Explicitly add tabs for manage_options # Explicitly add tabs for manage_options
manage_options = ({'label': 'View', 'action': 'view'}, manage_options = ({'label': 'Contents', 'action': 'manage_main'},
{'label': 'Contents', 'action': 'manage_main'}, {'label': 'View', 'action': 'view'},
{'label': 'Security', 'action': 'manage_access'}, {'label': 'Security', 'action': 'manage_access'},
{'label': 'Undo', 'action': 'manage_UndoForm'}, {'label': 'Undo', 'action': 'manage_UndoForm'},
{'label': 'Ownership', 'action': 'manage_owner'}, {'label': 'Ownership', 'action': 'manage_owner'},
......
...@@ -57,8 +57,8 @@ class ERP5CatalogTool(BaseTool, CMFCore_CatalogTool): ...@@ -57,8 +57,8 @@ class ERP5CatalogTool(BaseTool, CMFCore_CatalogTool):
security = ClassSecurityInfo() security = ClassSecurityInfo()
# Explicitly add tabs for manage_options # Explicitly add tabs for manage_options
manage_options = ({'label': 'View', 'action': 'view'}, manage_options = ({'label': 'Contents', 'action': 'manage_main'},
{'label': 'Contents', 'action': 'manage_main'}, {'label': 'View', 'action': 'view'},
{'label': 'Security', 'action': 'manage_access'}, {'label': 'Security', 'action': 'manage_access'},
{'label': 'Undo', 'action': 'manage_UndoForm'}, {'label': 'Undo', 'action': 'manage_UndoForm'},
{'label': 'Ownership', 'action': 'manage_owner'}, {'label': 'Ownership', 'action': 'manage_owner'},
......
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