İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1471 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
3306
Free Sing Up ?? Çözüldü
2
Ağu 24
4242
1
Tem 24
1715
0
Tem 24
1812
2
May 24
4895