Commit Graph
3 Commits
Author SHA1 Message Date
Xavier Morel a92e88d547 [IMP] base: make tests less sensitive to babel / CLDR updates
Babel's named / implicit formats (short, medium, long, ...) come from
the CLDR, which can get tuned as debates get settled, cultures shift,
etc... as a result using these formats can break tests on any babel or
even CLDR release (technically nothing stops distros from updating
their bundled babel with new CLDR data).

b77eb98bbf6bc937efb7941802c0794ae3622094 previously did some
mitigation of this issue, but even if they're not yet in distros
further Babel updates (e.g. 2.12) already affect some of the patterns
we're using.

Proactively mitigate this issue more by only using explicit datetime
patterns (and time patterns, date is fine because it retrieves the
pattern from the lang rather than default to babel patterns) in the
date/time formatting tests. This means only specific terms still vary,
and those should be a lot more stable / reliable than e.g. futzing
with separators and minor formatting issues.

closes odoo/odoo#137181

X-original-commit: 3547e980428cc1dd11c8e82446e7d7f824b9f6f8
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-02 05:56:06 +00:00
MAHAMADASIF ANSARI e246bf1448 [IMP] base: allow to specify decimal points with format_decimalized_number
Currently, we can format the number into decimal points with help of
the `format_decimalized_number` option of `ir.qweb.field.integer`
class. However, sometimes we need to decide how many decimal points
we need to display, which is not possible with current implementation.

This commit improves the above option and now allows to pass the number
of decimal points, with a new option `precision_digits`, which defaults
to one decimal point.

task-2792149

Part-of: odoo/odoo#87996
2022-05-04 17:46:12 +02:00
Jérémy Hennecart (jeh) 5cf3206547 [IMP] base: add qweb field for float value representing a time value
We add a new qweb field that transforms a float value to a human-
readable time format.

task-2458013
COM PR: odoo#78049

Part-of: odoo/odoo#78049
2022-03-23 20:18:34 +01:00