[Change] getting
bzr revid: jem@openerp.com-20140218083927-d4ixa0cr1yddg8s2
This commit is contained in:
parent
bf60958512
commit
f1e7517ab3
|
@ -5,6 +5,7 @@
|
|||
'sequence': '19',
|
||||
'category': 'Project Management',
|
||||
'complexity': 'easy',
|
||||
'author': 'OpenERP SA',
|
||||
'description':
|
||||
"""
|
||||
CRM Project Issues
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
|
||||
class crm_lead(osv.Model):
|
||||
_inherit = 'crm.lead'
|
||||
|
||||
_columns = {
|
||||
'project_issue_ids': fields.one2many('project.issue', 'lead_id', "Project Issues"),
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="crm_project_issue_lead_form_view">
|
||||
<field name="name">lead.form</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Related Issues">
|
||||
<field name="project_issue_ids" colspan="4" nolabel="1" context="{'default_name': name, 'default_partner_id' : partner_id, 'default_lead_id' : id, 'default_email_from' : email_from, 'default_description' : description}">
|
||||
<tree>
|
||||
<field name="create_date" />
|
||||
<field name="name" />
|
||||
<field name="user_id" />
|
||||
<field name="project_id" />
|
||||
<field name="partner_id" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -9,10 +9,11 @@ class crm_lead_to_project_issue_wizard(osv.TransientModel):
|
|||
wizards = self.browse(cr, uid, ids, context=context)
|
||||
lead_model = self.pool.get("crm.lead")
|
||||
issue_model = self.pool.get("project.issue")
|
||||
lead_id = context.get('active_id',0)
|
||||
|
||||
for wizard in wizards:
|
||||
# get the lead to transform
|
||||
lead = lead_model.browse(cr, uid, wizard.lead_id.id, context=context)
|
||||
lead = lead_model.browse(cr, uid, lead_id, context=context)
|
||||
# create new project.issue
|
||||
vals = {}
|
||||
vals["name"] = lead.name
|
||||
|
@ -22,9 +23,9 @@ class crm_lead_to_project_issue_wizard(osv.TransientModel):
|
|||
vals["project_id"] = wizard.project_id.id
|
||||
issue_id = issue_model.create(cr, uid, vals, context=None)
|
||||
# move the mail thread
|
||||
lead_model.transform_model_messages(cr, uid, wizard.lead_id.id, issue_id, "project.issue", context=context)
|
||||
lead_model.transform_model_messages(cr, uid, lead_id, issue_id, "project.issue", context=context)
|
||||
# delete the lead
|
||||
lead_model.unlink(cr, uid, [wizard.lead_id.id], context=None)
|
||||
lead_model.unlink(cr, uid, [lead_id], context=None)
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<field name="model">crm.lead2projectissue.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Convert to Issue" version="7.0">
|
||||
<field name="lead_id" invisible="True" />
|
||||
<label for="project_id" />
|
||||
<field name="project_id" />
|
||||
<footer>
|
||||
|
@ -35,7 +34,7 @@
|
|||
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='stage_id']" position="before">
|
||||
<button name="%(convert_lead2projectissue_wizard_action)d" string="Convert to Issue" type="action" help="Convert to Issue" context="{'default_lead_id' : id}" />
|
||||
<button name="%(convert_lead2projectissue_wizard_action)d" string="Convert to Issue" type="action" help="Convert to Issue" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue