diff --git a/addons/crm/data/base_action_rule_demo.xml b/addons/crm/data/base_action_rule_demo.xml
index de11414c4ba..a18603a34b1 100644
--- a/addons/crm/data/base_action_rule_demo.xml
+++ b/addons/crm/data/base_action_rule_demo.xml
@@ -41,9 +41,7 @@
True
ir.actions.server
code
- sales_team = self.pool.get('ir.model.data').get_object(cr, uid, 'sales_team', 'team_sales_department')
-object.write({'team_id': sales_team.id})
-
+ object.write({'team_id': env.ref('sales_team.team_sales_department').id})
Set Auto Followers on leads which are urgent and come from USA.
diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml
index 295f08ff0ae..c70de8e3172 100644
--- a/addons/crm/views/crm_lead_views.xml
+++ b/addons/crm/views/crm_lead_views.xml
@@ -672,8 +672,8 @@
code
- if context.get('active_model') == 'crm.lead' and context.get('active_ids'):
- self.action_set_lost(cr, uid, context['active_ids'], context=context)
+ if env.context.get('active_model') == 'crm.lead' and env.context.get('active_ids'):
+ env['crm.lead'].browse(context['active_ids']).action_set_lost()
@@ -778,7 +778,7 @@
My Pipeline
code
- action = self.action_your_pipeline(cr, uid, context=context)
+ action = env['crm.team'].action_your_pipeline()