Skip to Content
Menu
Dette spørgsmål er blevet anmeldt

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.

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
3
sep. 24
1943
0
aug. 24
970
0
dec. 23
1846
0
okt. 21
3453
1
jul. 21
4319