-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch_odoo.patch
28 lines (28 loc) · 2.03 KB
/
patch_odoo.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/addons/product/product.py b/addons/product/product.py
index 98a33a9..1096640 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -685,9 +685,11 @@ class product_product(osv.osv):
positive_operators = ['=', 'ilike', '=ilike', 'like', '=like']
ids = []
if operator in positive_operators:
- ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
+ # -acpi- ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
+ ids = self.search(cr, user, args + [('default_code','=',name)], limit=limit, context=context)
if not ids:
- ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)
+ # -acpi- ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)
+ ids = self.search(cr, user, args + [('ean13','=',name)], limit=limit, context=context)
if not ids and operator not in expression.NEGATIVE_TERM_OPERATORS:
# Do not merge the 2 next lines into one single search, SQL search performance would be abysmal
# on a database with thousands of matching products, due to the huge merge+unique needed for the
@@ -705,7 +707,8 @@ class product_product(osv.osv):
ptrn = re.compile('(\[(.*?)\])')
res = ptrn.search(name)
if res:
- ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)
+ # -acpi- ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)
+ ids = self.search(cr, user, args + [('default_code','=', res.group(2))], limit=limit, context=context)
else:
ids = self.search(cr, user, args, limit=limit, context=context)
result = self.name_get(cr, user, ids, context=context)