Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
7359 Представления

 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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
авг. 22
2365
1
июл. 22
20057
0
апр. 22
3040
3
сент. 21
3191
2
сент. 21
4494