Skip to content

[19.0][FIX] report_async: invalidate ORM cache after raw SQL update - #1189

Open
samirGuesmi wants to merge 1 commit into
OCA:19.0from
acsone:fix-report_async-sgu
Open

[19.0][FIX] report_async: invalidate ORM cache after raw SQL update#1189
samirGuesmi wants to merge 1 commit into
OCA:19.0from
acsone:fix-report_async-sgu

Conversation

@samirGuesmi

Copy link
Copy Markdown
Member

After creating the attachment with SUPERUSER_ID, run_report updates create_uid/write_uid via a raw SQL execute().
The ORM cache is not invalidated, so when _send_email() renders the template the attachment.create_uid still holds SUPERUSER_ID (OdooBot) instead of the actual user, producing "Dear OdooBot" in the notification email.

This small fix will add attachment.invalidate_recordset(["create_uid", "write_uid"]) just after the cr.execute() block so the template reads the correct value.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@petrus-v petrus-v left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this fix !

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