[FIX] web: searchpanel: category on m2o with no parent_field
Rev. e264eca enabled the search with 'child_of' operator for
categories on many2one fields. However, it crashed if there is no
parent_field on the comodel.
This commit is contained in:
@@ -442,7 +442,7 @@ var SearchPanel = Widget.extend({
|
||||
var category = self.categories[categoryId];
|
||||
if (category.activeValueId) {
|
||||
var field = self.fields[category.fieldName];
|
||||
var op = field.type === 'many2one' ? 'child_of' : '=';
|
||||
var op = (field.type === 'many2one' && category.parentField) ? 'child_of' : '=';
|
||||
domain.push([category.fieldName, op, category.activeValueId]);
|
||||
}
|
||||
return domain;
|
||||
|
||||
Reference in New Issue
Block a user