[FIX] base_action_rule: Add followers in automated actions
When registering a payment on an account invoice with an automated action which adds a follower "On Creation & Update", the function recompute was triggered(due to the field residual_company_signed) and the same followers was added two times for the invoice. The fix avoid to unlink and create the same followers several times(because it was the case with the function "_add_follower_command") opw:690939
This commit is contained in:
@@ -194,7 +194,11 @@ class base_action_rule(osv.osv):
|
||||
|
||||
# subscribe followers
|
||||
if self.act_followers and hasattr(records, 'message_subscribe'):
|
||||
records.message_subscribe(self.act_followers.ids)
|
||||
followers = self.env['mail.followers'].sudo().search([
|
||||
('res_model', '=', records._name), ('res_id', 'in', records.ids),
|
||||
('partner_id', 'in', self.act_followers.ids)])
|
||||
if not len(followers) == len(self.act_followers):
|
||||
records.message_subscribe(self.act_followers.ids)
|
||||
|
||||
# execute server actions
|
||||
if self.server_action_ids:
|
||||
|
||||
Reference in New Issue
Block a user