跳至内容
菜单
此问题已终结
2 回复
10794 查看

Hello ALL,

I have created a form in odoo 11 and want all information on that form should be downloaded in PDF and printed after.

I have created a button to print but i know how to get the report action id and how can i create the report action id to be able to work with the button.

Here is the button i have created: <button name="%(print_pdf)d" string="Print" type="action" class="oe_highlight" icon="fa-print"/>


Please help!!!!!!!

形象
丢弃
编写者 最佳答案

Hello Niyas,

Thanks for the help but i'm encountering and error when i click on the print button.

AttributeError: type object 'blog.request' has no attribute 'print_request'
形象
丢弃
最佳答案

Hi,

If you are looking to create a new PDF report in odoo11, you can refer this documentation in the Odoo website: QWeb Reports

If you are looking to download an existing report in a button click see the below sample code ,

In the Python,

@api.multi
def print_quotation(self):
return self.env.ref('sale.action_report_saleorder').report_action(self)

and in the XML,

<button name="print_quotation" string="Print" type="object" states="draft" class="btn-primary o_sale_print"/>

Thanks

形象
丢弃
相关帖文 回复 查看 活动
2
6月 20
4035
1
3月 19
3892
1
11月 22
3331
2
8月 22
7673
1
1月 25
9365