Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] crm: check if email_from is defined #1234

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

remi-filament
Copy link

Description of the issue/feature this PR addresses:
Facing a special case with both CRM and mail_tracking (from OCA social repo) installed.
When an opportunity or a lead was created from an incoming e-mail and then you remove the email_from on opportunity/lead (for instance because you have forwarded an email to Odoo to create opportunity but you do not want to keep your own email address as email_from for the lead), you get an error that boolean does not have lower() method.
This issue has been introduced with odoo@9ef715f part of odoo#74474

Since mail_tracking is trying to suggest extra emails, you get all message_ids.email_to as emails parameter when calling _message_partner_info_from_emails(emails) which it tries to compare with crm_lead.email_from

This PR fixes this issue by checking that email and self.email_from exist before trying to lower() them (as it was done before the above commit)

Current behavior before PR:
Stack trace when accessing lead / opportunity created from incoming e-mail where email_from has been emptied.

Desired behavior after PR is merged:
No more error, working correctly


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


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

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.

4 participants