RGA(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client/pass_context_not_domain into 
lp:~openerp-dev/openobject-client/trunk-dev-client.

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)


If search view field has context then pass it without any domain
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/pass_context_not_domain/+merge/25080
Your team OpenERP sa GTK client R&D is requested to review the proposed merge 
of lp:~openerp-dev/openobject-client/pass_context_not_domain into 
lp:~openerp-dev/openobject-client/trunk-dev-client.
=== modified file 'bin/widget_search/char.py'
--- bin/widget_search/char.py	2010-04-02 13:49:07 +0000
+++ bin/widget_search/char.py	2010-05-11 15:03:26 +0000
@@ -43,10 +43,11 @@
         if s:
             domain = [(self.name,self.attrs.get('comparator','ilike'),s)]
             context = tools.expr_eval(self.attrs.get('context',"{}"), {'self': s})
-        return {
-            'domain':domain,
-            'context': context
-        }
+        if context:
+            return {'context': context}
+        elif domain:
+            return {'domain':domain}
+        return {}
 
     def _value_set(self, value):
         self.widget.set_text(value)

=== modified file 'bin/widget_search/selection.py'
--- bin/widget_search/selection.py	2010-04-02 13:49:07 +0000
+++ bin/widget_search/selection.py	2010-05-11 15:03:26 +0000
@@ -92,11 +92,10 @@
             res = self._selection.get(model[index][0], False)
             operator = '='
             context = tools.expr_eval(self.attrs.get('context',"{}"), {'self':res})
-        if res:
-            return {
-                    'domain':[(self.name,operator,res)],
-                    'context': context
-            }
+        if context:
+            return {'context': context}
+        elif res:
+            return {'domain':[(self.name,operator,res)]}
         return {}
 
     def _value_set(self, value):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to