OpenERP RML块表问题
我正在修改OpenERP员工工资单RML报告, 我想按收入或扣除额来划分这一行。 这就是我所期望的最终结果:OpenERP RML块表问题,openerp,rml,Openerp,Rml,我正在修改OpenERP员工工资单RML报告, 我想按收入或扣除额来划分这一行。 这就是我所期望的最终结果: _____________________________ _____________________________ | Earnings | Deductions | | | | | Descript
_____________________________ _____________________________
| Earnings | Deductions |
| | |
| Description Amount | Description Amount |
| BASIC 7000.00 | Provident Fund 300.0 |
| House Rent 500.00 | Professional Tax 200.0 |
| Conveyance 200.00 | |
| Other Allowance 300.00 | |
|_____________________________|_____________________________|
但当扣除额和收入线的长度不一样时,我得到的是:
_____________________________ _____________________________
| Earnings | Deductions |
| | |
| Description Amount | |
| BASIC 7000.00 | |
| House Rent 500.00 | Description Amount |
| Conveyance 200.00 | Provident Fund 300.0 |
| Other Allowance 300.00 | Professional Tax 200.0 |
|_____________________________|_____________________________|
这是我的RML:
<blockTable colWidths="270, 270">
<tr>
<td><para style="P15">Earnings</para></td>
<td><para style="P15">Deductions</para></td>
</tr>
<tr>
<td>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>Description</td>
<td>Amount</td>
</tr>
</blockTable>
<section>
<blockTable colWidths="200.0, 70.0">
<para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'earnings'),'p') ]]</para>
<tr>
<td>[[ p['name'] ]]</td>
<td>[[ p['amount'] ]]</td>
</tr>
</blockTable>
</section>
</td>
<td>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>Description</td>
<td>Amount</td>
</tr>
</blockTable>
<section>
<para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'deductions'),'d') ]]</para>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>[[ d['name'] ]]</td>
<td>[[ abs(d['amount']) ]]</td>
</tr>
</blockTable>
</section>
</td>
</tr>
</blockTable>
收益
扣除
描述
数量
[[repeatIn(获取工资条行(o.line\U ID,'earnings'),'p')]]
[[p['name']]
[[p['金额]]]
描述
数量
[[repeatIn(获取工资单行(o.line\U ID,'Decrections'),'d')]]
[[d['name']]
[[abs(d['金额])]]
请告诉我正确的标记。您需要的是设置表格单元格的垂直对齐方式。为此,您必须使用a
<stylesheet>
<blockTableStyle id="T1">
<blockValign value="TOP"/>
</blockTableStyle>
<stylesheet>
然后,在表定义中:
<blockTable colWidths="270, 270" style="T1">
<tr>
<td><para style="P15">Earnings</para></td>
<td><para style="P15">Deductions</para></td>
</tr>
<tr>
<td>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>Description</td>
<td>Amount</td>
</tr>
</blockTable>
<section>
<blockTable colWidths="200.0, 70.0">
<para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'earnings'),'p') ]]</para>
<tr>
<td>[[ p['name'] ]]</td>
<td>[[ p['amount'] ]]</td>
</tr>
</blockTable>
</section>
</td>
...
收益
扣除
描述
数量
[[repeatIn(获取工资条行(o.line\U ID,'earnings'),'p')]]
[[p['name']]
[[p['金额]]]
...
我使用了另一种方法,我使用1个表而不是2个表,但感谢您的解决方案,我将尝试:D@Andrei博亚诺夫在我的报告中,我的定制桌子总是在中间。我试着用“中心”这个词。但问题仍然存在。有什么解决办法吗。谢谢..@manuthalasseril请举例说明。可能还有其他问题吗?@Andrei Boyanov谢谢你的回答。我的问题与此qtn中的问题相同。无论如何,我暂时解决了这个问题,在最后一列中添加了另一个空白列,并为新添加的列提供了剩余空间。并使表边界不可见。如何将金额项目分隔为'earnings'
和'decreations'
?例如,'Gross'
或'Net
既不属于'earnings'
也不属于'declarations'
。'earnings'
obj是从方法返回的吗?