Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I want to send a message to the salesperson assigned to an Account when that account is edited by another user. How to I tie into the ORM to trigger my function on object save? The closest I have gotten is the on_change method on specific fields; I don't want to add this per field.
You can override the write() method of the desired object (e.g.
def write(self, cr, uid, ids, vals, context=None): my_custom_send_mail_function() res = super(my_class, self).write(cr, uid, ids, vals, context=context) return res
But this is a very deep intrusion into the system and may have side effects.
Mabye you can also use
Automated Actions for this purpose. See menu "Settings / Technical / Automated Actions".
The solution I found is overwriting the object in questions write() function. I was hoping there was a flag or setting instead, but this does the trick too.
def write(self, cr, uid, ids, vals, context=None): # Function calls and such here return super(sale_order, self).write(cr, uid, ids, vals, context=context)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/12/13, 12:36 PM|
|Seen: 8891 times|
|Last updated: 3/16/15, 8:10 AM|