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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
ae6b1bf7
Commit
ae6b1bf7
authored
Jan 07, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
closer behaviour from the UI for getting an effective model in a composition
parent
1e7df6e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
product/ERP5/mixin/composition.py
product/ERP5/mixin/composition.py
+5
-0
No files found.
product/ERP5/mixin/composition.py
View file @
ae6b1bf7
...
@@ -80,6 +80,11 @@ def _getEffectiveModel(self, start_date, stop_date):
...
@@ -80,6 +80,11 @@ def _getEffectiveModel(self, start_date, stop_date):
return
self
return
self
raise
KeyError
(
'No %s found with the reference %s between %s and %s'
%
\
raise
KeyError
(
'No %s found with the reference %s between %s and %s'
%
\
(
self
.
getPortalType
(),
reference
,
start_date
,
stop_date
))
(
self
.
getPortalType
(),
reference
,
start_date
,
stop_date
))
# After a clone, we can have 2 models with same start_date, stop_date, and
# version. We want to compose with the model explicitely defined in the relation field
if
len
(
model_list
)
>
1
and
\
model_list
[
0
].
getVersion
()
==
model_list
[
1
].
getVersion
():
return
self
return
model_list
[
0
].
getObject
()
return
model_list
[
0
].
getObject
()
...
...
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