changeset 226e45e1e9fc in modules/stock_supply:5.0
details: 
https://hg.tryton.org/modules/stock_supply?cmd=changeset;node=226e45e1e9fc
description:
        Use OR clauses on location searcher

        issue8141
        review58531002
        (grafted from b5dff78398eb94515deaab0798ca1ff980bf1f31)
diffstat:

 order_point.py |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (23 lines):

diff -r c2431eedfd43 -r 226e45e1e9fc order_point.py
--- a/order_point.py    Tue Feb 19 22:15:31 2019 +0100
+++ b/order_point.py    Fri Mar 15 17:49:32 2019 +0100
@@ -248,13 +248,13 @@
 
     @classmethod
     def search_location(cls, name, domain=None):
-        ids = []
+        clauses = ['OR']
         for type, field in cls._type2field().items():
-            args = [('type', '=', type)]
-            for _, operator, operand in domain:
-                args.append((field, operator, operand))
-            ids.extend([o.id for o in cls.search(args)])
-        return [('id', 'in', ids)]
+            clauses.append([
+                    ('type', '=', type),
+                    (field,) + tuple(domain[1:]),
+                    ])
+        return clauses
 
     @staticmethod
     def default_company():

Reply via email to