Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
1208 Vues

  _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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
avr. 25
2780
2
août 24
3560
1
juil. 24
1530
0
juil. 24
1553
2
mai 24
4294