Skip to content

Commit

Permalink
[FIX] Avoid redefinition of this.OPERATORS as a new object
Browse files Browse the repository at this point in the history
This causes problems with the inheritance of this.OPERATORS
from other addons, if new operators are added

Fixes OCA#722
  • Loading branch information
hugosantosred authored and agyamuta committed Dec 14, 2023
1 parent 67a286f commit 19c0fc6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions date_range/static/src/js/date_range.esm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @odoo-module **/
import {FIELD_OPERATORS, FIELD_TYPES} from "web.searchUtils";
import {CustomFilterItem} from "@web/search/filter_menu/custom_filter_item";
import {FIELD_TYPES} from "web.searchUtils";
import {_lt} from "@web/core/l10n/translation";
import {patch} from "@web/core/utils/patch";
import {useService} from "@web/core/utils/hooks";
Expand All @@ -15,9 +15,6 @@ patch(CustomFilterItem.prototype, "date_range.CustomFilterItem", {
},

async _computeDateRangeOperators() {
this.OPERATORS = Object.assign({}, FIELD_OPERATORS);
this.OPERATORS.date = [...FIELD_OPERATORS.date];
this.OPERATORS.datetime = [...FIELD_OPERATORS.datetime];
this.date_ranges = {};
const result = await this.orm.searchRead(
"date.range",
Expand Down

0 comments on commit 19c0fc6

Please sign in to comment.