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

@api.depends on super field not working

By
Friedrich Ewald
on 7/28/15, 4:23 AM 475 views

Hello everyone,

i want to use the method decorator `@api.depends` on an inherited model and I want to depend on two super fields, namely: `project.task_count` and `project.issue_count`


I got the following code so far:


class xyz_project_management_project(models.Model):
    _inherit = 'project.project'
# ...
    @api.one
    @api.depends('task_count')
    def _set_color_from_task_and_issue_count(self):
        print 'Hello API World'

But this method is never called. What I am doing wrong here?


Regards

i think you have to call the function in a button.

Abdul wahid
on 7/28/15, 5:09 AM

It is actually possible to create a new computed field which does not store the result and which gets the values out of the fields I want and everytime it changes it fires a function. Not the cleanest method but a safe workaround.

Friedrich Ewald
on 7/28/15, 7:31 AM

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: 7/28/15, 4:23 AM
Seen: 475 times
Last updated: 7/28/15, 7:31 AM