[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.
pull/2484/head
Ivàn Todorovich 2023-04-18 11:52:18 -03:00
parent 98c78299a5
commit 66b4dd2dd8
No known key found for this signature in database
GPG Key ID: E7222FC36B138243
1 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, {
this.componentAdapter = parent; this.componentAdapter = parent;
const options = this.componentAdapter.props.attrs; const options = this.componentAdapter.props.attrs;
// Create a dummy record with only a dummy m2o field to search on // 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 = { const params = {
fieldNames: ["dummy"], fieldNames: ["dummy"],
modelName: "dummy", modelName: "dummy",
@ -63,9 +63,11 @@ export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, {
* @override * @override
*/ */
_confirmChange: function (id, fields, event) { _confirmChange: function (id, fields, event) {
this.componentAdapter.trigger("change", event.data.changes[fields[0]]); const res = FieldManagerMixin._confirmChange.apply(this, arguments);
this.dataPointID = id; 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. * Stop propagation of the autocompleteselect event.