Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 21, 2025

There are instances where an email notification may not have an associated author. In the mail notification template, we forgot to check that the author exists before calling the _is_internal on it. When the author is False, the function generating the mail crashes as the _is_internal function is undefined on a boolean variable.

To address this issue, we will ensure the existence of the author before invoking any methods defined in the res.users model. This solution prevents errors and ensures the email template functions correctly.

see: #190390

Task-4128966


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #194569

There are instances where an email notification may not have an associated
author. In the mail notification template, we forgot to check that the
author exists before calling the `_is_internal` on it. When the author is
`False`, the function generating the mail crashes as the `_is_internal`
function is undefined on a boolean variable.

To address this issue, we will ensure the existence of the author before
invoking any methods defined in the `res.users` model. This solution
prevents errors and ensures the email template functions correctly.

see: odoo/odoo/odoo#190390

Task-4128966

X-original-commit: 954d710
@robodoo
Copy link
Contributor

robodoo commented Jan 21, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 21, 2025

@julien-banken @tde-banana-odoo cherrypicking of pull request #194569 failed.

stdout:

Auto-merging addons/mail/data/mail_templates_email_layouts.xml
CONFLICT (content): Merge conflict in addons/mail/data/mail_templates_email_layouts.xml

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Jan 21, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Jan 21, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 25, 2025

@julien-banken @tde-banana-odoo this forward port of #194569 is awaiting action (not merged or closed).

2 similar comments
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 26, 2025

@julien-banken @tde-banana-odoo this forward port of #194569 is awaiting action (not merged or closed).

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 27, 2025

@julien-banken @tde-banana-odoo this forward port of #194569 is awaiting action (not merged or closed).

@julien-banken
Copy link
Contributor

Note: Fixed in the original PR FW #194439

@xmo-odoo xmo-odoo deleted the saas-18.1-18.0-mail-fix-error-when-sending-mail-notifications-with-no-author-jbn-Aw9y-fw branch March 7, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants