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

How to inherit the odoo V15 web module action_service.js file.
File Path: /addons/web/static/src/webclient/actions/action_service.js 

I have to inherit the _downloadreport function but it is inside the makeActionManager function.


Someone suggest me the best solution for override or inherit the action_service file.

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

Odoo 15 is now using the new JS Framework called OWL to inherit any component in Odoo JS you will use the OWL Component patching method located in web module here is the documentation of patching OWL Components.

Example:

    const { patch } = require('web.utils');
    
    patch(MyComponent.prototype, "test_patching_my_component", {
setup() {
this._super(...arguments);
console.log("patch patch patch setup");
}
});

Here is the complete example of the js file.



Happy to help :) an upvote will be awesome

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

Hello,

Thanks for your replay.

Yes I know about the patching methods you can apply the patching methods on object or class but in this action_service file there is not define any class.

@shivoham thank you for the clarification i made some changes to your question to better reflect the problem. I will try to patch it and get back to you.

Tác giả Câu trả lời hay nhất

Hello Amr,

Thanks for your replay.

Yes please help me if you found anything.

Ả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 25
4080
0
thg 2 23
2227
4
thg 5 25
12002
3
thg 2 25
14073
1
thg 6 24
4304