跳至内容
菜单
此问题已终结
1 回复
5660 查看

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!

形象
丢弃
最佳答案

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


形象
丢弃
编写者

Thank you , it works for me!

相关帖文 回复 查看 活动
2
12月 23
15040
0
10月 23
33
3
10月 23
790
1
10月 23
569
1
8月 23
2627