issue12398.diff [account_dunning] Missing searc_rec_name in model account.dunning.level

This commit is contained in:
Raimon Esteve 2023-07-13 15:22:31 +02:00
parent ced39b419d
commit 72ee7aa0ca
2 changed files with 24 additions and 0 deletions

22
issue12398.diff Normal file
View File

@ -0,0 +1,22 @@
diff --git a/tryton/modules/account_dunning/dunning.py b/tryton/modules/account_dunning/dunning.py
index fa7aadd494..deb4dd69b5 100644
--- a/tryton/modules/account_dunning/dunning.py
+++ b/tryton/modules/account_dunning/dunning.py
@@ -63,6 +63,17 @@ class Level(sequence_ordered(), ModelSQL, ModelView):
return '%s@%s' % (self.procedure.levels.index(self),
self.procedure.rec_name)
+ @classmethod
+ def search_rec_name(cls, name, clause):
+ _, operator, value = clause
+ if operator.startswith('!') or operator.startswith('not '):
+ bool_op = 'AND'
+ else:
+ bool_op = 'OR'
+ return [bool_op,
+ ('procedure.rec_name', *clause[1:]),
+ ]
+
def test(self, line, date):
if self.overdue is not None:
return (date - line.maturity_date) >= self.overdue

2
series
View File

@ -77,3 +77,5 @@ product-cost-fifo-average.diff # [product_cost_fifo] [product_cost_history] [sto
issue10650.diff # [account_dunning_email] [marketing_automation] [marketing_email] [notification_email] [trytond] Support RFC6530 on email formatting
tools-email.diff # [trytond] tools email
issue12398.diff # [account_dunning] Missing searc_rec_name in model 'account.dunning.level'