File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -355,8 +355,11 @@ def _message_post_on_failure(self):
355355 # at every job creation
356356 domain = self ._subscribe_users_domain ()
357357 base_users = self .env ["res.users" ].search (domain )
358+ suscribe_job_creator = self ._subscribe_job_creator ()
358359 for record in self :
359- users = base_users | record .user_id
360+ users = base_users
361+ if suscribe_job_creator :
362+ users |= record .user_id
360363 record .message_subscribe (partner_ids = users .mapped ("partner_id" ).ids )
361364 msg = record ._message_failed_job ()
362365 if msg :
@@ -373,6 +376,14 @@ def _subscribe_users_domain(self):
373376 domain .append (("company_id" , "in" , companies .ids ))
374377 return domain
375378
379+ @api .model
380+ def _subscribe_job_creator (self ):
381+ """
382+ Whether the user that created the job should be subscribed to the job,
383+ in addition to users determined by `_subscribe_users_domain`
384+ """
385+ return True
386+
376387 def _message_failed_job (self ):
377388 """Return a message which will be posted on the job when it is failed.
378389
You can’t perform that action at this time.
0 commit comments