Skip to Content
Menu
This question has been flagged

What I want to achieve is to make the parent accounts subtotals appear below their children accounts. I tried switching their order in <tr> tag but still it won't reflect to the report.

Example in account/views/report_trialbalance.xml


<xpath expr="//table[@class='table table-condensed']/tbody" position="replace"><tbody><t t-foreach="lines(data['form'])" t-as="childrenaccount">

    <tr t-if="childrenaccount['type'] == 'view'"> <t t-set="style" t-value="'font-weight:bold;'"/> <td> <span t-att-style="style" t-esc="childrenaccount['code']"/> </td> <td> <span style="color: white;" t-esc="'.' * (childrenaccount['level'] - 1)"/> <span t-att-style="style" t-esc="childrenaccount['name']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['debit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['credit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="formatLang(childrenaccount['balance'], currency_obj=res_company.currency_id)"/> </td> </tr> <tr t-if="childrenaccount['type'] != 'view'"> <t t-set="style" t-value="'font-weight:normal;'"/>

        <td> <span t-att-style="style" t-esc="childrenaccount['code']"/> </td> <td> <span style="color: white;" t-esc="'.' * (childrenaccount['level'] - 1)"/> <span t-att-style="style" t-esc="childrenaccount['name']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['debit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['credit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="formatLang(childrenaccount['balance'], currency_obj=res_company.currency_id)"/> </td> </tr> <tr t-if="childrenaccount['type'] == 'view'"> <t t-set="style" t-value="'font-weight:bold;color:blue;'"/>

        <td colspan="2"> <span style="color:white;">...</span> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['debit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="childrenaccount['credit']"/> </td> <td class="text-right"> <span t-att-style="style" t-esc="formatLang(childrenaccount['balance'], currency_obj=res_company.currency_id)"/> </td> </tr></t></tbody></xpath>

             

Avatar
Discard
Related Posts Replies Views Activity
3
Nov 22
7120
2
Aug 19
13053
3
Jul 15
9531
3
Jul 23
5658
4
May 23
8703