I have some customization in search field in Odoo 10..
I did changes in svnodoo10\addons\web\static\src\js\widgets\auto_complete.js
Original Code:
odoo.define('web.AutoComplete', function (require) {
"use strict";
var Widget = require('web.Widget');
return Widget.extend({
template: "SearchView.autocomplete",
render_search_results: function (results) {
var self = this;
// this._super();
var $list = this.$el;
$list.empty();
results.forEach(function (result) {
var $item = self.make_list_item(result).appendTo($list);
result.$el = $item;
});
this.show();
// My customization
if(this.history)
{
var $first_list = self.$('li:first-child');
}
//End
},
});
Extended auto_complete_history.js
odoo.define('product.auto_complete_history', function (require) {
"use strict";
var AutoComplete = require('SearchView.autocomplete');
return AutoComplete.extend({
template: "SearchView.autocomplete",
render_search_results: function (results) {
this._super();
if(this.history)
{
var $first_list = self.$('li:first-child');
}
},
});
});
But extended file doesnt override the code.
Please anyone help to us how to extend this file.