Add rec_name searcher for party relations

issue5972
review31621002
This commit is contained in:
Sergi Almacellas Abellana committed 2016-10-25 12:20:33 +02:00
1 parent 0320d8b205
commit c911b5d265
1 file changed
+12
+12
View File
@@ -28,6 +28,18 @@ class PartyRelation(ModelSQL):
type = fields.Many2One('party.relation.type', 'Type', required=True,
select=True)
@classmethod
def search_rec_name(cls, name, clause):
if clause[1].startswith('!') or clause[1].startswith('not '):
bool_op = 'AND'
else:
bool_op = 'OR'
return [bool_op,
('from_',) + tuple(clause[1:]),
('to',) + tuple(clause[1:]),
('type',) + tuple(clause[1:]),
]
class PartyRelationAll(PartyRelation, ModelView):
'Party Relation'