Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7373 Lượt xem

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

"workorder+=1"  it doesn't work

Ảnh đại diện
Huỷ bỏ

Can You Explain Your Question in Brief?

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 22
2382
1
thg 7 22
20074
0
thg 4 22
3056
3
thg 9 21
3214
2
thg 9 21
4505