Use level and line name as record name for account dunning

This commit is contained in:
Cédric Krier
2024-10-30 16:20:51 +01:00
parent 5299f36eb9
commit f5bf25a996
+15
View File
@@ -204,6 +204,21 @@ class Dunning(ModelSQL, ModelView):
else:
return []
def get_rec_name(self, name):
return f'{self.level.rec_name} [{self.line.rec_name}]'
@classmethod
def search_rec_name(cls, name, clause):
_, operator, operand, *extra = clause
if operator.startswith('!') or operator.startswith('not '):
bool_op = 'AND'
else:
bool_op = 'OR'
return [bool_op,
('level.rec_name', operator, operand, *extra),
('line.rec_name', operator, operand, *extra),
]
@classmethod
def _overdue_line_domain(cls, date):
return [