Advertisement
rht_odoo

[QW][4724045]recurring_amount_and_number_months_document_tax_totals

Apr 22nd, 2025 (edited)
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.33 KB | None | 0 0
  1. <data>
  2.         <!--
  3.        Done by RHT on the 22/04/2025
  4.        Need : have the recurring amoutn and the total months
  5.        Task : https://www.odoo.com/odoo/project.task/4724045
  6.        Pastebin : https://pastebin.com/u6xeWws3
  7.        -->
  8.         <xpath position="after" expr="/t[@t-name='sale.document_tax_totals']/tr[2]" meta-class="o_subtotal">
  9.             <tr class="o_subtotal" t-if="doc and doc.is_subscription">
  10.                 <td>
  11.                     <span>Recurring Amount</span>
  12.                 </td>
  13.                 <td class="text-end">
  14.                     <span t-att-class="oe_subtotal_footer_separator" t-field="doc.recurring_monthly" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: currency}"/>
  15.                 </td>
  16.             </tr>
  17.             <tr t-if="doc and doc.is_subscription and doc.start_date and doc.end_date">
  18.                 <td>
  19.                     <span>Total Months</span>
  20.                 </td>
  21.                 <td class="text-end">
  22.                     <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 &lt; doc.start_date.day else 0)"/>
  23.                     <span t-esc="total_periods"/>
  24.                 </td>
  25.             </tr>
  26.         </xpath>
  27.     </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement