Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2865 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

can you please give more details about your report template ? 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 15
3021
1
thg 7 24
1374
1
thg 4 20
3247
2
thg 8 17
9033
1
thg 8 16
7665