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

 workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

"workorder+=1"  it doesn't work

Avatar
Hylkää

Can You Explain Your Question in Brief?

Paras vastaus

Hi,

workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

The above line is field declaration and if you have to increment the value on the field workorder_count, write a function in the name you have mentioned in the compute "_compute_workorder_count".

@api.depends('workorder_count')
def _compute_workorder_count(self):
     self.workorder_count += 1


Thanks

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
elok. 22
2397
1
heinäk. 22
20097
0
huhtik. 22
3067
3
syysk. 21
3236
2
syysk. 21
4527