コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7362 ビュー

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

"workorder+=1"  it doesn't work

アバター
破棄

Can You Explain Your Question in Brief?

最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
0
8月 22
2372
1
7月 22
20061
0
4月 22
3042
3
9月 21
3196
2
9月 21
4498