odoo10 report自定义paperformat,就是自定义打印的纸张大小格式等
来源:互联网 发布:沙特王室知乎 编辑:程序博客网 时间:2024/05/29 18:33
在report.xml中添加
<record id="paperformat_euro_qingjia" model="report.paperformat"> <field name="name">European A4 low margin</field> <field name="default" eval="True"/> <field name="format">custom</field> <field name="page_height">100</field> <field name="page_width">100</field> <field name="orientation">Portrait</field> <field name="margin_top">0</field> <field name="margin_bottom">0</field> <field name="margin_left">0</field> <field name="margin_right">0</field> <field name="header_line" eval="False"/> <field name="header_spacing">0</field> <field name="dpi">80</field> </record><report id="action_report_qingjia"model="qingjia.qingjiadan"string="打印请假单"report_type="qweb-pdf"name="qingjia.qingjiadan_action_report"paperformat="paperformat_euro_qingjia"/>
record id="paperformat_euro_qingjia" model="report.paperformat"
record id可以改为自己定义的新名字。
model=report.paperformat不要改动,就用这个。除了添加以上新代码,还需要在__mannifest__.xml中添加'depends': ['base','report']注意这一行改为custom <field name="format">custom</field>格式改为custom后,才可以对后续数据进行更改,其余的格式,比如A4,都是有标准数据的。
report.xml所有代码如下:
<odoo><data><record id="paperformat_euro_qingjia" model="report.paperformat"> <field name="name">European A4 low margin</field> <field name="default" eval="True"/> <field name="format">custom</field> <field name="page_height">100</field> <field name="page_width">100</field> <field name="orientation">Portrait</field> <field name="margin_top">0</field> <field name="margin_bottom">0</field> <field name="margin_left">0</field> <field name="margin_right">0</field> <field name="header_line" eval="False"/> <field name="header_spacing">0</field> <field name="dpi">80</field> </record><report id="action_report_qingjia"model="qingjia.qingjiadan"string="打印请假单"report_type="qweb-pdf"name="qingjia.qingjiadan_action_report"paperformat="paperformat_euro_qingjia"/><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></data></odoo>
完整的Module代码:http://download.csdn.net/download/qingtianjushi/10129385
引用:https://www.odoo.com/forum/help-1/tag/paperformat-6371/questions
阅读全文
0 0
- odoo10 report自定义paperformat,就是自定义打印的纸张大小格式等
- 打印自定义纸张大小
- 打印自定义纸张大小
- 打印自定义纸张大小
- JAVA 打印,自定义纸张大小
- Java打印,自定义纸张大小
- 水晶报表自定义纸张大小打印 (Crystal Report Print with custom paper size)
- odoo10 report添加自定义CSS
- C#中使用自定义的纸张大小打印文档
- 通过自定义打印纸张的大小,实现打印到哪里纸张就停止在哪里。
- 通过自定义打印纸张的大小,实现打印到哪里纸张就停止在哪里
- 水晶报表自定义纸张大小打印 (转)
- 水晶报表中如何创建自定义的纸张大小格式?
- 单据的自定义纸张打印
- QucikReport自定义纸张大小
- 打印机--自定义纸张大小
- C# 自定义纸张大小
- VC++自定义纸张打印
- 静态结构模型 动态行为模型
- HTML引入CSS的三种方式
- Android Menu用法全面讲解
- 常见排序算法总结
- 利用alarm()和pause()函数实现sleep()函数
- odoo10 report自定义paperformat,就是自定义打印的纸张大小格式等
- 排序-快速排序
- [UOJ191][集训队互测2016]Unknown-线段树-斜率优化
- 手机端页面所需文件引入
- 给多个jar包起一个别名,用于项目引用
- springboot整合mybatis
- Photolemur(自动化图片处理软件)官方破解版V2.2.0.909下载 | photolemur 破解版
- Sicily 拓扑排序
- 套接字编程常用函数