跳至內容
選單
此問題已被標幟
2 回覆
5403 瀏覽次數

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
4月 24
24853
0
3月 15
3323
3
8月 23
7289
5
3月 22
19741
3
12月 22
8018