Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
7560 Weergaven

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
Annuleer
Auteur
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.

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mei 25
3703
0
nov. 24
1031
1
aug. 24
1764
1
aug. 24
3190
2
mei 23
2132