Odoo Help

0

@api.depends on super field not working

By
Friedrich Ewald
on 7/28/15, 4:23 AM 782 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

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/28/15, 4:23 AM
Seen: 782 times
Last updated: 7/28/15, 7:31 AM