Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
11554 มุมมอง

Hi,

I want to override the following js function in search bar(addons/web/static/src/js/control_panel/search_bar.js)


_selectSource(source) {
// Inactive sources are:
// - Selection sources
// - "no result" items
if (source.active) {
const labelValue = source.label || this.state.inputValue;
this.model.dispatch('addAutoCompletionValues', {
filterId: source.filterId,
value: "value" in source ? source.value : this._parseWithSource(labelValue, source),
label: labelValue,
operator: source.filterOperator || source.operator,
});
}
this._closeAutoComplete();
}

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You need to patching existing class. Look here: https://www.odoo.com/forum/help-1/how-to-patch-a-owl-class-in-past-we-use-include-to-patch-widget-178947

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can also refer the following article.

https://codingdodo.com/owl-in-odoo-14-extend-and-patch-existing-owl-components/

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 22
571
0
ธ.ค. 20
3886
1
ม.ค. 25
2762
1
พ.ย. 24
2354
0
มี.ค. 21
4531