File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -349,9 +349,9 @@ def _message_post_on_failure(self):
349349 # subscribe the users now to avoid to subscribe them
350350 # at every job creation
351351 domain = self ._subscribe_users_domain ()
352- base_users = self .env ["res.users" ].search (domain )
352+ manager_group_users = self .env ["res.users" ].search (domain )
353353 for record in self :
354- users = base_users | record .user_id
354+ users = record ._get_users_to_notify_on_failure ( manager_group_users )
355355 record .message_subscribe (partner_ids = users .mapped ("partner_id" ).ids )
356356 msg = record ._message_failed_job ()
357357 if msg :
@@ -368,6 +368,10 @@ def _subscribe_users_domain(self):
368368 domain .append (("company_id" , "in" , companies .ids ))
369369 return domain
370370
371+ def _get_users_to_notify_on_failure (self , base_users ):
372+ self .ensure_one ()
373+ return base_users | self .user_id
374+
371375 def _message_failed_job (self ):
372376 """Return a message which will be posted on the job when it is failed.
373377
You can’t perform that action at this time.
0 commit comments