1
votes

I have created a sample report. But something went wrong with style. Here is code:

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>

But report look like:enter image description here

What am i missing?

3
Sorry but i don't think that the code and the outcome are linked with each other. Could you please show us the real code for that outcome? - CZoellner

3 Answers

2
votes

Activate the Developermode goto More>Settings>Technical>Reports>Paperformat > either create or edit European A4 report format change values of Top Margin (mm) and Header spacing it'll resolve the issue other wise try this:

<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
votes

I have seen that your report is not reflecting your changes.

It is because of the attachment.

It is giving you printout from the attachment without updating it.

So, Go to the

Setting > Reports > Report

Find your report there by name as "Project Quotation" and make below change.enter image description here

Then update your module and check.

0
votes

I'm sorry but i got not enough reputationpoints to leave this as a comment.

Did you add your report.xml to the __openerp_.py file?