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.
- i manually copied
connector
module github/usr/lib/python2.7/dist-packages/openerp/addons
(to make sure it's in ide's libraries' path). - installed connector settings -> local modules.
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
Post a Comment