[IMP] crm : remove the phonecall id form opportunity

bzr revid: sbh@tinyerp.com-20100129093629-j7screp8qv1bdof5
This commit is contained in:
sbh (Open ERP) 2010-01-29 15:06:29 +05:30
parent 98942e9862
commit 6fbf8b108b
3 changed files with 5 additions and 7 deletions

View File

@ -56,7 +56,6 @@ class crm_opportunity(osv.osv):
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'date_closed': fields.datetime('Closed', readonly=True),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
}
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:

View File

@ -51,9 +51,9 @@
<field name="stage_id" select="1" nolabel="1"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
<field name="date" string="Deadline"/>
<field name="date_deadline" string="Deadline"/>
<group colspan="2">
<field name="phonecall_id" select="1"/>
<field name="date" />
</group>
<button string="Schedule a Phone Call"
name="%(wizard_crm_opportunity_reschedule_phone_call)d" icon="gtk-redo" type="action" attrs="{'invisible':[('phonecall_id','!=',False)]}" />

View File

@ -94,12 +94,11 @@ class opportunity2phonecall(wizard.interface):
'section_id' : form['section_id'],
'partner_id': opportunity.partner_id.id,
'partner_address_id':opportunity.partner_address_id.id,
'description':opportunity.description
'description':opportunity.description,
'opportunity_id':opportunity.id
}, context=context)
vals = {}
if not opportunity.phonecall_id:
vals.update({'phonecall_id' : new_case})
opportunity_case_obj.write(cr, uid, [opportunity.id], vals)
opportunity_case_obj.case_cancel(cr, uid, [opportunity.id])
phonecall_case_obj.case_open(cr, uid, [new_case])