[FIX] On cchange for sales person to change sales team in opportunity
bzr revid: jco@openerp.com-20130404155437-a4d6mdi2y0r5nvc6
This commit is contained in:
parent
665cd6c6ea
commit
5585f21aa5
|
@ -356,6 +356,13 @@ class crm_lead(base_stage, format_address, osv.osv):
|
|||
}
|
||||
return {'value' : values}
|
||||
|
||||
def on_change_user(self, cr, uid, ids, user_id, context=None):
|
||||
if user_id:
|
||||
user = self.pool.get('res.users').browse(cr, uid, user_id, context=context)
|
||||
return {'value':{'section_id': user.default_section_id and user.default_section_id.id or False}}
|
||||
else:
|
||||
return {'value':{'section_id':False}}
|
||||
|
||||
def _check(self, cr, uid, ids=False, context=None):
|
||||
""" Override of the base.stage method.
|
||||
Function called by the scheduler to process cases for date actions
|
||||
|
|
|
@ -427,7 +427,7 @@
|
|||
</group>
|
||||
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="user_id" on_change="on_change_user(user_id)"/>
|
||||
<label for="section_id"/>
|
||||
<div>
|
||||
<field name="section_id" widget="selection"/>
|
||||
|
|
Loading…
Reference in New Issue