Skip to Content
Menu
This question has been flagged
3 Replies
17754 Views

I created my own menu and submenus, and form. And i created button in form for print custom qweb report. But i could not make button function. I have already created report template, how can i make button function to print report? Once i have done print custom report like this;

<openerp>
    <data>
        <report
            id="payment_report_custom"
            string="Payment Report"
            model="account.payment"
            report_type="qweb-pdf"
            file="custom_reports.payment_rpt"
            name="custom_reports.payment_rpt"
            paperformat="custom_reports.izmer_paperformat"
        />
    </data>
</openerp>
but this creates odoos print button, i did'not create any custom button. Now, this time i want my own print button.
Thank you.
Avatar
Discard
Best Answer

You don't need a function you just need the action id for the template and add it  to the button in your view.

<button name="%(action_report_my_report)d" string="Get report" type="action"/>

Hope this will help you

Avatar
Discard
Best Answer

Hi Serdar Eren,

In Odoo 10, you can add your custom qweb report print button by using menu=”True” attribute  in report tag.

<odoo>
    <data>
        <report
            id="payment_report_custom"
            string="Payment Report"
            model="account.payment"
            report_type="qweb-pdf"
            file="custom_reports.payment_rpt"
            name="custom_reports.payment_rpt"
            paperformat="custom_reports.izmer_paperformat"
            menu=”True”
        />
    </data>
</odoo>

I hope this will help you.

Thanks!

Avatar
Discard
Best Answer

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<data>

<report

id="report_account_payment"

string="Print Payment Supplier"

model="account.payment"

report_type="qweb-pdf"

file="odoo-juvisk/report/report_account_payment"

name="odoo-juvisk.report_account_payment_view" />

<template id="report_account_payment_view">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="doc">

<t t-call="report.external_layout">

<div class="page">

<div class="oe_structure"/>

<h2>Payment Supplier # <span t-field="doc.name"/></h2>

<div class="row">

<div class="col-xs-6">

<strong>Date:</strong>

<p t-field="doc.payment_date"/>

<strong>Partner:</strong>

<p t-field="doc.partner_id.name"/>

<strong>Amount:</strong>

<p t-field="doc.amount"/>

</div>

<div class="col-xs-6">

<strong>Journal:</strong>

<p t-field="doc.journal_id.name"/>

</div>

</div>

</div>

</t>

</t>

</t>

</template>

</data>

</odoo>


I hope can help you

Avatar
Discard
Related Posts Replies Views Activity
4
Apr 22
4031
0
Aug 20
1253
7
Aug 19
22279
2
Oct 18
13556
0
Sep 18
3307