Revert "[FIX] crm, sale_crm, sales_team, website_crm_partner_assign: change context key"
This commit is not retro-compatible with existing database. Moreover, the underlying issue (opw-757039) has been fixed via commitbaca743cc0. This reverts commit8510c0ce37.
This commit is contained in:
@@ -278,8 +278,8 @@ class Lead(models.Model):
|
||||
# set up context used to find the lead's sales channel which is needed
|
||||
# to correctly set the default stage_id
|
||||
context = dict(self._context or {})
|
||||
if vals.get('type') and not self._context.get('default_crm_lead_type'):
|
||||
context['default_crm_lead_type'] = vals.get('type')
|
||||
if vals.get('type') and not self._context.get('default_type'):
|
||||
context['default_type'] = vals.get('type')
|
||||
if vals.get('team_id') and not self._context.get('default_team_id'):
|
||||
context['default_team_id'] = vals.get('team_id')
|
||||
|
||||
@@ -314,7 +314,7 @@ class Lead(models.Model):
|
||||
self.ensure_one()
|
||||
# set default value in context, if not already set (Put stage to 'new' stage)
|
||||
context = dict(self._context)
|
||||
context.setdefault('default_crm_lead_type', self.type)
|
||||
context.setdefault('default_type', self.type)
|
||||
context.setdefault('default_team_id', self.team_id.id)
|
||||
# Set date_open to today if it is an opp
|
||||
default = default or {}
|
||||
@@ -822,7 +822,7 @@ class Lead(models.Model):
|
||||
(False, 'graph')
|
||||
],
|
||||
'type': 'ir.actions.act_window',
|
||||
'context': {'default_crm_lead_type': 'opportunity'}
|
||||
'context': {'default_type': 'opportunity'}
|
||||
}
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -702,7 +702,7 @@ if record:
|
||||
<field name="view_id" ref="crm_case_tree_view_leads"/>
|
||||
<field name="search_view_id" ref="crm.view_crm_case_leads_filter"/>
|
||||
<field name="context">{
|
||||
'default_crm_lead_type':'lead',
|
||||
'default_type':'lead',
|
||||
'search_default_type': 'lead',
|
||||
'needaction_menu_ref': 'crm.menu_crm_opportunities',
|
||||
'search_default_to_process':1,
|
||||
@@ -736,7 +736,7 @@ if record:
|
||||
<field name="view_mode">kanban,tree,graph,pivot,form,calendar</field>
|
||||
<field name="domain">[('type','=','opportunity')]</field>
|
||||
<field name="context">{
|
||||
'default_crm_lead_type': 'opportunity',
|
||||
'default_type': 'opportunity',
|
||||
'default_user_id': uid
|
||||
}
|
||||
</field>
|
||||
@@ -787,7 +787,7 @@ if record:
|
||||
<field name="view_mode">kanban,tree,graph,pivot,form,calendar</field>
|
||||
<field name="domain">[('type','=','opportunity')]</field>
|
||||
<field name="context">{
|
||||
'default_crm_lead_type': 'opportunity',
|
||||
'default_type': 'opportunity',
|
||||
'default_user_id': uid,
|
||||
'search_default_assigned_to_me': 1,
|
||||
}</field>
|
||||
@@ -832,7 +832,7 @@ if record:
|
||||
(0, 0, {'view_mode': 'kanban'}), (0, 0, {'view_mode': 'calendar'}), (0, 0, {'view_mode': 'pivot'}), (0, 0, {'view_mode': 'graph'})]"/>
|
||||
<field name="domain">[('type','=','opportunity'), ('activity_date_deadline', '!=', False)]</field>
|
||||
<field name="context">{
|
||||
'default_crm_lead_type': 'opportunity',
|
||||
'default_type': 'opportunity',
|
||||
'default_user_id': uid,
|
||||
'search_default_assigned_to_me': 1
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="context">{
|
||||
'search_default_team_id': [active_id],
|
||||
'default_team_id': active_id,
|
||||
'default_crm_lead_type': 'lead',
|
||||
'default_type': 'lead',
|
||||
}
|
||||
</field>
|
||||
<field name="help" type="html">
|
||||
@@ -39,7 +39,7 @@
|
||||
<field name="context">{
|
||||
'search_default_team_id': [active_id],
|
||||
'default_team_id': active_id,
|
||||
'default_crm_lead_type': 'opportunity',
|
||||
'default_type': 'opportunity',
|
||||
'default_user_id': uid,
|
||||
}
|
||||
</field>
|
||||
@@ -151,7 +151,7 @@
|
||||
<field name="context">{
|
||||
'search_default_team_id': [active_id],
|
||||
'default_team_id': active_id,
|
||||
'default_crm_lead_type': 'opportunity',
|
||||
'default_type': 'opportunity',
|
||||
'default_user_id': uid,
|
||||
}
|
||||
</field>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="domain">[('type','=','opportunity')]</field>
|
||||
<field name="context">{
|
||||
'search_default_partner_id': active_id,
|
||||
'default_crm_lead_type': 'opportunity'
|
||||
'default_type': 'opportunity'
|
||||
}</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<!-- add needaction_menu_ref to reload quotation needaction when opportunity needaction is reloaded -->
|
||||
<record id="crm.crm_lead_opportunities" model="ir.actions.act_window">
|
||||
<field name="context">{'default_crm_lead_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'}</field>
|
||||
<field name="context">{'default_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'}</field>
|
||||
</record>
|
||||
|
||||
<record id="sales_team.mail_activity_type_action_config_sales" model="ir.actions.act_window">
|
||||
|
||||
@@ -33,7 +33,7 @@ class CrmTeam(models.Model):
|
||||
team_id = self.env['crm.team'].browse(self.env.context.get('default_team_id'))
|
||||
if not team_id:
|
||||
default_team_id = self.env.ref('sales_team.team_sales_department', raise_if_not_found=False)
|
||||
if default_team_id and (self.env.context.get('default_crm_lead_type') != 'lead' or default_team_id.use_leads):
|
||||
if default_team_id and (self.env.context.get('default_type') != 'lead' or default_team_id.use_leads):
|
||||
team_id = default_team_id
|
||||
return team_id
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<field name="name">Opp. Assignment Analysis</field>
|
||||
<field name="res_model">crm.lead.report.assign</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{'default_crm_lead_type': 'opportunity', 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{'default_type': 'opportunity', 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="view_mode">pivot,graph</field>
|
||||
<field name="domain">[('type', '=', 'opportunity')]</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user