From f64266b67ebba633f3835cf652616a1f24254b62 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 25 Dec 2020 18:24:34 +0530 Subject: [PATCH] add onchange(type) in compute method --- cor_custom/models/crm_lead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cor_custom/models/crm_lead.py b/cor_custom/models/crm_lead.py index 1e925b9..289cb09 100755 --- a/cor_custom/models/crm_lead.py +++ b/cor_custom/models/crm_lead.py @@ -31,8 +31,9 @@ class Lead(models.Model): ('phone_uniq', 'unique(phone)', "Phone No already exists !"), ('email_from_uniq', 'unique(email_from)', "Email ID already exists !"), ] - + @api.onchange('type') def get_admin_login(self): + print('11111111111', self.env.context.get('uid')) group_list = self.env.ref('base.group_erp_manager') if (self.env.context.get('uid') in group_list.users.ids): self.admin_user = True