Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
132 Lượt xem

Hello,

In Odoo 18, I would like to produce a report of all record of a specific table, without and also with archived records.

recs = self.env['my.table'].search([('active', in (True, False))])
or
recs = self.env['my.table'].search(['|', ('active', '=', True), ('active', '=' False)])

len(recs) give me the correct number of records active + archived.

However, when I generate a report form these records (recs), only the active records appear in the report.

E.g. if I have two active and one archived records, len(recs) = 3 but in the report I have only the data of the two active records.

Best regards,

Boris


Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Chris, it works perfectily.

Câu trả lời hay nhất

Maybe you can achieve this with context:

context="{'active_test': False}"

Ảnh đại diện
Huỷ bỏ