message = _("%s a call for %s.%s") % (prefix, phonecall.date, suffix)
return self.message_post(cr, uid, ids, body=message, context=context)
+ def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None):
+ if not duration:
+ duration = 'unknow'
+ else:
+ duration = str(duration)+'h'
+ message = _("Meeting: '%s' has been scheduled at '%s' <br> Duration: %s" % (meeting_subject, meeting_date, duration))
+ return self.message_post(cr, uid, ids, body=message, context=context)
+
def onchange_state(self, cr, uid, ids, state_id, context=None):
if state_id:
country_id=self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id
'opportunity_id': fields.many2one ('crm.lead', 'Opportunity', domain="[('type', '=', 'opportunity')]"),
}
+ def create(self, cr, uid, vals, context=None):
+ res = super(crm_meeting,self).create(cr, uid, vals, context=context)
+ obj = self.browse(cr, uid, res, context=context)
+ if obj.opportunity_id:
+ self.pool.get('crm.lead').log_meeting(cr, uid, obj.opportunity_id.id, obj.name, obj.date, obj.duration, context=context)
+ return res
+
class calendar_attendee(osv.osv):
""" Calendar Attendee """