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

I m migrating a py3o report from Odoo 10 to Odoo 11 and got the following problem.

In Odoo 10 after doing some calcs print py3o report this way

res = {
'type': 'ir.actions.report',
'report_name': 'l10n_cu_hr_cpr.production_plan_gruped.ODS',
'datas': datas,
}

After the change in Odoo 11 report engine i try this way 

return self.env.ref('l10n_cu_hr_cpr_desoft.cpl_report_plan_gruped_ods').report_action(self, data=datas, config=False)
but doing nothing, Error
len(res_ids) > 1 and
TypeError: object of type 'NoneType' has no len()

Somebody knows the right way to do this?

Greetings


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

Hi, I'm facing the same error trying to print this kind of report from a wizard. Did you solve the problem?

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

I've solved this by explicitly passing the records' ids into the data['ids'] entry, inside wizard logic. Then, in another module that I inherited from report_py3o, I overwrote the create_report method and asigned data['ids'] entry into res_ids, and then called super(). This is still a workaround but it worked.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 20
10015
0
thg 3 19
2525
2
thg 2 18
22003
1
thg 7 21
4741
1
thg 11 20
6780