[IMP] crm_lead : Added on change for the optin, optout as per suggetion of tfr

bzr revid: jam@tinyerp.com-20110218114032-hzxzmtfmf23ebkx7
This commit is contained in:
Jigar Amin 2011-02-18 17:10:32 +05:30
parent 50a014aecd
commit 553de27d2a
2 changed files with 13 additions and 2 deletions

View File

@ -412,6 +412,17 @@ class crm_lead(crm_case, osv.osv):
@param **args: Return Dictionary of Keyword Value
"""
return True
def on_chnage_optin(self, cr, uid, ids, optin):
if optin:
return {'value':{'optin':optin,'optout':False}}
return {}
def on_chnage_optout(self, cr, uid, ids, optout):
if optout:
return {'value':{'optout':optout,'optin':False}}
return {}
crm_lead()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -151,8 +151,8 @@
</group>
<group colspan="2" col="2">
<separator string="Mailings" colspan="2" col="2"/>
<field name="optin" attrs="{'readonly':[('optout','=',True)]}"/>
<field name="optout" attrs="{'readonly':[('optin','=',True)]}"/>
<field name="optin" on_change="on_chnage_optin(optin)"/>
<field name="optout" on_change="on_chnage_optout(optout)"/>
</group>
<group colspan="2" col="2">
<separator string="Statistics" colspan="2" col="2"/>