how can I show the brand name in the description of the products in sale.order.line.
product_brand_id = fields.Many2one('product.brand', string='Brand')
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
how can I show the brand name in the description of the products in sale.order.line.
product_brand_id = fields.Many2one('product.brand', string='Brand')
Hi,
Try the code below it may help you ,
from odoo import fields, models, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.depends('product_id')
def _compute_name(self):
res = super(SaleOrderLine, self)._compute_name()
for line in self:
if not line.product_id:
return
if line.product_id:
line.name = line.product_id.brand_id.name
return res
Regards
Create an account today to enjoy exclusive features and engage with our awesome community!
Tilmeld dig