Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <data>
- <!--
- Done by RHT on the 22/04/2025
- Need : have the recurring amoutn and the total months
- Task : https://www.odoo.com/odoo/project.task/4724045
- Pastebin : https://pastebin.com/u6xeWws3
- -->
- <xpath position="after" expr="/t[@t-name='sale.document_tax_totals']/tr[2]" meta-class="o_subtotal">
- <tr class="o_subtotal" t-if="doc and doc.is_subscription">
- <td>
- <span>Recurring Amount</span>
- </td>
- <td class="text-end">
- <span t-att-class="oe_subtotal_footer_separator" t-field="doc.recurring_monthly" t-options="{"widget": "monetary", "display_currency": currency}"/>
- </td>
- </tr>
- <tr t-if="doc and doc.is_subscription and doc.start_date and doc.end_date">
- <td>
- <span>Total Months</span>
- </td>
- <td class="text-end">
- <t t-set="total_periods" t-value="(doc.end_date.year - doc.start_date.year) * 12 + (doc.end_date.month - doc.start_date.month) - (1 if doc.end_date.day < doc.start_date.day else 0)"/>
- <span t-esc="total_periods"/>
- </td>
- </tr>
- </xpath>
- </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement