Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2860 Näkymät

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
Hylkää
Paras vastaus

can you please give more details about your report template ? 

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
marrask. 15
3017
1
heinäk. 24
1370
1
huhtik. 20
3245
2
elok. 17
9032
1
elok. 16
7664