[FIX] pos_restaurant: make sure tip amount is formatted correctly

Current behavior:
When the user language uses a different decimal separator than the
"." (dot), the tip amount is not formatted correctly and the amount is
incorrect. e.g. 1.5 is interpreted as 15.0

Steps to reproduce:
- Change the current language decimal separator to "," (comma) and
  thousand separator to "." (dot)
- Open restaurant (make sure tip after payment is enabled)
- Add a product to the order
- Pay by bank
- Click on tip 20%
- The tip amount is incorrect (too high)

opw-3525033

closes odoo/odoo#140926

X-original-commit: f0cd80fbb55e0f234800c6be4696ff8e1533978b
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
This commit is contained in:
roen-odoo
2023-11-04 06:43:09 +00:00
parent 62eeabaa43
commit 7ee59307ff
@@ -29,7 +29,7 @@
<div class="tip-amount-options d-flex flex-column gap-2 mx-4 p-3 rounded bg-view">
<div class="percentage-amounts d-flex gap-2">
<t t-foreach="percentageTips" t-as="tip" t-key="tip.percentage">
<button class="button btn btn-lg btn-secondary flex-fill py-5" t-on-click="() => { state.inputTipAmount = tip.amount.toFixed(2); }">
<button class="button btn btn-lg btn-secondary flex-fill py-5" t-on-click="() => { state.inputTipAmount = env.utils.formatCurrency(tip.amount,false); }">
<div class="percentage fs-1 text-primary text-center">
<t t-esc="tip.percentage"></t>
</div>