Commit c0243ebb by Yvon Kerdoncuff

do not try to convert to string a None float value

parent 6bb941fe
Pipeline #3944 failed with stage
...@@ -204,7 +204,7 @@ class ExportPOS(View): ...@@ -204,7 +204,7 @@ class ExportPOS(View):
# p['name'] is a sequence generated string # p['name'] is a sequence generated string
# Test order is important as CHEQDEJ contains CHEQ for ex. # Test order is important as CHEQDEJ contains CHEQ for ex.
# p['journal'] could be used but easier to change in Odoo interface # p['journal'] could be used but easier to change in Odoo interface
sub_amount = round(float(p['total_amount']), 2) sub_amount = round(float(p['total_amount']), 2) if p['total_amount'] else 0.00
if 'CSH' in p['name']: if 'CSH' in p['name']:
csh = sub_amount csh = sub_amount
elif 'CHEQDEJ' in p['name']: elif 'CHEQDEJ' in p['name']:
...@@ -317,7 +317,7 @@ class ExportPOS(View): ...@@ -317,7 +317,7 @@ class ExportPOS(View):
totals = {} totals = {}
for r in res: for r in res:
if (float(r['total_amount']) > 0): if r['total_amount'] and float(r['total_amount']) > 0:
# d = time.strptime(r['min_date'], tf) # d = time.strptime(r['min_date'], tf)
# date = str(d.tm_mday) + '-' + str(d.tm_mon) + '-' + str(d.tm_year) # date = str(d.tm_mday) + '-' + str(d.tm_mon) + '-' + str(d.tm_year)
date, hours = r['min_date'].split(' ') date, hours = r['min_date'].split(' ')
......
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