İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1579 Görünümler

  _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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eyl 25
297
2
Nis 25
3432
Free Sing Up ?? Çözüldü
2
Ağu 24
4423
1
Tem 24
1856
0
Tem 24
1909