mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_advanced_search: Exception raised with "Search more..."
Steps to reproduce: 1. Go to Contacts (for example). 2. Filters > Add Custom Filter. 3. Select "Company" field. 4. Select "is equal to" operator. 5. Click on "Search more..." button. 6. Select a record. Result: An exception is raised ``` UncaughtPromiseError > TypeError Uncaught Promise > parent._trigger_up is not a function ``` Expected: It should open the search more dialog, and let the user select a record.
This commit is contained in:
@@ -17,7 +17,7 @@ export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, {
|
||||
this.componentAdapter = parent;
|
||||
const options = this.componentAdapter.props.attrs;
|
||||
// Create a dummy record with only a dummy m2o field to search on
|
||||
const model = new BasicModel("dummy");
|
||||
const model = new BasicModel(this.componentAdapter);
|
||||
const params = {
|
||||
fieldNames: ["dummy"],
|
||||
modelName: "dummy",
|
||||
@@ -63,9 +63,11 @@ export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, {
|
||||
* @override
|
||||
*/
|
||||
_confirmChange: function (id, fields, event) {
|
||||
this.componentAdapter.trigger("change", event.data.changes[fields[0]]);
|
||||
const res = FieldManagerMixin._confirmChange.apply(this, arguments);
|
||||
this.dataPointID = id;
|
||||
return this.reset(this._get_record(this.model), event);
|
||||
this.reset(this._get_record(this.model), event);
|
||||
this.componentAdapter.trigger("change", this.value.data);
|
||||
return res;
|
||||
},
|
||||
/**
|
||||
* Stop propagation of the autocompleteselect event.
|
||||
|
||||
Reference in New Issue
Block a user