[IMP] notification for creating partner for lead or opportunity.
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Wed, 7 Mar 2012 12:16:34 +0000 (17:46 +0530)
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>
Wed, 7 Mar 2012 12:16:34 +0000 (17:46 +0530)
bzr revid: bth@tinyerp.com-20120307121634-m6nyj3i68pgzb3t9

addons/crm/crm_lead.py
addons/crm/crm_lead_view.xml
addons/crm/crm_meeting_view.xml
addons/crm/crm_phonecall_view.xml

index a5c3792..46174c6 100644 (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):
index 185f9f5..d27b247 100644 (file)
                     </group>
                  </page>
                 </notebook>
-                <field name="message_ids_social" widget="ThreadView"/>
+                <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
             </form>
         </field>
     </record>
                     <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>
index cd0b624..353a2ea 100644 (file)
 
                     </page>
                 </notebook>
-                <field name="message_ids_social" widget="ThreadView"/>
+                <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
             </form>
         </field>
     </record>
index 6bebccd..d00c41b 100644 (file)
                         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>