odoo中打印页码

1.在addons/report/views/layouts.xml中加入自定义的页码函数
<template id="foot_layout_footer">#定义页码函数名称
    <div class="header">
    </div>
    <t t-raw="0" />
    <div class="footer">
        <div class="text-center" style="border-top: 1px solid black;">
            <ul class="list-inline">
                <li>Page:</li>
                <li><span class="page"/></li>#当前页码
                <li>/</li>
                <li><span class="topage"/></li>#总页码
            </ul>
        </div>
    </div>
</template>
2.在函数中引用
<?xml version="1.0" encoding="utf-8">
<openerp>
    <data>
    <template id="xxxxxx">#模块名
    <t t-call="report.html_container">
    <t t-call="report.foot_layout_footer">#在此处添加
    <t t-foreach="docs" t-as="o">
            <div class="page">
            <div class="oe_structure"/>
            <t t-if = "o.reissue_coordination_order">
                <h4 style="center;">Linx Work Coordination Order Reissue</h4>
            </t>
            <t t-if = "not o.reissue_coordination_order">
                <h4 style="center;">Linx Work Coordination Order</h4>
            </t>
            <h5>Coordination Order Number:   <span t-field="o.name"/></h5>
            <style>
                .div-height{width:300px;height:25px}
            </style>
            <div class="row text-right">
                <div class="col-xs=-1">
                Manager:<span t-field="o.manager"/>
                </div>
                <div class="col-xs=-1">
                <t t-if="o.agent">
                    Agent:<span t-field="o.agent"/>
                </t>
                </div>
            </div>
            <table class="gridtable table table-bordered table-condensed">
                <tbody>
                <tr>
                    <td rowspan="2" style="padding:1px 1; width:15%; text-align:center;">Task Propose Unit</td>
                    <td rowspan="2" style="padding:1px 1; width:35%;"><span t-field="o.task_propose_unit"/></td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Propose Department Leader</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.propose_department_leader_approval"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Propose Department Head</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.propose_department_heads_endorsement"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Task Receive Unit</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.task_receive_unit"/></td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Receive Department Head</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.receive_department_heads_endorsement"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Project</td>
                    <td style="padding:1px 1; width:85%;" colspan="3">
                    <t t-foreach="o.project" t-as="proj">
                        <span t-field="proj.name"/>;
                    </t>
                    </td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Voucher</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.voucher"/></td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Voucher Number</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.voucher_number"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">The End User</td>
                    <td style="padding:1px 1; width:35%;">
                    <t t-foreach="o.end_user" t-as="end_user">
                        <span t-field="end_user.name"/>;
                    </t>
 <td style="padding:1px 1; width:15%; text-align:center;">Contract Number</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.contract_number"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Hardware Vendor</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.hardware_vendor"/></td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Integrators</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.integrators"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Project Contact</td>
                    <td style="padding:1px 1; width:35%;">
                    <t t-foreach="o.project_contact" t-as="proc">
                        <span t-field="proc.name"/>;
                    </t>
                    </td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Contact Telephone</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.contact_telephone"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Propose Date</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.propose_date"/></td>
                    <td style="padding:1px 1; width:15%; text-align:center;">Complete Date</td>
                    <td style="padding:1px 1; width:35%;"><span t-field="o.complete_date"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Comment</td>
                    <td style="padding:1px 1; width:85%;" colspan="3"><span t-field="o.comment"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Task Topic</td>
                    <td style="padding:1px 1; width:85%;" colspan="3"><span t-field="o.task_topic"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Task Type</td>
                    <td style="padding:1px 1; width:85%;" colspan="3">
                    <t t-foreach="o.task_type" t-as="ty">
                        [<span t-field="ty.name"/>].
                    </t>
                    </td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; align:center;" rowspan="3">The specific requirements of the task</td>
                    <td style="padding:1px 1;" colspan="3">Task:<span t-field="o.task_content"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1;" colspan="3">Date:<span t-field="o.task_date"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1;" colspan="3">Address:<span t-field="o.task_address"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1; width:15%; text-align:center;">Receive Schedule</td>
                    <td style="padding:1px 1;" colspan="3"><span t-field="o.receive_schedule"/></td>
                </tr>
                <tr>
                    <td style="padding:1px 1;" colspan="4">
                    Current Results:
                    <p style="margin:1px 1;">1.The actual situation of the task:</p>
                    <t t-if="not o.task_actual_implementation">
                        <div class="div-height"/>
                    </t>
                    <p style="margin:1px 15;"><span t-field="o.task_actual_implementation"/></p>
                    <p style="margin:1px 1;">2.The task was not proformd:</p>
                    <t t-if="not o.task_not_performed">
                        <div class="div-height"/>
                    </t>
                    <p style="margin:1px 15;"><span t-field="o.task_not_performed"/></p>
                    <p style="margin:1px 1;">3.Additional tasks:</p>
                    <t t-if="not o.task_additional_situation">
                        <div class="div-height"/>
                    </t>
                    <p style="margin:1px 15;"><span t-field="o.task_additional_situation"/></p>
                    <p style="margin:1px 1;">Executant:   <span t-field="o.task_executant"/></p>
                    </td>
                </tr>
                <tr>
                    <td style="padding:1px 1;" colspan="4">
                    Whether to complete this task:<span t-field="o.complete_this_task1"/>
                    <p style="margin:1px 1;">Remained Problem:</p>
                    <t t-if="not o.remained_problem">
                        <div class="div-height"/>
                    </t>
                    <p style="margin:1px 15;"><span t-field="o.remained_problem"/></p>
                    </td>
 </tr>
                </tbody>
            </table>
            </div>
        </t>
        </t>
        </t>

    </temmplate>
    </data>
</openerp>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值