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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
5141
Views
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! :)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Oct 22
|
2501 | ||
|
2
Mar 21
|
1372 | ||
|
3
Jul 19
|
5244 | ||
|
2
Mar 15
|
3699 | ||
|
0
Mar 15
|
2968 |