Reputation: 611
how can sum 2 values in qweb ? I want to add span with the sum values of field1 + field2.
<span t-field="doc.field1"/>
<span t-field="doc.field2"/>
Thanks.
Upvotes: 0
Views: 260
Reputation: 11143
Try with this:
<t t-set="total" t-value="doc.field1 + doc.field2"/>
Now you can use total variable for display.
For example:
<span t-esc="total"/>
Upvotes: 2