Skip to content

Conversation

@GuillemCForgeFlow
Copy link

@GuillemCForgeFlow GuillemCForgeFlow commented Jan 2, 2026

We add the _subscribe_job_creator method in queue.job which will return True for the cases where we want to subscribe the job creator, False otherwise.

cc @ForgeFlow

@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@GuillemCForgeFlow GuillemCForgeFlow force-pushed the 17.0-imp-queue_job-hook_users_notify branch from 53b1975 to f35df77 Compare January 2, 2026 11:08
@GuillemCForgeFlow
Copy link
Author

hi @guewen, any chance you see this a good improvement to the module?
thank you in advance 🙂

@sbidoul sbidoul added this to the 17.0 milestone Jan 2, 2026
@sbidoul
Copy link
Member

sbidoul commented Jan 2, 2026

@GuillemCForgeFlow why is it not sufficient for you to override _subscribe_users_domain ?

@GuillemCForgeFlow
Copy link
Author

@GuillemCForgeFlow why is it not sufficient for you to override _subscribe_users_domain ?

@sbidoul, the problem is that the user assigned to the job will always be added anyway: https://github.com/OCA/queue/blob/17.0/queue_job/models/queue_job.py#L359. There may be cases for which we don't want that to happen.
I was also thinking about solving with queue_job_subscribe but thought this would be best. Any ideas on how to solve alternatively are welcomed 🙂

@sbidoul
Copy link
Member

sbidoul commented Jan 5, 2026

the problem is that the user assigned to the job will always be added anyway

Ah yes.

How about this?

def _subscribe_job_creator(self) -> bool
    """Whether the user that created the job should be subscribed to the job, in addition to users determined by `_subscribe_users_domain`"""

…ethod

We add the `_subscribe_job_creator` method in `queue.job` which will return True for the cases where we want to subscribe the job creator, False otherwise.
@GuillemCForgeFlow GuillemCForgeFlow force-pushed the 17.0-imp-queue_job-hook_users_notify branch from f35df77 to 5487166 Compare January 7, 2026 06:32
@GuillemCForgeFlow GuillemCForgeFlow changed the title [17.0][IMP]queue_job: hook for users to notify on job failure [17.0][IMP]queue_job: only subscribe job creator if indicated via boolean method Jan 7, 2026
@GuillemCForgeFlow
Copy link
Author

@sbidoul changes applied, thank you for the feedback 🙂 👍🏿

@GuillemCForgeFlow
Copy link
Author

hi @guewen, I'd appreciate it if you have the time to review this small improvement 🙂

Copy link
Member

@guewen guewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@GuillemCForgeFlow
Copy link
Author

@sbidoul perhaps we can get this merged? I'll take care of the fws 👌🏿

@sbidoul
Copy link
Member

sbidoul commented Jan 13, 2026

/ocabot merge patch

Thanks!

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-865-by-sbidoul-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit a8f2a04 into OCA:17.0 Jan 13, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 1acf4c1. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants