diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2020-11-04 16:48:35 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2020-11-05 15:42:28 +0000 |
| commit | 74ea66a107cfc98cce8e52903ec21e3d752fb4fb (patch) | |
| tree | 3677ae8d4bae353536f4c73ebe14e0f1a67b2c7c /addons/web/static/src/js/control_panel/search_utils.js | |
| parent | 5b022f433a44e627541d30ae21d7a867f4a3a6ff (diff) | |
[FIX] web: use latin number date domain in comparison menu
When using eg. arabic locale, the figures inside dates were replaced by
arabic figures which are not supported server side (they are almost
always sent in latin figures).
With this changeset, the we are using english locale to get date in
domains.
Without the change, added test fails with:
Numbers in domain should not use addoneForTest locale
Expected:...[date_field, >=, 2020-06-01], [date_field, <=, 2020-06-30]
Result:...[date_field, >=, 3131-17-12], [date_field, <=, 3131-17-41]
opw-2370392
closes #61354
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/control_panel/search_utils.js')
| -rw-r--r-- | addons/web/static/src/js/control_panel/search_utils.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/control_panel/search_utils.js b/addons/web/static/src/js/control_panel/search_utils.js index cd4ae869651..b8dc29edefc 100644 --- a/addons/web/static/src/js/control_panel/search_utils.js +++ b/addons/web/static/src/js/control_panel/search_utils.js @@ -287,8 +287,8 @@ odoo.define('web.searchUtils', function (require) { const date = referenceMoment.clone().set(setParam).add(addParam || {}); // compute domain - let leftBound = date.clone().startOf(granularity); - let rightBound = date.clone().endOf(granularity); + let leftBound = date.clone().locale('en').startOf(granularity); + let rightBound = date.clone().locale('en').endOf(granularity); if (fieldType === 'date') { leftBound = leftBound.format('YYYY-MM-DD'); rightBound = rightBound.format('YYYY-MM-DD'); |
