Odoo Help


(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 969 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.!



| 6 5 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

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