Skip to Content
मेन्यू
This question has been flagged
1 Reply
1231 Views

  _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
Discard
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
Discard
Related Posts Replies Views Activity
2
अप्रैल 25
2803
2
अग॰ 24
3597
1
जुल॰ 24
1546
0
जुल॰ 24
1560
2
मई 24
4317