M.E.
M.E.

Reputation: 5495

Odoo 10 - Qweb report, multiply two fields

How can I multiply two fields in Odoo Qweb report? I have seen that there is an option to sum several fields/items:

<t t-set="subtotal" t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>

Can I multiply two fields/values?

Upvotes: 1

Views: 1437

Answers (1)

CZoellner
CZoellner

Reputation: 14768

To stay in your example:

<t t-set="subtotal"
    t-value="sum([line.field1 * line.field2 for line in layout_category['lines']])"/>

Upvotes: 2

Related Questions