Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2858 มุมมอง

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>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

can you please give more details about your report template ? 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 15
3009
1
ก.ค. 24
1370
1
เม.ย. 20
3244
2
ส.ค. 17
9032
1
ส.ค. 16
7664