Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Set report orientation

By
Javier Batres Velásquez
on 2/17/15, 10:28 AM 1,536 views

Hello I need change the orientation of the report on qweb-pdf. I am following the documentation making a record, but I don't understand why is this ignored. Here is the XML

     <report
        id="report_asiento_contable"
        model="account.move"
        string="Asiento contable"
        name="velfasa.report_asiento_contable_view"
        file="velfasa.report_asiento_contable"
        report_type="qweb-pdf" />
    <template id="report_asiento_contable_view">
        <xpath expr="//style" position="after">
            <style type="text/css" >
                .tabla {
                    cellpadding: 10;
                    border: 1px solid black;
                }
            </style>
        </xpath>
        <t t-call="report.html_container">
            <record id="paperformat_asiento_contable" model="report_asiento_contable.paperformat">
                    <field name="name" >Asiento contable</field>
                   <field name="orientation" >Landscape</field>
            </record>

       </t>

  </template

Thanks, this is the solution.

Javier Batres Velásquez
on 2/17/15, 11:57 AM
1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 2/17/15, 11:37 AM

Try this:

<report
        id="report_asiento_contable"
        model="account.move"
        string="Asiento contable"
        name="velfasa.report_asiento_contable_view"
        file="velfasa.report_asiento_contable"
        report_type="qweb-pdf" />
        
<template id="report_asiento_contable_view">
        <xpath expr="//style" position="after">
            <style type="text/css" >
                .tabla {
                    cellpadding: 10;
                    border: 1px solid black;
                }
            </style>
        </xpath>
</template>

<record id="paperformat_asiento_contable" model="report.paperformat">
       <field name="name">Asiento contable</field>
       <field name="orientation">Landscape</field>
</record>

<record id="report_asiento_contable" model="ir.actions.report.xml">
    <field name="paperformat_id" ref="paperformat_asiento_contable"/>
</record>   

 

probably you also need: <template id="report_asiento_contable_view" inherit_id="report.XXXXXXXX">

hope this help.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/17/15, 10:28 AM
Seen: 1536 times
Last updated: 3/16/15, 8:10 AM