首页 文章

报告在Odoo 10

提问于
浏览
1

我创建了一个示例报告 . 但风格出了问题 . 这是代码:

report.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
  <report
   id="project_quotation"
   model="project.quotation"
   string="Project Quotation"
   report_type="qweb-pdf"
   name="project_quotation.report_rfp"
   file="project_quotation.report_rfp"
   menu="True"/>

<template id="report_rfp">
<t t-call="report.html_container">
    <t t-foreach="docs" t-as="o">
        <t t-call="report.external_layout">
            <div class="page">
                <h2>Report title</h2>
                <p>This object's name is <span t-field="o.name"/></p>
            </div>
        </t>
    </t>
</t>
</template>
</odoo>

但报告看起来像:
enter image description here

我错过了什么?

3 回答

  • 2

    激活Developermode goto More>Settings>Technical>Reports>Paperformat > either create or edit European A4 report format 更改 Top Margin (mm)和 Header spacing 的值,它将解决其他问题,请尝试以下方法:

    <template id="report_rfp">
        <t t-call="report.html_container">
            <t t-call="report.external_layout">
                <t t-foreach="docs" t-as="o">
                    <t t-call="report.external_layout">
                        <div class="page">
                            <h2>Report title</h2>
                            <p>This object's name is <span t-field="o.name"/></p>
                        </div>
                    </t>
                </t>
            </t>
        </t>
    </template>
    
  • 0

    我看到您的报告未反映您的更改 .

    这是因为附件 .

    它会在不更新的情况下从附件中打印出来 .

    所以,去吧

    设置>报告>报告

    在那里找到您的报告名称"Project Quotation"并在下面进行更改 .
    enter image description here

    然后更新您的模块并检查 .

  • 0

    对不起,但是我没有足够的声誉来留下这个评论 .

    您是否将report.xml添加到__openerp_.py文件中?

相关问题