[IMP] Improved code
bzr revid: ggh@tinyerp.com-20130517045859-jnciw2w13z3u1eka
This commit is contained in:
parent
7d276f0153
commit
70f20e30d4
|
@ -85,10 +85,10 @@ class sale_order_line(osv.osv):
|
|||
'origin': order_line.order_id.name,
|
||||
'event_id': order_line.event_id.id,
|
||||
}
|
||||
message = _("The registration has been <b>created</b> for event <i>%s</i> from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name)
|
||||
context.update({'mail_create_nolog': True, 'sale_event': True, 'message': message })
|
||||
message = _("The registration has been created for event <i>%s</i> from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name)
|
||||
context.update({'mail_create_nolog': True, 'message': message })
|
||||
registration_id = registration_obj.create(cr, uid, dic, context=context)
|
||||
registration_obj.message_post(cr, uid, registration_id, body=message, context=context)
|
||||
registration_obj.message_post(cr, uid, [registration_id], body=message, context=context)
|
||||
return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context)
|
||||
|
||||
sale_order_line()
|
||||
|
@ -97,7 +97,7 @@ class event_registration(osv.osv):
|
|||
_inherit = 'event.registration'
|
||||
|
||||
def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, content_subtype='html', **kwargs):
|
||||
""" Overrides mail_thread message_post so that we can set the message note when
|
||||
a new registration create on the event sale.
|
||||
"""
|
||||
return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs)
|
||||
""" Overrides mail_thread message_post so that we can set the message note when
|
||||
a new registration create on the event sale.
|
||||
"""
|
||||
return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue