Skip to content
Snippets Groups Projects
Commit aab90cc5 authored by Xavier Morel's avatar Xavier Morel Committed by Nicolas Martinelli
Browse files

[FIX] crm: recompute mail.alias defaults when *unsetting* use_leads on teams

Default mail.alias for crm.team are currently recomputed/modified
when *setting* use_leads on the team (type changes from opportunity to
leads), but not the other way around (*unsetting* use_leads doesn't
rollback type to opportunity).

Fix this issue.

Leaves over the issue that *disabling* the global setting doesn't
recompute aliases, which it probably should.

OPW-728690
parent 834b38a8
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ class Team(models.Model):
@api.multi
def write(self, vals):
result = super(Team, self).write(vals)
if vals.get('use_leads') or vals.get('alias_defaults'):
if 'use_leads' in vals or 'alias_defaults' in vals:
for team in self:
team.alias_id.write(team.get_alias_values())
return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment