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
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user