Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2870 Zobrazení

Hi, 

 i want to add reportinf to my model "recalamation" 

this is my reporting folder on the model the report is doing but the page dowloaded is empty 

what is missing my code please 


my report model :


from openerp import api, models

class ParticularReport(models.AbstractModel):

    _name = 'report.reclamation.report_reclamation'

    @api.multi

    def render_html(self, data=None):

        report_obj = self.env['report']

        report = report_obj._get_report_from_name('module.report_name')

        docargs = {

            'doc_ids': self._ids,

            'doc_model': report.model,

            'docs': self,

        }

        return report_obj.render('module.report_name', docargs)


my report template declaration and template:


<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data> 

 <record id="paperformat_frenchcheck" model="report.paperformat">

    <field name="name">French Bank Check</field>

    <field name="default" eval="True"/>

    <field name="format">custom</field>

    <field name="page_height">80</field>

    <field name="page_width">175</field>

    <field name="orientation">Portrait</field>

    <field name="margin_top">3</field>

    <field name="margin_bottom">3</field>

    <field name="margin_left">3</field>

    <field name="margin_right">3</field>

    <field name="header_line" eval="False"/>

    <field name="header_spacing">3</field>

    <field name="dpi">80</field>

 </record>

 <!-- Translatable template -->

<template id="report.report_reclamation_document">

    <t t-call="report.external_layout">

        <div class="page">

            <div class="oe_structure"/>  

        </div>

    </t>

</template> 

 <!-- Main template -->

<template id="report.reclamation_report">

    <t t-call="report.html_container">

        <t t-foreach="doc_ids" t-as="doc_id">

            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'report.report_reclamation_document')"/>

        </t>

    </t>

</template>



 <report

    id="reclamation"

    model="reclamation"

    string="Reclamations"

    report_type="qweb-pdf"

    name="report.reclamation_report"

    file="report.reclamation_report"

    attachment_use="True"

    attachment="(object.state in ('cloture_trait','cloture_nontrait')) and

        ('INV'+('').replace('/','')+'.pdf')"

   />

</data>

</openerp>

Avatar
Zrušit
Nejlepší odpověď

can you please give more details about your report template ? 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
lis 15
3026
1
čvc 24
1374
1
dub 20
3248
2
srp 17
9033
1
srp 16
7665