Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
3055 Ansichten

Sum record in treeview odoo 17

Avatar
Verwerfen
Autor Beste Antwort

Thanks for your help.         

 But I want:        

Example: when I search it show 3 record, and I want to count this record.     (field count_record = 3)

Avatar
Verwerfen
Beste Antwort

Hello BB

It is already showing in odoo17 


Solution : 2

If you want to store in a field , You can also do like this


class SaleOrder(models.Model):
​_inherit = 'sale.order'

​no_of_records = fields.Integer(string='No. Of records', compute='count_no_of_records')

​def count_no_of_records(self):

​Solution : 1


​# records_lst = []
​# for record in self.search([], limit=10):
​# records_lst.append(record)
​# self.no_of_records = len(records_lst)

solution:

​​len_records = self.search_count([])
​self.no_of_records = len_records


Avatar
Verwerfen
Autor

Thanks for your help.
But I want to create a pivot to count record in tree view.

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Apr. 23
2973
2
März 23
2700
1
März 15
4867
2
März 15
8513
0
Apr. 21
3811