Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Does @api.depends recognize computed fields?

By
Juan Formoso
on 2/16/16, 3:31 AM 679 views

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?


0

Jignesh Mehta

--Jignesh Mehta--
2087
| 6 4 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 2/20/16, 1:50 AM

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,

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/16/16, 3:31 AM
Seen: 679 times
Last updated: 2/20/16, 1:50 AM