Hi,
Try below code
Add in .py file
class account_invoice_line(osv.osv):
_inherit = "account.invoice.line"
_columns = {
'your_new_field': fields.many2one('your object name', 'Field name',),
}
account_invoice_line()
Add in .xml file
<record id="invoice_customer_invoice_form" model="ir.ui.view">
<field name="name">account.invoice.customer.form.test</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='product_id']" position="replace">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)" invisible="1"/>
</xpath>
<xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='name']" position="before">
<field name="your_new_field"/>
</xpath>
</field>
</record>
What do you want do exactly.
i want to replace products in the customer invoices by another object,so i try to inherit from the product,any other solution pleasE?
i have added ans check it