3
0
Fork 0

[FIX] move our patched equals operator to top of list

9.0
Holger Brunn 2015-05-26 09:05:43 +02:00
parent ae3ec7c54e
commit d875f7726c
1 changed files with 20 additions and 1 deletions

View File

@ -27,11 +27,30 @@ openerp.web_advanced_search_x2x = function(instance)
{ {
template: 'web_advanced_search_x2x.extended_search.proposition.many2one', template: 'web_advanced_search_x2x.extended_search.proposition.many2one',
searchfield: null, searchfield: null,
init: function()
{
this.operators = _.sortBy(
this.operators,
function(op)
{
switch(op.value)
{
case '=':
return -2;
case '!=':
return -1;
default:
return 0;
}
});
return this._super.apply(this, arguments);
},
start: function() start: function()
{ {
this.getParent().$('.searchview_extended_prop_op') this.getParent().$('.searchview_extended_prop_op')
.on('change', this.proxy('operator_changed')); .on('change', this.proxy('operator_changed'));
return this._super.apply(this, arguments); return this._super.apply(this, arguments).then(
this.proxy(this.operator_changed));
}, },
get_field_desc: function() get_field_desc: function()
{ {