Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikolaï Krol
erp5
Commits
5806f6ed
Commit
5806f6ed
authored
Nov 03, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplate: catch and display error on missing action reference for portal types properties
parent
6a8987fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
171 deletions
+39
-171
bt5/erp5_forum_tutorial/ActionTemplateItem/portal_types/Discussion%20Thread%20Module/new_thread.xml
.../portal_types/Discussion%20Thread%20Module/new_thread.xml
+0
-85
bt5/erp5_forum_tutorial/ActionTemplateItem/portal_types/Discussion%20Thread%20Module/view.xml
...teItem/portal_types/Discussion%20Thread%20Module/view.xml
+0
-83
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+7
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getPortalTypesProperties.xml
...s/erp5_core/BusinessTemplate_getPortalTypesProperties.xml
+12
-3
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+20
-0
No files found.
bt5/erp5_forum_tutorial/ActionTemplateItem/portal_types/Discussion%20Thread%20Module/new_thread.xml
deleted
100644 → 0
View file @
6a8987fb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
new_thread
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
Add portal content
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
New Thread
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/DiscussionModuleThread_viewAddThreadDialog
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_forum_tutorial/ActionTemplateItem/portal_types/Discussion%20Thread%20Module/view.xml
deleted
100644 → 0
View file @
6a8987fb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_list
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_list
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
View
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/DiscussionThreadModule_viewDiscussionThreadList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/Document/BusinessTemplate.py
View file @
5806f6ed
...
@@ -117,6 +117,9 @@ catalog_method_filter_list = ('_filter_expression_archive',
...
@@ -117,6 +117,9 @@ catalog_method_filter_list = ('_filter_expression_archive',
INSTALLED_BT_FOR_DIFF
=
'installed_bt_for_diff'
INSTALLED_BT_FOR_DIFF
=
'installed_bt_for_diff'
_MARKER
=
[]
_MARKER
=
[]
def
_getCatalog
(
acquisition_context
):
def
_getCatalog
(
acquisition_context
):
"""
"""
Return the id of the SQLCatalog which correspond to the current BT.
Return the id of the SQLCatalog which correspond to the current BT.
...
@@ -5817,6 +5820,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -5817,6 +5820,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
bt_portal_types_id_list
=
list
(
self
.
getTemplatePortalTypeIdList
())
bt_portal_types_id_list
=
list
(
self
.
getTemplatePortalTypeIdList
())
bt_portal_type_roles_list
=
list
(
self
.
getTemplatePortalTypeRoleList
())
bt_portal_type_roles_list
=
list
(
self
.
getTemplatePortalTypeRoleList
())
bt_wf_chain_list
=
list
(
self
.
getTemplatePortalTypeWorkflowChainList
())
bt_wf_chain_list
=
list
(
self
.
getTemplatePortalTypeWorkflowChainList
())
Base_translateString
=
self
.
Base_translateString
for
id
in
bt_portal_types_id_list
:
for
id
in
bt_portal_types_id_list
:
portal_type
=
ttool
.
getTypeInfo
(
id
)
portal_type
=
ttool
.
getTypeInfo
(
id
)
...
@@ -5863,6 +5867,8 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -5863,6 +5867,8 @@ Business Template is a set of definitions, such as skins, portal types and categ
bt_base_category_list
.
append
(
base_cat_id
)
bt_base_category_list
.
append
(
base_cat_id
)
for
act_id
in
action_list
:
for
act_id
in
action_list
:
if
act_id
is
None
:
return
(
1
,
Base_translateString
(
"ERROR: An action has an empty id on portal_type ${id}"
,
mapping
=
dict
(
id
=
id
)))
action_id
=
id
+
' | '
+
act_id
action_id
=
id
+
' | '
+
act_id
if
action_id
not
in
bt_action_list
:
if
action_id
not
in
bt_action_list
:
bt_action_list
.
append
(
action_id
)
bt_action_list
.
append
(
action_id
)
...
@@ -5887,6 +5893,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -5887,6 +5893,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
self
.
setTemplatePortalTypePropertySheetList
(
bt_property_sheet_list
)
self
.
setTemplatePortalTypePropertySheetList
(
bt_property_sheet_list
)
self
.
setTemplatePortalTypeBaseCategoryList
(
bt_base_category_list
)
self
.
setTemplatePortalTypeBaseCategoryList
(
bt_base_category_list
)
self
.
setTemplateActionPathList
(
bt_action_list
)
self
.
setTemplateActionPathList
(
bt_action_list
)
return
(
0
,
""
)
def
guessPortalTypes
(
self
,
**
kw
):
def
guessPortalTypes
(
self
,
**
kw
):
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getPortalTypesProperties.xml
View file @
5806f6ed
...
@@ -50,13 +50,22 @@
...
@@ -50,13 +50,22 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
context.getPortalTypesProperties()\n
<value>
<string>
Base_translateString = context.Base_translateString\n
\n
REQUEST = context.REQUEST\n
REQUEST = context.REQUEST\n
\n
\n
\n
result, message0 = context.getPortalTypesProperties()\n
\n
message1 = Base_translateString("Portal Type Properties Have Been Updated.")\n
\n
ret_url = context.absolute_url() + \'/\' + REQUEST.get(\'form_id\', \'view\')\n
\n
if REQUEST is not None:\n
if REQUEST is not None:\n
ret_url = context.absolute_url() + \'/\' + REQUEST.get(\'form_id\', \'view\')\n
ret_url = context.absolute_url() + \'/\' + REQUEST.get(\'form_id\', \'view\')\n
REQUEST.RESPONSE.redirect("%s?portal_status_message=Portal+Types+Properties+Updated"% ret_url)\n
if result:\n
REQUEST.RESPONSE.redirect("%s?portal_status_message= %s" % (ret_url,message0))\n
else:\n
REQUEST.RESPONSE.redirect("%s?portal_status_message=%s"% (ret_url,message1))\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
5806f6ed
...
@@ -1494,6 +1494,15 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -1494,6 +1494,15 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
float_index
=
2.0
)
float_index
=
2.0
)
sequence
.
edit
(
first_action_id
=
'become_geek'
)
sequence
.
edit
(
first_action_id
=
'become_geek'
)
def
stepTestFirstAction
(
self
,
sequence
=
None
,
**
kw
):
pt
=
self
.
getTypeTool
()
object_id
=
sequence
.
get
(
'object_ptype_id'
)
object_pt
=
pt
.
_getOb
(
object_id
)
bt
=
sequence
.
get
(
'current_bt'
,
None
)
self
.
assertTrue
(
bt
is
not
None
)
result
,
message
=
bt
.
getPortalTypesProperties
()
self
.
assertEquals
(
result
,
0
)
def
stepCreateEmptyAction
(
self
,
sequence
=
None
,
**
kw
):
def
stepCreateEmptyAction
(
self
,
sequence
=
None
,
**
kw
):
"""
"""
Create an empty action
Create an empty action
...
@@ -1506,6 +1515,15 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -1506,6 +1515,15 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
action_permission_list
=
(),
action_permission_list
=
(),
float_index
=
1.2
)
float_index
=
1.2
)
def
stepTestEmptyAction
(
self
,
sequence
=
None
,
**
kw
):
pt
=
self
.
getTypeTool
()
object_id
=
sequence
.
get
(
'object_ptype_id'
)
object_pt
=
pt
.
_getOb
(
object_id
)
bt
=
sequence
.
get
(
'current_bt'
,
None
)
self
.
assertTrue
(
bt
is
not
None
)
result
,
message
=
bt
.
getPortalTypesProperties
()
self
.
assertEquals
(
result
,
1
)
def
stepCreateSecondAction
(
self
,
sequence
=
None
,
**
kw
):
def
stepCreateSecondAction
(
self
,
sequence
=
None
,
**
kw
):
"""
"""
Create a second action
Create a second action
...
@@ -3938,9 +3956,11 @@ class TestBusinessTemplate(BusinessTemplateMixin):
...
@@ -3938,9 +3956,11 @@ class TestBusinessTemplate(BusinessTemplateMixin):
SaveBusinessTemplate
\
SaveBusinessTemplate
\
CheckBuiltBuildingState
\
CheckBuiltBuildingState
\
CheckNotInstalledInstallationState
\
CheckNotInstalledInstallationState
\
TestFirstAction
\
RemoveBusinessTemplate
\
RemoveBusinessTemplate
\
RemoveAllTrashBins
\
RemoveAllTrashBins
\
CreateEmptyAction
\
CreateEmptyAction
\
TestEmptyAction
\
ImportBusinessTemplate
\
ImportBusinessTemplate
\
UseImportBusinessTemplate
\
UseImportBusinessTemplate
\
CheckBuiltBuildingState
\
CheckBuiltBuildingState
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment