Skip to Content
Menu
This question has been flagged
1 Atsakyti
1128 Rodiniai

  _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.

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
bal. 25
2592
2
rugp. 24
3292
1
liep. 24
1436
0
liep. 24
1439
2
geg. 24
4116