Hello. I created a button in model product.product. I have a binary pdf file on my disk. How to open this file when clicking on the button? (The path to the file will be different depending on the selected product.) How to use widget pdf_viewer?
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="button_for_pdf" model="ir.ui.view">
<field name="name">Product Product Inherit Button</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<header>
<button name="open_pdf" type="object" string="Open PDF" style="width:200px"/>
</header>
</field>
</record>
</data>
</odoo>
@api.multi
def open_pdf(self):
some_code
Binary Fields in Odoo: https://goo.gl/2JAxhD