【发布时间】:2019-08-14 17:34:20
【问题描述】:
我需要为每个员工打印一份时间表报告,并且我需要在标题而不是在列单元格上显示员工姓名,因为它将在每一行中重复,我不需要那个
我尝试使用
<template id="19011.employee">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<div class="text-center">
<h2> <strong>TIME SHEET</strong>
</h2>
<h2>
<tr t-foreach="docs" t-as="o">
<span t-field="o.employee_id" />
</tr>
</h2>
</div>
<table class="table table-condensed" bgcolor="#875A7B">
<tr>
<th> check in</th>
<th> check out</th>
<th> Total</th>
</tr>
<tr t-foreach="docs" t-as="o">
<td>
<t t-esc="o.check_in" />
</td>
<td>
<t t-esc="o.check_out" />
</td>
<td>
<t t-esc="o.total" />
</td>
</tr>
<tr bgcolor="#875A7B">
<td align="center"> <strong> Total Hours</strong></td>
<td></td>
<td>
<strong t-esc="sum([o.total for o in docs])" />
</td>
</tr>
</table>
</div>
</t>
</t>
</template>
我需要它在标题或第一列显示employee_id 我只在第一行不重复
【问题讨论】:
-
你能显示报告动作吗?
-
我添加了一个屏幕截图
-
将
<span t-field="o.employee_id" />移出t-foreach,将o替换为docs的第一条记录