I am trying to compute VAT field in my customized excel report, based on a total before vat field and multiplying it by 0.15 but everytime I execute the code I get errors like type error
below is the code
for invoice in invoice_objs:
invoice_date = invoice.invoice_date.strftime('%Y-%m-%d')
worksheet.write(row, 0, invoice_date)
worksheet.write(row, 1, invoice.name)
worksheet.write(row, 2, invoice.partner_id.name)
worksheet.write(row, 3, ', '.join(invoice.invoice_line_ids.mapped('product_id.name')))
worksheet.write(row, 4, ', '.join(invoice.invoice_line_ids.mapped('tax_ids.name')))
worksheet.write(row, 5, ', '.join(str(i) for i in invoice.invoice_line_ids.mapped('price_subtotal')))
if 'Sales VAT' in invoice.invoice_line_ids.mapped('tax_ids.name'):
worksheet.write(row, 6, '15%')
else:
worksheet.write(row, 6, '0%')
if 'Sales VAT' in invoice.invoice_line_ids.mapped('tax_ids.name'):
%%--> worksheet.write(row, 7, (', '.join(str(i) for i in invoice.invoice_line_ids.mapped('price_subtotal')))* 0.15)
Please check the last line might be there is issue in that
--------UPDATE-----------
Error Message:
File "/home/suhaib/odoo/odoo/addons/invoice_summary_report/wizard/invoice_summary_report_wizard.py", line 93, in action_print_invoice_summary worksheet.write(row, 7, (', '.join(str(i) for i in invoice.invoice_line_ids.mapped('price_subtotal')))* 0.15) TypeError: can't multiply sequence by non-int of type 'float'
Maybe you could post the error message ?