How can we inherit method of class in js
I have to inherit one of the method of FormController from web/../src/views/...js. then how can i inherit this method into custom module. method name - getActionMenuItems
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
/** @odoo-module **/
import { FormController } from "@web/views/form/form_controller";
import {patch} from "@web/core/utils/patch";
patch(FormController.prototype, "CustomFormController", {
getActionMenuItems() {
//your code
this._super.apply(this, arguments);
//your code
}
});
Hi,
Please refer to the code below. It will give you an idea on how to inherit OWL Js:
/** @odoo-module **/
import { FormController } from "@web/views/form/form_controller";
export class CustomFormController extends FormController {
getActionMenuItems() {
const superVals = super.getActionMenuItems();
// Your code
return superVals;
}
export const CustomFormView = {
...formView,
Controller: CustomFormController,
};
registry.category("views").add("custom_form", CustomFormView);
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
5
Oca 23
|
14206 | ||
|
1
Eyl 17
|
4702 | ||
|
2
Tem 17
|
4505 | ||
|
0
May 24
|
2003 | ||
|
1
Eki 23
|
1809 |