[Fix] crm: Fix the section_id problem in phonecall_to_opportunity and improve the view
bzr revid: sbh@tinyerp.com-20100310112936-ucnz9kfgcjfx4fty
This commit is contained in:
@@ -72,8 +72,8 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
new_case = phonecall_case_obj.create(cr, uid, {
|
||||
'name' : opportunity.name,
|
||||
'case_id' : opportunity.id ,
|
||||
'user_id' : this.user_id and this.user_id.id or Flase,
|
||||
'categ_id' : opportunity.categ_id and opportunity.categ_id.id or Flase,
|
||||
'user_id' : this.user_id and this.user_id.id or False,
|
||||
'categ_id' : opportunity.categ_id and opportunity.categ_id.id or False,
|
||||
'description' : opportunity.description or False,
|
||||
'date' : this.date,
|
||||
'section_id' : opportunity.section_id and opportunity.section_id.id or False,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<field name="section_id"/>
|
||||
<label string ="" colspan="2"/>
|
||||
<button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
|
||||
<button name="action_apply" type="object" string="_Apply" icon="gtk-apply" />
|
||||
<button name="action_apply" type="object" string="Schedule Other Call" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -58,17 +58,19 @@ class crm_phonecall2opportunity(osv.osv_memory):
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
opportunity_case_obj = self.pool.get('crm.opportunity')
|
||||
phonecall_case_obj = self.pool.get('crm.phonecall')
|
||||
new_opportunity_id = opportunity_case_obj.create(cr, uid, {
|
||||
'name': this.name,
|
||||
'planned_revenue': this.planned_revenue,
|
||||
'probability': this.probability,
|
||||
'partner_id': this.partner_id.id,
|
||||
'section_id': case.section_id.id,
|
||||
'description': case.description,
|
||||
'phonecall_id': case.id,
|
||||
'priority': case.priority,
|
||||
'phone': case.partner_phone,
|
||||
})
|
||||
for phonecall in phonecall_case_obj.browse(cr, uid, record_id):
|
||||
new_opportunity_id = opportunity_case_obj.create(cr, uid, {
|
||||
'name': this.name,
|
||||
'case'
|
||||
'planned_revenue': this.planned_revenue,
|
||||
'probability': this.probability,
|
||||
'partner_id': this.partner_id and this.partner_id.id or False,
|
||||
'section_id': phonecall.section_id and phonecall.section_id.id or False,
|
||||
'description': phonecall.description or False,
|
||||
'phonecall_id': phonecall.id,
|
||||
'priority': phonecall.priority,
|
||||
'phone': phonecall.partner_phone or False,
|
||||
})
|
||||
new_opportunity = opportunity_case_obj.browse(cr, uid, new_opportunity_id)
|
||||
vals = {
|
||||
'partner_id': this.partner_id.id,
|
||||
|
||||
Reference in New Issue
Block a user