From 59a0283a90699efa1bfa92e79d99aa6949034cdb Mon Sep 17 00:00:00 2001 From: jbeficent Date: Mon, 5 Sep 2016 10:05:27 +0200 Subject: [PATCH] [FIX] returns the default team as a browsed record instead of the internal id. Otherwise error occurs as "AttributeError: 'int' object has no attribute 'id'" --- crm_phone/crm_phone.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crm_phone/crm_phone.py b/crm_phone/crm_phone.py index 599c563..560a3a8 100644 --- a/crm_phone/crm_phone.py +++ b/crm_phone/crm_phone.py @@ -71,7 +71,8 @@ class CrmPhonecall(models.Model): default=lambda self: self.env.user) team_id = fields.Many2one( 'crm.team', string='Sales Team', track_visibility='onchange', - default=lambda self: self.env['crm.team']._get_default_team_id()) + default=lambda self: self.env['crm.team'].browse( + self.env['crm.team']._get_default_team_id())) partner_id = fields.Many2one( 'res.partner', string='Contact', ondelete='cascade') partner_phone = Phone(string='Phone', partner_field='partner_id')