Commit 8321e936 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

revise codes to avoid duplicate attribute error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13692 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c0ce2cf
......@@ -192,17 +192,19 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
kw['sort_on'] = sort_on
elif kw.has_key('sort_on'):
del kw['sort_on'] # We should not sort if no sort was defined
if not kw.has_key('selection_name'):
kw['selection_name'] = self.name
if method is not None:
if callable(method):
if self.domain is not None and self.report is not None:
result = method(selection_domain = self.domain,
selection_report = self.report, selection=self, selection_name=self.name, **kw)
selection_report = self.report, selection=self, **kw)
elif self.domain is not None:
result = method(selection_domain = self.domain, selection=self, selection_name=self.name, **kw)
result = method(selection_domain = self.domain, selection=self, **kw)
elif self.report is not None:
result = method(selection_report = self.report, selection=self, selection_name=self.name, **kw)
result = method(selection_report = self.report, selection=self, **kw)
else:
result = method(selection=self, selection_name=self.name, **kw)
result = method(selection=self, **kw)
return result
else:
return []
......
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