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

 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
2380
1
7月 22
20072
0
4月 22
3051
3
9月 21
3202
2
9月 21
4502