Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
1256 Prikazi

  _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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
apr. 25
2868
2
avg. 24
3656
1
jul. 24
1581
0
jul. 24
1609
2
maj 24
4383