تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1150 أدوات العرض

I am working in odoo 15 enterprise, I am inheriting account move and I have this field:

status_test = fields.Selection([('manual','Factura Manual'),('pending_approval', 'Pendiente de Aprobacion'),

                                   ('paid', 'Pagada'),

                                   ('not_paid', 'No Pagada'),

                                   ('cancel', 'Cancelada')], default="manual", string="Status test",

                                  compute='_compute_status_test', search='_search_field')


To be able to filter without the need to use store True I did this:

def _search_field(self, operator, value):

        filtered_records = self.search([]).filtered(lambda x: x.status_test == value)

        return [('id', operator, [x.id for x in filtered_records] if filtered_records else False)]


And it works without problems, but now I want to be able to group by the status_test field without the need to use store True, is there a way?

The reason I don't want to use store True is because I am working with a database with a high record rate, and if I use store True everything will become too slow.

Thank you, and sorry for the inconvenience.

Odoo 15 enterprise.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
سبتمبر 24
1943
0
أغسطس 24
970
0
ديسمبر 23
1846
0
أكتوبر 21
3453
1
يوليو 21
4319