Odoo Help


How to use the triggers for compute field in odoo?

on 11/3/15, 1:06 AM 1,195 views


I need a trigger value,

cost_store_triggers = {'product.product':(_get_replace_cost, ['cost'], 5)}

In that case I need a recomputed value for all related (parent and child product cost) product cost so I used this trigger, but it's not working.

Cost = fields. Float (string='Cost', compute=_get_replace_cost, store=cost_store_triggers)


Akhil P Sivan

--Akhil P Sivan--

| 5 4 7
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 11/3/15, 2:07 AM

Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 11/3/15, 1:53 AM


you can use @api.depends() for this : specify the field dependencies; those dependencies are used to determine when to recompute the field; recomputation is automatic and guarantees cache/database consistency. Note that the same method can be used for several fields, you simply have to assign all the given fields in the method; the method will be invoked once for all those fields.

 @api.depends('field1', 'field2')

Hope this helps.

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.


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

2 follower(s)


Asked: 11/3/15, 1:06 AM
Seen: 1195 times
Last updated: 11/3/15, 2:07 AM