bzr revid: rha@tinyerp.com-20110504124349-o35a7dyqukxai57t
This commit is contained in:
Rifakat Haradwala (Open ERP)
2011-05-04 18:13:49 +05:30
3 changed files with 12 additions and 11 deletions
+7 -6
View File
@@ -197,21 +197,22 @@
<group col="4" colspan="4">
<field name="email_from"/>
<field name="date"/>
<field name="email_to" widget="char" size="512"/>
<field name="email_cc" widget="char" size="512"/>
<field name="subject" colspan="4" widget="char" size="512"/>
<field name="email_to" size="512"/>
<field name="email_cc" size="512"/>
<field name="subject" colspan="4" widget="char" attrs="{'invisible': [('history', '=', False)]}" size="512"/>
<field name="display_text" colspan="4" attrs="{'invisible': [('history', '=', True)]}"/>
<field name="history" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Details">
<field name="body" colspan="4" nolabel="1"/>
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="body" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(mail.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'message_id':active_id}"
context="{'mail':'reply'}"
icon="terp-mail-replied" type="action"/>
</group>
</group>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
+4 -4
View File
@@ -65,8 +65,8 @@ class crm_lead2opportunity_partner(osv.osv_memory):
ids = lead_obj.search(cr, uid, [('partner_id', '=', partner_id), ('type', '=', 'opportunity'), '!', ('state', 'in', ['done', 'cancel'])])
if ids:
opportunities.append(ids[0])
if not partner_id:
label = False
opp_ids = []
@@ -105,7 +105,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context):
if lead.state in ['done', 'cancel']:
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled Leads Could not convert into Opportunity"))
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled Leads can not be converted into Opportunity"))
return False
def _convert(self, cr, uid, ids, lead, partner_id, stage_ids, context=None):
@@ -146,7 +146,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
return False
message_pool = self.pool.get('email.message')
email_from = lead.section_id and lead.section_id.user_id and lead.section_id.user_id.user_email or email_to
partner = lead.partner_id and lead.partner_id.name or lead.partner_name
partner = lead.partner_id and lead.partner_id.name or lead.partner_name
subject = "lead %s converted into opportunity" % lead.name
body = "Info \n Id : %s \n Subject: %s \n Partner: %s \n Description : %s " % (lead.id, lead.name, lead.partner_id.name, lead.description)
return message_pool.schedule_with_attach(cr, uid, email_from, [email_to], subject, body)
+1 -1
View File
@@ -185,7 +185,7 @@ class email_compose_message(osv.osv_memory):
'object' : self.pool.get(model).browse(cr, uid, resource_id),
})
if result in (None, False):
return str("--------")
return str("")
return tools.ustr(result)
com = re.compile('(\$\{.+?\})')