Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5652 Weergaven

Hi,

In sale order line and in purchase order line when I change product quantity, product price (unit price) automatically set to 0. I am not getting why this is happening. 

Could anyone help me to achieve this.

Thank you in advance!

Avatar
Annuleer
Beste antwoord

Hi bro, 

You can solve this problem by following these steps:

  1. Create a new class that inherits from purchase.order.line. 

  2. Copy and paste the code down below inside the inherited class. 

  3. Vote positif :). 

The code:

@api.onchange('product_qty', 'product_uom') 
def _onchange_quantity(self):
    price = self.unit_price
    sup = super(purchaseOrderLine,self)._onchange_quantity()
    self.unit_price=price
    return sup


Avatar
Annuleer
Auteur

Thank you , it works for me!

Gerelateerde posts Antwoorden Weergaven Activiteit
2
dec. 23
15036
0
okt. 23
33
3
okt. 23
790
1
okt. 23
569
1
aug. 23
2627