Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
5414 Näkymät

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

Avatar
Hylkää
Paras vastaus

Hello. You solve this issue?

Avatar
Hylkää
Paras vastaus

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.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
huhtik. 24
24859
0
maalisk. 15
3330
3
elok. 23
7300
5
maalisk. 22
19757
3
jouluk. 22
8024