Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
7522 Zobrazení

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
Zrušit
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.

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
kvě 25
3669
0
lis 24
1022
1
srp 24
1731
1
srp 24
3154
2
kvě 23
2087