[IMP] crm_lead: on_change_user don't change section_id if they is a default_section_id context value
bzr revid: chm@openerp.com-20130521122242-53eu1fi506465o6c
This commit is contained in:
parent
7e901f89ba
commit
c810905bdf
|
@ -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]
|
||||
|
|
|
@ -152,7 +152,8 @@
|
|||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="context">{
|
||||
'search_default_section_id': [active_id],
|
||||
'default_section_id': active_id, 'show_address': 1,
|
||||
'default_section_id': active_id,
|
||||
'show_address': 1,
|
||||
}
|
||||
</field>
|
||||
<field name="domain">[('state','in',('draft','sent','cancel'))]</field>
|
||||
|
@ -183,7 +184,7 @@
|
|||
('type', '=', 'out_invoice')]</field>
|
||||
<field name="context">{
|
||||
'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',
|
||||
|
|
Loading…
Reference in New Issue