[IMP]CRM Action : now set lead to False if partner has changed
This commit is contained in:
parent
98a83a2f6c
commit
f872725ccd
@ -56,6 +56,15 @@ class CrmAction(models.Model):
|
|||||||
if action.lead_id and action.lead_id.partner_id:
|
if action.lead_id and action.lead_id.partner_id:
|
||||||
action.partner_id = action.lead_id.partner_id
|
action.partner_id = action.lead_id.partner_id
|
||||||
|
|
||||||
|
@api.onchange('partner_id')
|
||||||
|
def onchange_partner(self):
|
||||||
|
""" If partner changes, adapts lead to False """
|
||||||
|
for action in self:
|
||||||
|
if action.partner_id and action.lead_id:
|
||||||
|
if action.lead_id.partner_id != action.partner_id:
|
||||||
|
action.lead_id = False
|
||||||
|
|
||||||
|
|
||||||
@api.depends('action_type_id.name', 'details')
|
@api.depends('action_type_id.name', 'details')
|
||||||
def _compute_display_name(self):
|
def _compute_display_name(self):
|
||||||
for action in self:
|
for action in self:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user