Skip to content
Snippets Groups Projects
Commit 770f095e authored by Florent de Labarre's avatar Florent de Labarre
Browse files

[FIX] sale: prevent -0.00 amount


In some circonstance user can show -0.00 on taxe. It is more logical to show 0.00

closes odoo/odoo#95425

Signed-off-by: default avatarLaurent Smet <las@odoo.com>
Co-authored-by: default avatarLaurent Smet <las@openerp.com>
parent b2e3c58a
No related branches found
No related tags found
No related merge requests found
......@@ -997,6 +997,12 @@ Reason(s) of this behavior could be:
res[group]['amount'] += t['amount']
res[group]['base'] += t['base']
res = sorted(res.items(), key=lambda l: l[0].sequence)
# round amount and prevent -0.00
for group_data in res:
group_data[1]['amount'] = currency.round(group_data[1]['amount']) + 0.0
group_data[1]['base'] = currency.round(group_data[1]['base']) + 0.0
order.amount_by_group = [(
l[0].name, l[1]['amount'], l[1]['base'],
fmt(l[1]['amount']), fmt(l[1]['base']),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment