Hello all,
On the template sale.report_saleorder_document in Odoo 10 enterprise.
One line causes an error, and I don't find the problem. It is weird because this line works on an other Odoo 10 installation.
These lines works well :
<span t-field="l.price_subtotal" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' />
<span t-field="l.price_total" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}' />
<span t-esc="subtotal" t-options="{'widget': 'monetary', 'display_currency': doc.pricelist_id.currency_id}" />
But this one doesn't work :
<span t-esc="amount_by_group[1]" t-options="{'widget': 'monetary', 'display_currency': doc.pricelist_id.currency_id}" />
I get this error :
QWebException: unsupported operand type(s) for /: 'unicode' and 'float'
Traceback (most recent call last):
File "/opt/odoo/addons/base/ir/ir_qweb/qweb.py", line 315, in _compiled_fn
return compiled(self, append, values, options, log)
File "<template>", line 1, in template_sale_report_saleorder_document_1191
File "<template>", line 3, in body_call_content_1190
File "<template>", line 136, in foreach_1172
File "/opt/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 276, in _get_widget
content = converter.value_to_html(value, field_options)
File "/opt/odoo/addons/base/ir/ir_qweb/fields.py", line 322, in value_to_html
formatted_amount = lang.format(fmt, display_currency.round(value),
File "/opt/odoo/addons/base/res/res_currency.py", line 93, in round
return tools.float_round(amount, precision_rounding=self.rounding)
File "/opt/odoo/odoo/tools/float_utils.py", line 52, in float_round
normalized_value = value / rounding_factor # normalize
TypeError: unsupported operand type(s) for /: 'unicode' and 'float'
Error to render compiling AST
TypeError: unsupported operand type(s) for /: 'unicode' and 'float'
Template: sale.report_saleorder_document
Path: /templates/t/t/div/div[3]/div/table/t/tr/td[2]/span
Node: <span t-esc="amount_by_group[1]" t-options="{'widget': 'monetary', 'display_currency': doc.pricelist_id.currency_id}"/>