diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-04-30 13:29:27 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-04-30 13:39:30 +0200 |
| commit | 1da5d89ba32526f241b3a0ce82b25a2fa9ee858f (patch) | |
| tree | c0c1ab5a19a747d91d489fe46dae5e0b6c6bcc43 /addons/web/static/src/xml/base.xml | |
| parent | f2f4391e8bc0a135f0b1c4afe93e272cb27407b6 (diff) | |
[FIX] web: advanced search on floats with ',' as decimal separator
When using another decimal separator than `.` (dot)
in the language settings,
it wasn't possible to build an advanced search specifying
the decimals.
e.g. with a language with decimal separator `,` and thousand
separator `.`,
if you want to search invoices with amount total 366,38
The advanced search "Total" "is equal to" obliged you
to enter your number with `.` as separator (366.38),
and then, when entering the search, the `.` was
regarded as the thousand separator, giving as domain
`('amount_total', '=', 36638)`, which is not what you asked.
opw-634201
PS: The `|| '.'` in the xml template are only for
retro-compatibility, so if the server sources are
updated, but the browser cache is not refreshed
(meaning the Javascript code isn't refreshed, and,
therefore, `widget.decimal_point is undefined)
it still works.
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 13d7e5df080..e9949a589b1 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1673,7 +1673,11 @@ <input type="number" class="field_integer" value = "0" step="1"/> </t> <t t-name="SearchView.extended_search.proposition.float"> - <input type="number" class="field_float" value = "0.0" step="0.01"/> + <input class="field_float" + t-att-type="widget.decimal_point === '.' ? 'number' : 'text'" + t-attf-title="Number using #{widget.decimal_point || '.' } as decimal separator." + t-attf-pattern="[0-9]+([\\#{widget.decimal_point || '.' }][0-9]+)?" + t-attf-value="0#{widget.decimal_point || '.' }0" step="0.01"/> </t> <t t-name="SearchView.extended_search.proposition.selection"> <select> |
