openerp - Get post save event in Odoo -


i want execute function after record saved in database (something signals in django).

i have tried using odoo connector no success. connector module not present in openerp.addons package default , not find resource understand how install it.

how can execute function every time new record saved?

i solved myself.

  1. i manually copied connector module github /usr/lib/python2.7/dist-packages/openerp/addons (to make sure it's in ide's libraries' path).
  2. installed connector settings -> local modules.
  3. used following code (can anywhere, in __init__.py of module)

    @on_record_create(model_names=['res.users', 'res.partner']) @on_record_write(model_names=['res.users', 'res.partner']) def delay_export(session, model_name, record_id, vals):     """     real work here.     """     import ipdb; ipdb.set_trace() 

the above code based on odoo-connector.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -