From 8321e93604e84463ad5306e0bd00021483857a09 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 27 Mar 2007 08:33:39 +0000
Subject: [PATCH] revise codes to avoid duplicate attribute error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13692 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/Selection.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/Selection.py b/product/ERP5Form/Selection.py
index d532e66f7b..f1526d6b0a 100644
--- a/product/ERP5Form/Selection.py
+++ b/product/ERP5Form/Selection.py
@@ -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 []
-- 
2.30.9