Use number and reference for subscription rec name

This commit is contained in:
Sergi Almacellas Abellana committed 2023-02-15 17:43:00 +01:00
1 parent 472b4b0aa7
commit 1f398f071e
1 file changed
+23
+23
View File
@@ -313,6 +313,29 @@ class Subscription(Workflow, ModelSQL, ModelView):
'sale_subscription.msg_invoice_recurrence_invalid',
subscription=subscription.rec_name))
def get_rec_name(self, name):
items = []
if self.number:
items.append(self.number)
if self.reference:
items.append('[%s]' % self.reference)
if not items:
items.append('(%s)' % self.id)
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'
domain = [bool_op,
('number', operator, value),
('reference', operator, value),
]
return domain
@classmethod
def copy(cls, subscriptions, default=None):
if default is None: