From 8bf732f0505caaa5b966dc400b94ec294c00a31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Gonz=C3=A1lez?= Date: Fri, 28 Jan 2022 22:52:25 +0000 Subject: [PATCH] [FIX] sale: search order lines by order number not working When searching sale order lines from another model (e.g. task), the order number was not being considered. The technical reason for the above is the resulting domaing was like this: [ '|', ('order_id.name', 'ilike', 'SO name'), ('name', 'ilike', 'SO name'), # The below line is added by _name_search of base model ('name', 'ilike', 'SO name'), ]) So, even though the order number is added to the domain, an extra condition was forcing the line description to be the only field to be considered. closes odoo/odoo#83911 X-original-commit: b5d45d6cae3579970ed55bc65d52c2de2377c381 Signed-off-by: Victor Feyens (vfe) --- addons/sale/models/sale_order_line.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py index c475059c2d1..215b5db712c 100644 --- a/addons/sale/models/sale_order_line.py +++ b/addons/sale/models/sale_order_line.py @@ -763,6 +763,7 @@ class SaleOrderLine(models.Model): args or [], ['|', ('order_id.name', operator, name), ('name', operator, name)] ]) + return self._search(args, limit=limit, access_rights_uid=name_get_uid) return super(SaleOrderLine, self)._name_search(name, args=args, operator=operator, limit=limit, name_get_uid=name_get_uid) def _check_line_unlink(self):