From 1dfdb348227ce247bd70e8d6084ae12ec2d9b66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 26 Apr 2016 09:54:49 +0200 Subject: [PATCH] Search on return shipments by rec_name or id The Reference field needs to have a dotted notation to use the forth clause. So it should be rec_name if the value is a string and otherwise the id. issue5291 review19211002 --- sale.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sale.py b/sale.py index 657f145a4f..a7e6d6e023 100644 --- a/sale.py +++ b/sale.py @@ -578,7 +578,11 @@ class Sale(Workflow, ModelSQL, ModelView, TaxableMixin): Search on shipments or returns ''' def method(self, name, clause): - return [('lines.moves.shipment',) + tuple(clause[1:]) + if isinstance(clause[2], basestring): + target = 'rec_name' + else: + target = 'id' + return [('lines.moves.shipment.' + target,) + tuple(clause[1:]) + (model_name,)] return classmethod(method)