← Back to team overview

openerp-connector-community team mailing list archive

Re: Is synchronous communication possible ?

 

Thank you Guewen, this is very insightful.
Lionel.

Le 19/02/2014 15:53, Guewen Baconnier a écrit :
No, this is not how it works actually. If you use delay() it will be pushed in the queue, and the job will be executed in its own transaction, not the current one. If you decide to not use the delay() on the function, so there is no queuing, the function is executed like any other function at the moment it is called in a totally synchronous manner.

I think it would be possible, as a new feature, to extend the job decorator so it would add another attribute like my_function.delay_sync() that would push the job in a memory queue local to the current cr, that'd be executed just before the commit. The difficulty here would come from the Cursor class in OpenERP that is not designed to be extended and would require to be monkey-patched... :-( I already did some tests around that).




References