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

I have a problem in my code, a compute method is not triggered each time a computed field should trigger it.I put an example:

@api.multi

@api.depends('child_ids', 'child_ids.computed_field', 'child_ids.normal_field')

def compute_depending_field(self):

   ...

Each time child_ids.computed_field changes, @api.depends should trigger the compute_depending_field method, but this is not happening. However, when the other fields of the decorator change, the method is executed.

I did some tests with @api.depends depending on computed fields of one2many fields (like child_ids) and they are not triggering the methods.

Why?


Аватар
Отменить
Лучший ответ

If the "child_ids.computed_field" is non-stored field, it will not trigger compute method depending on it

Аватар
Отменить
Лучший ответ

Hello Juan,


In the depends, you want to put those fields which is affected to your compute fields.

For Ex :- I have three fields, like weight, price and total and total is computed field to price and total so now i put weight and price in the depends not the total field.


Hope this will helps you.

Thanks,

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
дек. 19
6145
0
дек. 19
3259
1
мар. 18
6290
2
нояб. 16
4950
0
июл. 15
3435