odoo10 report添加自定义CSS—第二篇

昨天写了odoo10 report添加自定义CSS的两种方法,这还有一种方法,这个比较正规一点了。


添加下列代码到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>


整个模块下载地址:http://download.youkuaiyun.com/download/qingtianjushi/10129142

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ensky.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值