Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
7513 Tampilan

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
Buang
Penulis
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.

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Mei 25
3640
0
Nov 24
1005
1
Agu 24
1687
1
Agu 24
3112
2
Mei 23
2060