如何在odoo pdf报告中为超过一千的数字添加逗号?

时间:2020-10-02 00:07:38

标签: odoo qweb

我在odoo13中创建了一个模块,该模块显示存款,取款和余额。我希望所有超过一千的金额都用逗号分隔。现在报告只显示1000,我想要的是1000。先感谢您。也许这是一个简单的问题,但我是所有这方面的初学者。

我要用逗号表示的金额是“金额”和“余额”。这是我的代码的一部分:

<tbody>
  <t t-set = "num" t-value = "0"/>
  <t t-set = "balance" t-value = "account.initial_amount"/>
  <t t-set = "transaction" t-value = "0"/>
  <t t-foreach = "movements_list" t-as= "move">
  <tr>
    <td>
     <t t-set= "num" t-value = "num +1"/>
     <t t-esc = "num"/>
    </td>
    <td>
     <t t-esc = "move['date']"/>
    </td>
    <td class = "text-left">
      <t t-if = "move['type_operation'] == 'withdraw'">
         <span>Retiro</span>
      </t>
      <t t-else = "">
         <span>Depósito</span>
      </t>
    </td>

    <td>
    <t t-if = "move['type_operation'] == 'withdraw'">
     <t t-esc = "move['amount']"/>
     <t t-set = "transaction" t-value = "move['amount']"/>
     <t t-set = "balance" t-value = "balance - transaction"/>
    </t>
    </td>

    <td>
    <t t-if = "move['type_operation'] == 'deposit'">
    <t t-esc = "move['amount']"/>
    <t t-set = "transaction" t-value = "move['amount']"/>
    <t t-set = "balance" t-value = "balance + transaction"/>
    </t>
    </td>

    <td>
     <span t-esc = "balance"/>
    </td>
    </tr>
    </t>
    
    </tbody>

0 个答案:

没有答案