Add payment reference in record name of payment

This commit is contained in:
Cédric Krier
2024-12-12 13:41:51 +01:00
parent 14f5953c60
commit 8636a2b771
+18
View File
@@ -567,6 +567,24 @@ class Payment(Workflow, ModelSQL, ModelView):
field_name = 'process_method'
return Journal.fields_get([field_name])[field_name]['selection']
def get_rec_name(self, name):
items = [self.number]
if self.reference:
items.append(f'[{self.reference}]')
return ' '.join(items)
@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,
('number', *clause[1:]),
('reference', *clause[1:]),
]
@classmethod
def view_attributes(cls):
context = Transaction().context