Odoo中文网|Odoo实施培训

 找回密码
 立即注册
搜索
热搜: Odoo OpenERP 实施
查看: 6921|回复: 0
打印 上一主题 下一主题

odoo10 report添加自定义CSS

[复制链接]

24

主题

26

帖子

125

积分

版主

Rank: 7Rank: 7Rank: 7

积分
125
跳转到指定楼层
楼主
发表于 2018-2-7 21:53:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
添加下列代码到xml文件中,这段代码放哪里都行,再新建一个xml也可以,只要在manifest中引入了就行。下面用到的report.css是自己新建一个即可,名字随便改。
<template id="minimal_layout" inherit_id="report.minimal_layout">  
    <xpath expr="//head" position="inside">  
    <link href="/qingjia/static/src/css/report.css" rel="stylesheet"/>  
    </xpath>  
</template>
整个report.xml文件:
<odoo>  
    <data>  
  
    <template id="minimal_layout" inherit_id="report.minimal_layout">  
        <xpath expr="//head" position="inside">  
        <link href="/qingjia/static/src/css/report.css" rel="stylesheet"/>  
        </xpath>  
    </template>  
  
    <template id="qingjiadan_action_report">  
  
         <t t-call="report.html_container">  
  
            <div class="page">  
                 <t t-call="qingjia.main_css"/>  
                    <table class="test-report">  
                        <tr class="test-report"><td>名字</td><td>请假天数</td><td>开始日期</td><td>原因</td><td>状态</td></tr>  
                        <t t-foreach="docs" t-as="o">  
                        <tr>  
                            <td><t t-raw="o.name" /></td>  
                            <td><t t-raw="o.days" /></td>  
                            <td><t t-raw="o.startdate" /></td>  
                            <td><t t-raw="o.reason" /></td>  
                            <td><t t-raw="o.state" /></td>  
                        </tr>  
                        </t>  
                    </table>  
            </div>  
        </t>  
    </template>  
  
    <report id="action_report_qingjia"  
        model="qingjia.qingjiadan"  
        string="打印请假单"  
        report_type="qweb-pdf"  
        name="qingjia.qingjiadan_action_report"  
    />  
  
    </data>  
</odoo>  

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|技术支持|开发手册|Odoo中文网-远鼎旗下odoo培训网站 ( 苏ICP备15039516号 )

GMT+8, 2024-4-20 20:50 , Processed in 0.011829 second(s), 9 queries , Xcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表