Odoo Help

Welcome!

This community 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.

0

Add 'Invoiced' smart button in Product Template

By
Samantha Cruz
on 3/1/16, 1:17 AM 600 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

1
CatsandDogs
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"/>
</tree>
</field>
</record>
<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>
<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
</button>
</div>
</field>
</record>

Thank you so much! :)

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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