Hi,
I have added a new field in product template like below
_name='product.template'
_inherit='product.template'
_columns={
'buy_price' : fields.float('Prix Achat',digits_compute=dp.get_precision('Price')),}
now in the supplier invoice I want to call this field so I have use this code:
_name='account.invoice.line'
_inherit='account.invoice.line'
_columns= {
'product_tmpl_id': fields.many2one('product.template', 'Product'),
'price_buy': fields.related('product_tmpl_id','buy_price',type="float",relation="product.template",string="PUHT",store=True,readonly=True),
}
when I update my module and create a new supplier invoice I get nothing in the new added field as shown in the picture
Any help please
Thanks
delete relation="product.template" in fields.related. fields.related('product_tmpl_id','buy_price',type="float",string="PUHT",store=True)