Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2875 Tampilan

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
Buang
Jawaban Terbai

can you please give more details about your report template ? 

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Nov 15
3034
1
Jul 24
1378
1
Apr 20
3265
2
Agu 17
9035
1
Agu 16
7671