Skip to Content
Menú
This question has been flagged
1 Respondre
1175 Vistes

  _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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
2
d’abr. 25
2691
2
d’ag. 24
3450
1
de jul. 24
1487
0
de jul. 24
1507
2
de maig 24
4213