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.


(API 8.0) How to know the trigger field of method @api.depends('field_1', 'field_2', ..., 'field_n') ?

Yanina Aular
on 4/28/15, 9:15 PM 472 views

Hello community friends.

I am working with the new api 8.0 of odoo 
And Please I need you help... 

I have two fields: field_1 and field_2:

field_1 = fields.Many2one(........, compute='_filling_method')

field_2 = fields.Many2one(........, compute='_filling_method')

... and the _filling_method:

@api.depends('field_1', 'field_2')

def _filling_method(self):

How I can know what is the trigger field in the method? field_1 or field_2?

@api.depends('field_1', 'field_2')

def _filling_method(self):

     if trigger == 'field_1':
     if trigger == 'field_2':


Is there any way?

Thanks a lot.!



| 5 4 7
Lodz, Poland

On 4/29/15, 8:45 AM

Why do not you use:

def _filling_method_AAA(self):
def _filling_method_BBB(self):

And what if you have just one only field_1 (with its one compute method) that depends on field_2 and field_3, and you need to know which one triggers the method in order to give a value to field_1?

Anubía, soluciones en la nube, S.L., Alejandro Santana
on 6/3/15, 5:54 PM
Yanina Aular
On 4/29/15, 10:38 AM

I believed that it was possible. I will do with two methods. Thanks a lot zbik

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: 4/28/15, 9:15 PM
Seen: 472 times
Last updated: 4/29/15, 12:20 PM