Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Lu Xu
erp5
Commits
4b275002
Commit
4b275002
authored
9 years ago
by
Jérome Perrin
Committed by
Tristan Cavelier
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
ERP5Type.Base: prefer title over reference in getCompact*Title
parent
75f9b67b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+6
-6
No files found.
product/ERP5Type/Base.py
View file @
4b275002
...
@@ -2349,8 +2349,8 @@ class Base( CopyContainer,
...
@@ -2349,8 +2349,8 @@ class Base( CopyContainer,
Returns the first non-null value from the following:
Returns the first non-null value from the following:
- "getCompactTitle" type based method
- "getCompactTitle" type based method
- short title
- short title
- reference
- title
- title
- reference
- id
- id
"""
"""
method
=
self
.
_getTypeBasedMethod
(
'getCompactTitle'
)
method
=
self
.
_getTypeBasedMethod
(
'getCompactTitle'
)
...
@@ -2360,8 +2360,8 @@ class Base( CopyContainer,
...
@@ -2360,8 +2360,8 @@ class Base( CopyContainer,
if
self
.
hasShortTitle
():
if
self
.
hasShortTitle
():
r
=
self
.
getShortTitle
()
r
=
self
.
getShortTitle
()
if
r
:
return
r
if
r
:
return
r
return
(
self
.
getProperty
(
'reference'
)
or
return
(
getattr
(
self
,
'_baseGetTitle'
,
str
)(
)
or
getattr
(
self
,
'_baseGetTitle'
,
str
)(
)
or
self
.
getProperty
(
'reference'
)
or
self
.
getId
())
self
.
getId
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
@@ -2373,9 +2373,9 @@ class Base( CopyContainer,
...
@@ -2373,9 +2373,9 @@ class Base( CopyContainer,
- "getCompactTitle" type based method
- "getCompactTitle" type based method
- translated short title
- translated short title
- short title
- short title
- reference
- translated title
- translated title
- title
- title
- reference
- id
- id
"""
"""
method
=
self
.
_getTypeBasedMethod
(
'getCompactTranslatedTitle'
)
method
=
self
.
_getTypeBasedMethod
(
'getCompactTranslatedTitle'
)
...
@@ -2391,10 +2391,10 @@ class Base( CopyContainer,
...
@@ -2391,10 +2391,10 @@ class Base( CopyContainer,
if
r
:
return
r
if
r
:
return
r
r
=
self
.
getShortTitle
()
r
=
self
.
getShortTitle
()
if
r
:
return
r
if
r
:
return
r
return
(
self
.
getProperty
(
'reference'
)
or
return
(
# No need to test existence since all Base instances have this method
# No need to test existence since all Base instances have this method
# Also useful whenever title is calculated
# Also useful whenever title is calculated
self
.
_baseGetTranslatedTitle
()
or
self
.
_baseGetTranslatedTitle
()
or
self
.
getProperty
(
'reference'
)
or
self
.
getId
())
self
.
getId
())
# This method allows to sort objects in list is a more reasonable way
# This method allows to sort objects in list is a more reasonable way
...
...
This diff is collapsed.
Click to expand it.
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