diff --git a/yaltik_crm_action/models/crm_action.py b/yaltik_crm_action/models/crm_action.py index 244c5eb..bcc9c70 100644 --- a/yaltik_crm_action/models/crm_action.py +++ b/yaltik_crm_action/models/crm_action.py @@ -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')