Commit ad7bc617 by Yvon Kerdoncuff

fix logged error : make sure total_amount is float before rounding it

parent 2c1a3415
Pipeline #3894 canceled with stage
......@@ -204,7 +204,7 @@ class ExportPOS(View):
# p['name'] is a sequence generated string
# Test order is important as CHEQDEJ contains CHEQ for ex.
# p['journal'] could be used but easier to change in Odoo interface
sub_amount = round(p['total_amount'], 2)
sub_amount = round(float(p['total_amount']), 2)
if 'CSH' in p['name']:
csh = sub_amount
elif 'CHEQDEJ' in p['name']:
......@@ -317,11 +317,11 @@ class ExportPOS(View):
totals = {}
for r in res:
if (r['total_amount'] > 0):
if (float(r['total_amount']) > 0):
# d = time.strptime(r['min_date'], tf)
# date = str(d.tm_mday) + '-' + str(d.tm_mon) + '-' + str(d.tm_year)
date, hours = r['min_date'].split(' ')
total = round(r['total_amount'], 2)
total = round(float(r['total_amount']), 2)
cb = csh = chq = 0
caisse = r['config_id'][1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment