← Back to team overview

openerp-connector-community team mailing list archive

Re: Data passed to event subscribers.

 

On 09/27/2013 10:25 AM, Mignon, Laurent wrote:
Hi,

What's the motivation to only pass the list of modified attributes to
subscribed functions and not the complete dictionary?
  If the subscriber want to execute a specific action depending of the
new value of a specific field, we must retrieve the value from the
database despite it was available at the observer level.


Regards,

lmi

//



Hi,

In the context of the jobs, you don't want the complete dictionary because you don't know in which timeframe it will be executed, data could have been invalidated meantime.

However, I agree that there are use cases where you need the values as well:
 - subscribing a consumer doing other things than creating a job
 - creating a job or another depending on the values

To be consistent, we would need to add the dictionary in the 'on_record_create' event too.

Cheers,

--
Guewen Baconnier
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/


References