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

T1792 - Desynchronize crm.lead and res_partner email. #1654

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mass_mailing_switzerland/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import res_partner
from . import crm_lead
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
#
##############################################################################

from odoo import models
from odoo import api, models


class Partner(models.Model):
_inherit = "res.partner"
class Lead(models.Model):
_inherit = "crm.lead"

def write(self, vals):
if "email" in vals:
for partner in self:
if not vals["email"] and partner.sudo().mass_mailing_contact_ids:
partner.sudo().mass_mailing_contact_ids.unlink()
return super(Partner, self).write(vals)
def _inverse_email_from(self):
return

@api.depends("partner_id.email")
def _compute_email_from(self):
return

@api.onchange("partner_id")
def onchange_partner_id(self):
self.email_from = self.partner_id.email
Loading