Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5441 มุมมอง

when inherit sale order line, onchange('product_id') can't work, but onchange other fields can work normally. 

also find that when inherit sale order , onchange('partner_id') can't work  also. 

class SaleOrderLine(models.Model):

_inherit = "sale.order.line"


@api.one

@api.onchange('delay')

def onchange_commission_plan(self):

print '323a'

if self.product_id:

pass

@api.one

@api.onchange('product_id')

def onchange_commission_plan99(self):

print '121323a'

if self.product_id:

pass

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello. You solve this issue?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You probably have a conflict between the new and the old api. Check other installed modules and find which uses on_change for product_id field of view xml (old style onchange). When used both at the same time, it works only in old style.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
when to use new api decorators?????? แก้ไขแล้ว
2
เม.ย. 24
24914
0
มี.ค. 15
3370
3
ส.ค. 23
7352
5
มี.ค. 22
19807
How to set domain in field on page load? แก้ไขแล้ว
3
ธ.ค. 22
8061