跳至内容
菜单
此问题已终结
1 回复
1092 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
2
4月 25
2526
2
8月 24
3176
1
7月 24
1392
0
7月 24
1381
2
5月 24
4018