跳至內容
選單
此問題已被標幟
3926 瀏覽次數

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>

             

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
11月 22
8456
2
8月 19
15252
3
7月 15
10704
1
1月 25
1129
3
7月 23
7067