Commit ae6b1bf7 authored by Nicolas Wavrant's avatar Nicolas Wavrant

closer behaviour from the UI for getting an effective model in a composition

parent 1e7df6e4
...@@ -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()
......
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