Skip to Content
Menu
This question has been flagged
1 Odpoveď
1338 Zobrazenia

  _isRequired(fieldName) {

          const required = this.activeFields[fieldName].required;

          return required ? evaluateBooleanExpr(required,   this.evalContextWithVirtualIds) : false;

    }


Is it possible to patch the protected method, if yes means help me to patch the protected method in owl.

Avatar
Zrušiť
Best Answer

Hi,

We can also patch the protected method. You can try this approach.


import { patch } from "@web/core/utils/patch";

import { ComponentToPath } from "@/path/to/your/component";


patch(ComponentToPath.prototype, {


    _isRequired(fieldName) {


        super()._isRequired(); // if needed old functionality


        // Your custom logic here



     }


});


Hope it helps

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
apr 25
3065
2
aug 24
3965
1
júl 24
1636
0
júl 24
1708
2
máj 24
4610