diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 61e8c75cea8..ee008c1eed3 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -366,8 +366,8 @@ class crm_lead(base_stage, format_address, osv.osv):
def on_change_user(self, cr, uid, ids, user_id, context=None):
""" When changing the user, also set a section_id or restrict section id
to the ones user_id is member of. """
- section_id = False
- if user_id:
+ section_id = self._get_default_section_id(cr, uid, context=context) or False
+ if user_id and not section_id:
section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context)
if section_ids:
section_id = section_ids[0]
diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml
index a1758efe03d..3753bdff8e6 100644
--- a/addons/sale_crm/sale_crm_view.xml
+++ b/addons/sale_crm/sale_crm_view.xml
@@ -152,7 +152,8 @@
tree,form,calendar,graph
{
'search_default_section_id': [active_id],
- 'default_section_id': active_id, 'show_address': 1,
+ 'default_section_id': active_id,
+ 'show_address': 1,
}
[('state','in',('draft','sent','cancel'))]
@@ -183,7 +184,7 @@
('type', '=', 'out_invoice')]
{
'search_default_section_id': [active_id],
- 'default_section_id': active_id},
+ 'default_section_id': active_id,
'default_type':'out_invoice',
'type':'out_invoice',
'journal_type': 'sale',