İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1345 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
Nis 25
3066
Free Sing Up ?? Çözüldü
2
Ağu 24
3970
1
Tem 24
1637
0
Tem 24
1709
2
May 24
4616