-
- Downloads
[FIX] web: add preparse method for parsing dates in catalan
Observed Behaviour
When opening a pivot view with the catalan language activated
and grouping rows/cols by months, everything works fine. But if
we try to import this pivot view in a spreadsheet, all months
are converted to gener, which means 'January' in catalan
Expected Behaviour
When importing the pivot view in a spreadsheet, we should get
the correct date grouping
Reproducibility
This issue can be reproduced with the following steps
1. Activate the catalan language and set it
2. Got to Sales App
3. Select the pivot view
4. Group the rows/cols by order date > months
5. Try to import the pivot view in a spreadsheet
Fix Description
The isse was coming from the fact babel (the package used to
generate date as text in python) write the month as 'de gener',
'de febrer', 'de març', 'd'abril', while moment (the lib used
to handle date in JS) is looking for months as 'gener', 'febrer',
... (ie without "de" or "d'" prefix), causing it not to
recognize the date proposed by Babel. We then added a preparse
method to the catalan language, automatically used by moment when
present in the language definition.
Related Issues/PR
-opw-2817041
closes odoo/odoo#90466
Signed-off-by:
Nicolas Lempereur (nle) <nle@odoo.com>
addons/web/static/src/js/libs/moment.js
0 → 100644
Please register or sign in to comment