I am trying to add more date ranges to the spreadsheet/dashboard filters. This worked in 16, but it does not work in 17.
import { patch } from "@web/core/utils/patch";
import { _t } from "@web/core/l10n/translation";
patch(require('@spreadsheet/helpers/constants'), {
RELATIVE_DATE_RANGE_TYPES: [
{ type: "year_to_date", description: _t("Year to Date") },
{ type: "last_week", description: _t("Last 7 Days") },
{ type: "last_month", description: _t("Last 30 Days") },
{ type: "last_three_months", description: _t("Last 90 Days") },
{ type: "last_six_months", description: _t("Last 180 Days") },
{ type: "last_year", description: _t("Last 365 Days") },
{ type: "last_three_years", description: _t("Last 3 Years") },
{ type: "o_last_business_day", description: _t("Last Business Day") },
{ type: "o_last_week", description: _t("Last Week") },
{ type: "o_last_month", description: _t("Last Month") },
]
});
And I insert in the __manifest__.py after the original:
'assets': {
'spreadsheet.o_spreadsheet': [
('after', 'spreadsheet/static/src/helpers/constants.js', 'spreadsheet_dates/static/src/helpers_constants.js'),
('after', 'spreadsheet/static/src/global_filters/helpers.js', 'spreadsheet_dates/static/src/global_filters_helpers.js'),
],
}
I see the patch code in the final javascript looking at the browsers code, but it does not seem to apply. (I also patched getRelativeDateDomain to support the new filters, but that does not seem to apply either. I am testing that with just a conole.log)
What am I doing wrong, any help is appreciated.
Thanks,
-Matt