Hello everyone!
Give me an advice, please
I have to add product categories inside invoice’s table.
How can I do it?
Screenshot: https://imgur.com/a/YHmpugw
Menu path: Invoicing > Selecting an invoice
odoo version 12.0-20211011
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello everyone!
Give me an advice, please
I have to add product categories inside invoice’s table.
How can I do it?
Screenshot: https://imgur.com/a/YHmpugw
Menu path: Invoicing > Selecting an invoice
odoo version 12.0-20211011
Thanks
Hi Stanislav ,
To do this you need to Inherit account.invoice.line
In Py
class AccountInvoiceLine(models.Model):
_inherit = 'account.invoice.line'
category_id = fields.Many2one('product.category', 'Product Category')
XML
<record model="ir.ui.view" id="view_invoice_product_category">
<field name="name">account.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='name']" position="after">
<field string="Category" name="category_id"/>
</xpath>
</field>
</record>
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up