Skip to content

[IMP] queue_job_cron - allow commit within a cron that runs as queue job - #959

Open
baimont wants to merge 1 commit into
OCA:18.0from
acsone:bai_allow_commit_queue_job_cron
Open

baimont wants to merge 1 commit into
OCA:18.0from
acsone:bai_allow_commit_queue_job_cron

Conversation

@baimont

@baimont baimont commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Related to #899

Works as the new option on the job function but on the cron, false by default, allow to run the job in a new transaction

@baimont
baimont force-pushed the bai_allow_commit_queue_job_cron branch from cceac53 to 2c31cdb Compare August 14, 2026 10:05
@baimont

baimont commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

take a look, @sbidoul ?

Comment on lines +61 to +63
new_env = self.env(cr=new_cr)
server_action.with_env(new_env).run()
return True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
new_env = self.env(cr=new_cr)
server_action.with_env(new_env).run()
return True
return server_action.with_env(self.env(cr=new_cr)
).run()

@sbidoul sbidoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't why the return is there but let's return the same thing in both cases.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants