Odoo Help


Add 'Invoiced' smart button in Product Template

Samantha Cruz
on 3/1/16, 1:17 AM 1,299 views

I want to add 'Invoiced' smart button in product.template, an example is in the customers but I don't know how can do that

On 3/1/16, 7:33 AM

Inherit the account invoice and use the below code for smart button,(This code for odoo 9)

        <record id="view_product_invoice_line_tree" model="ir.ui.view">
<field name="name">product.account.invoice.line.tree</field>
<field name="model">account.invoice.line</field>
<field name="arch" type="xml">
<tree string="Invoice Line">
<field name="invoice_id"/>
<field name="product_id"/>
<field name="account_id"/>
<field name="quantity"/>
<field name="uom_id"/>
<field name="price_unit"/>
<field name="discount"/>
<field name="price_subtotal"/>
<field name="currency_id" invisible="1"/>
<record model="ir.actions.act_window" id="action_inv_line_product_tree">
<field name="context">{}</field>
<field name="domain">[('product_id','in',active_ids)]</field>
<field name="name">Invoices</field>
<field name="res_model">account.invoice.line</field>
<field name="view_id" ref="view_product_invoice_line_tree"/>
<record id="view_product_template_invoice_buttons_from" model="ir.ui.view">
<field name="name">product.template.invoice.button.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="%(account.action_inv_line_product_tree)d"
type="action" icon="fa-shopping-cart">Invoices

Thank you so much! :)

Samantha Cruz
on 3/1/16, 7:56 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/1/16, 1:17 AM
Seen: 1299 times
Last updated: 3/1/16, 7:56 PM