تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
11545 أدوات العرض

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أكتوبر 22
571
0
ديسمبر 20
3884
1
يناير 25
2760
1
نوفمبر 24
2350
0
مارس 21
4529