Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
11539 Представления

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
3883
1
янв. 25
2760
1
нояб. 24
2328
0
мар. 21
4529