How can I add followers in created method. Like I have 2 user and in created method I have id of 2 user. So how can I add These two User ID In Message follower ids filde In Sale Order Form
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
This question has been flagged
Hi Atchuthan,
So how can i remove followers in python code? :)
You can either add track_visibility="onchange" to those 2 user_id fields
'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True, track_visibility='onchange'),
Usually this is preferred as Odoo automatically sets the user responsible if the field is changed.
(OR)
def create(self, cr, uid, vals, context=None):
create_id = super(sale_order, self).create(cr, uid, vals, context)
self.message_subscribe_users(cr, uid, [create_id], user_ids=[YOUR LIST OF USER IDS], context=context)
return create_id
It doesn't work Sir.