Odoo Help


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.


How to use the triggers for compute field in odoo?

on 11/3/15, 1:06 AM 402 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 3 6
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


| 5 4 8
Kochi, India
ODOO technical and functional

        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

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.

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

2 follower(s)


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