[IMP]: crm: If we manually assign a partner in the geo assign tab, it should update the "assignation date" automatically
bzr revid: rpa@tinyerp.com-20100719103304-rb8j490srt9xc611
This commit is contained in:
@@ -150,6 +150,19 @@ class crm_opportunity(osv.osv):
|
||||
return {'value':{}}
|
||||
return {'value':{'probability': stage.probability}}
|
||||
|
||||
def onchange_assign_id(self, cr, uid, ids, partner_assigned_id, context={}):
|
||||
"""This function updates the "assignation date" automatically, when manually assign a partner in the geo assign tab
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of stage’s IDs
|
||||
@stage_id: change state id on run time """
|
||||
|
||||
if not partner_assigned_id:
|
||||
return {'value':{'date_assign': False}}
|
||||
else:
|
||||
return {'value':{'date_assign': time.strftime('%Y-%m-%d')}}
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
|
||||
'priority': crm.AVAILABLE_PRIORITIES[2][0],
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
<page string="Assignation" groups="base.group_extended">
|
||||
<group name="partner_assign_group" col="5" colspan="4">
|
||||
<separator string="Partner Assignation" colspan="5"/>
|
||||
<field name="partner_assigned_id"/>
|
||||
<field name="partner_assigned_id" on_change="onchange_assign_id(partner_assigned_id)"/>
|
||||
<field name="date_assign"/>
|
||||
<group colspan="1" col="1">
|
||||
<button string="Forward"
|
||||
|
||||
Reference in New Issue
Block a user