Skip to content

Commit

Permalink
[FIX] web_advanced_search: recover support for m2m and o2m custom filter
Browse files Browse the repository at this point in the history
TT44862
  • Loading branch information
chienandalu committed Sep 1, 2023
1 parent 84ffe96 commit 7220ef4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions web_advanced_search/static/src/js/RecordPicker.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {Component} = owl;
const {xml} = owl.tags;

export const FakeMany2oneFieldWidget = FieldMany2One.extend(FieldManagerMixin, {
supportedFieldTypes: ["many2many", "many2one", "one2many"],
/**
* @override
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ patch(CustomFilterItem.prototype, "web_advanced_search.legacy.CustomFilterItem",
async willStart() {
this.OPERATORS.relational = this.OPERATORS.char;
this.FIELD_TYPES.many2one = "relational";
this.FIELD_TYPES.many2many = "relational";
this.FIELD_TYPES.one2many = "relational";
return this._super(...arguments);
},
/**
Expand Down
2 changes: 1 addition & 1 deletion web_advanced_search/static/src/xml/CustomFilterItem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<t t-inherit="web.CustomFilterItem" t-inherit-mode="extension" owl="1">
<xpath expr="//select[@t-elif]" position="after">
<t
t-elif="fieldType === 'many2one' and ['=', '!='].includes(selectedOperator.symbol)"
t-elif="['many2one', 'many2many', 'one2many'].includes(fieldType) and ['=', '!='].includes(selectedOperator.symbol)"
>
<RecordPicker
model="fields[condition.field].relation"
Expand Down

0 comments on commit 7220ef4

Please sign in to comment.