Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
7515 Vistas

how to change the product description while choosing the product in the sales module during the creation of a quotation, by default Description is the combination of the fields product_id name and default_code(Internal Reference)

Please help me to change the value of Description as Internal note(description field) and also the product name as product_id



Avatar
Descartar
Autor
Thanks dude its working

On Thu, Apr 23, 2020 at 12:33 PM Baiju KS <baijuks@hotmail.com> wrote:

A new question How to change the Product Description in while choosing the product in sale quotation in odoo 12 on Help has been posted. Click here to access the question :

See question


Sent by Odoo S.A. using Odoo.

Mejor respuesta

Hi Prajith,

You have to override product_id_change() in the sale.order.line and update the value for the description field.

Please check the code:

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'


@api.multi
@api.onchange('product_id')
def product_id_change(self):
res = super(SaleOrderLine, self).product_id_change()
vals = {}
if self.product_id.default_code:
vals['name'] = self.product_id.name +" ["+ self.product_id.default_code +"]"
self.update(vals)
return res

Hope this helps.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
may 25
3643
0
nov 24
1005
1
ago 24
1689
1
ago 24
3118
2
may 23
2062