[IMP]CRM Action default type : use first priority item

This commit is contained in:
Fabien BOURGEOIS 2017-10-29 09:15:02 +01:00
parent f1388adcc5
commit 7904c0f996
1 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,8 @@ class CrmAction(models.Model):
default=lambda self: self.env.user)
lead_id = fields.Many2one('crm.lead', string='Lead', ondelete='cascade')
event_id = fields.Many2one('calendar.event', 'Calendar event', ondelete='cascade')
action_type_id = fields.Many2one('crm.action.type', string='Type', required=True)
action_type_id = fields.Many2one('crm.action.type', string='Type', required=True,
default=lambda self: self.env['crm.action.type'].search([], limit=1))
action_type_name = fields.Char(related='action_type_id.name')
@api.onchange('lead_id')