Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 9 24
1943
0
thg 8 24
969
0
thg 12 23
1846
0
thg 10 21
3453
1
thg 7 21
4319