From f5bf25a996a5034cd647d5f48484e4147dadfdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 30 Oct 2024 16:20:51 +0100 Subject: [PATCH] Use level and line name as record name for account dunning --- modules/account_dunning/dunning.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/account_dunning/dunning.py b/modules/account_dunning/dunning.py index 2feda0e3d6..bab2824f4d 100644 --- a/modules/account_dunning/dunning.py +++ b/modules/account_dunning/dunning.py @@ -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 [