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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian
erp5
Commits
630bdfbf
Commit
630bdfbf
authored
Mar 04, 2016
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support translation mapping.
/reviewed-on
nexedi/erp5!69
parent
db4adb5d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ScriptConstraint.py
...eItem/portal_components/document.erp5.ScriptConstraint.py
+13
-5
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ScriptConstraint.xml
...Item/portal_components/document.erp5.ScriptConstraint.xml
+1
-4
No files found.
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ScriptConstraint.py
View file @
630bdfbf
...
...
@@ -36,12 +36,13 @@ class ScriptConstraint(ConstraintMixin):
meta_type
=
'ERP5 Script Constraint'
portal_type
=
'Script Constraint'
def
_createConsistencyMessage
(
self
,
object_relative_url
,
message
):
#
XXX If I put in the right place I have TypeError: 'NoneType' object is not callable
def
_createConsistencyMessage
(
self
,
object_relative_url
,
message
,
mapping
):
#
XXX If I put in the right place I have TypeError: 'NoneType' object is not callable
from
Products.ERP5Type.ConsistencyMessage
import
ConsistencyMessage
return
ConsistencyMessage
(
self
,
object_relative_url
=
object_relative_url
,
message
=
message
)
message
=
message
,
mapping
=
mapping
)
def
_checkConsistency
(
self
,
obj
,
fixit
=
0
,
**
kw
):
"""
...
...
@@ -55,5 +56,12 @@ class ScriptConstraint(ConstraintMixin):
raise
RuntimeError
(
'Script (%s) not found %s'
%
(
script_id
,
self
))
object_relative_url
=
obj
.
getRelativeUrl
()
createConsistencyMessage
=
self
.
_createConsistencyMessage
return
[
createConsistencyMessage
(
object_relative_url
,
message
)
\
for
message
in
method
(
fixit
=
fixit
,
**
kw
)]
message_list
=
[]
for
item
in
method
(
fixit
=
fixit
,
**
kw
):
if
isinstance
(
item
,
(
tuple
,
list
))
and
len
(
item
)
==
2
:
message
,
mapping
=
item
else
:
message
=
item
mapping
=
{}
message_list
.
append
(
createConsistencyMessage
(
object_relative_url
,
message
,
mapping
))
return
message_list
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ScriptConstraint.xml
View file @
630bdfbf
...
...
@@ -45,10 +45,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
R: 32, 0: Too many ancestors (49/7) (too-many-ancestors)
</string>
<string>
R: 32, 0: Too many public methods (398/20) (too-many-public-methods)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
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