Sergi Almacellas Abellana pushed to branch branch/default at Tryton / Tryton


Commits:
7934c18b by Sergi Almacellas Abellana at 2023-02-15T17:43:00+01:00
Use number and reference for subscription rec name
- - - - -


1 changed file:

- modules/sale_subscription/subscription.py


Changes:

=====================================
modules/sale_subscription/subscription.py
=====================================
@@ -313,6 +313,29 @@
                         '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:



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/7934c18b911adc738477ba7e0b0868ae3c5cb22a

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/7934c18b911adc738477ba7e0b0868ae3c5cb22a
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to