Community: Framework mailing list archives

expert-framework@mail.odoo.com

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

by
Vauxoo S.A. de C.V., Yanina Aular
- 04/28/2015 21:28:08

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


--
B. Sc. in Computer Sciences Yanina Aular
Vauxoo OpenERP's Gold Partner
Programmer - Open Source Consultant
Web:
http://www.yanina.com.ve
Twitter: @yaniaular
Launchpad User: https://launchpad.net/~yanina-aular