Odoo Help

0

Odoo 9C: Overriding method & its "depends" decorator [Bug]

By
deep
on 6/16/16, 9:27 AM 584 views

In Odoo 9C:

am trying to override a standard method, which involves adding another dependency field.

However, I noticed, newly added field in the depends decorator is not taken into consideration while saving the record.


Ex: Say in Purchase Order, the method called "_amount_all" has @api.depends on "order_line.price_total"

Now In my custom module I have overridden that method, and included one of my dependency field to it, like

@api.depends('order_line.price_total','myfield')

Though it seems to work, when I change the value in myfield, however while saving the record, method is not triggered to recompute...


So In other words, newly added dependency fields are not taken into consideration while saving the record, as a result, method computation is not at all triggered. Hence old value is retained.


I believe this must be a bug.


Anybody has faced this issue?



0
deep
On 7/21/16, 12:50 AM

I realised, this issue is happening only with the currency field, in which I have overridden the related property of the same in its lines.

However, for other fields or newly created fields, it works fine. Not sure what could be the problem in my scenario, perhaps the overriding of related didn't go well I guess. Anyways it doesn't matter since I found an alternate way to fulfil my requirement.

Refer the below thread which I had raised in Github, though I haven't got the solution for my problem, just thought, it might be useful to someone, who is looking for the same kind of solution.

Odoo 9C: Overriding the method & its "depends" decorator [Bug] #12459

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: 6/16/16, 9:27 AM
Seen: 584 times
Last updated: 7/21/16, 12:50 AM