Skip to Content
Menu
This question has been flagged
1 Reply
2866 Views

<report
     id="report_receipt"
     string="Receipt Report"
     model="cont"
     report_type="qweb-pdf"
     file="contract.receipt_report"
     name="contract.receipt_report"

     print_report_name = "(object.name)"
/>

---------------------------------------------------------------

<template id="receipt_report">
     <t t-call="web.html_container">
         <t t-foreach="docs" t-as="doc">
         <t t-call="contract.receipt_reporttt" />
     </t>
     </t>
</template>

-------------------------------------------------------------------

<record id="reciept_report_view" model="ir.ui.view">
     <field name="name">recipt Report</field>
     <field name="model">receipt.wizard</field>
     <field name="arch" type="xml">
         <form>
             <group col="4">
             <field name="date_receipt_from"/>
             </group>
             <footer>
                 <button name="check_report" string="Export PDF" type="object" default_focus="1" class="oe_highlight" />
                 <button string="Cancel" class="oe_link" special="cancel" />
             </footer>
         </form>
     </field>
</record>

-----------------------------------------------------------------------


<record id="action_recipt_wizard" model="ir.actions.act_window">
     <field name="name">Generate reciept Report</field>
     <field name="res_model">receipt.wizard</field>
     <field name="type">ir.actions.act_window</field>
     <field name="view_type">form</field>
     <field name="view_mode">form</field>
     <field name="view_id" ref="reciept_report_view"/>
     <field name="target">new</field>
</record>

How start qweb report in the wizard in object form?

I don't want the report wizard to run from the button.


Avatar
Discard
Best Answer

Hi,

If you are looking how to print/generate the pdf report from wizard have a look at this video: Create and Print PDF Report From Wizard in Odoo

Code sample:

@api.multi
def print_project_report_pdf(self):
active_record = self._context['active_id']
record = self.env['sale.order'].browse(active_record)
data = {
'ids': self.ids,
'model': self._name,
'record': record.id,
}
return self.env.ref('template_name').report_action(self, data=data)


Thanks

Avatar
Discard