Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to modify the position of the <tr> tags in reports under Accounting Reports and Journal in Odoo 8?

By
Ruston Emperua
on 10/9/16, 11:13 PM 142 views

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>

             

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/9/16, 11:13 PM
Seen: 142 times
Last updated: 10/10/16, 1:40 AM