[IMP] notification for creating partner for lead or opportunity.

bzr revid: bth@tinyerp.com-20120307121634-m6nyj3i68pgzb3t9
This commit is contained in:
Bhumi Thakkar (Open ERP)
2012-03-07 17:46:34 +05:30
parent 18c91886e4
commit a84575e440
4 changed files with 12 additions and 5 deletions
+8 -1
View File
@@ -350,6 +350,13 @@ class crm_lead(crm_case, osv.osv):
message = _("<b>%s a call</b>.") % (action)
case.message_append_note('', message)
def _case_partner_notification(self, lead, context=None):
if lead.type == 'lead':
message = _("Partner is <b>created</b> for this lead.")
elif lead.type == 'opportunity':
message = _("Partner is <b>created</b> for this opportunity.")
lead.message_append_note('' ,message)
def case_open(self, cr, uid, ids, context=None):
res = super(crm_lead, self).case_open(cr, uid, ids, context)
for lead in self.browse(cr, uid, ids, context=context):
@@ -663,7 +670,7 @@ class crm_lead(crm_case, osv.osv):
res_partner.write(cr, uid, partner_id, {'section_id': lead.section_id.id or False})
contact_id = res_partner.address_get(cr, uid, [partner_id])['default']
res = lead.write({'partner_id' : partner_id, 'partner_address_id': contact_id}, context=context)
self._case_partner_notification(lead,context)
return res
def _lead_create_partner_address(self, cr, uid, lead, partner_id, context=None):
+2 -2
View File
@@ -168,7 +168,7 @@
</group>
</page>
</notebook>
<field name="message_ids_social" widget="ThreadView"/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>
@@ -537,7 +537,7 @@
<field name="ref2"/>
</page>
</notebook>
<field name="message_ids_social" widget="ThreadView"/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>
+1 -1
View File
@@ -216,7 +216,7 @@
</page>
</notebook>
<field name="message_ids_social" widget="ThreadView"/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>
+1 -1
View File
@@ -123,7 +123,7 @@
states="cancel" type="object"
icon="gtk-convert" />
</group>
<field name="message_ids_social" widget="ThreadView"/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>