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

I have a scenario where I open the wizard by ir_action_window and pass the context to the wizard, which is correct in the previous version of ODOO(before 17.0), and through tracking, I found that in the 17.0 version of the wizard, in file /addons/web/static/src/views/view_service.js, the loadviews function before orm.call get_view to  the wizard, the context is filtered and cannot be passed over. and I compared the differences between 16.0 and 17.0 and found that the context filtering has the following differences

 Lines 104 to 107 of /addons/web/static/src/views/view_service.js for 16.0 are given below:

            const filteredContext = Object.fromEntries(

                Object.entries(context || {}).filter((k, v) => !String(k).startsWith("default_"))

            );


and Lines 87 to 91 of /addons/web/static/src/views/view_service.js for 17.0 are given below:

            const filteredContext = Object.fromEntries(

                Object.entries(context || {}).filter(

                    ([k, v]) => k == "lang" || k.endsWith("_view_ref")

                )

            );


which is the reason why the context cannot be passed, can ODOO17 make some adjustments to the filtering (at least it can active_id be passed through the context)? If not, is there another workaround to pass the context?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I replace odoo17 the filter function of /addons/web/static/src/views/view_service.js with odoo16,  Will this affect other applications that use get_views?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 24
2856
0
thg 6 24
2116
0
thg 6 24
3
0
thg 8 17
3356
0
thg 3 15
4416