[CLEAN] event: cleaned subtypes.
bzr revid: tde@openerp.com-20120919123117-ohey5we13wusgi0g
This commit is contained in:
parent
cd1c44568e
commit
27f2ceecac
|
@ -293,17 +293,17 @@ class event_event(osv.osv):
|
|||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Event has been <b>created</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_new", context=context)
|
||||
return True
|
||||
|
||||
def button_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Event has been <b>cancelled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_cancel", context=context)
|
||||
return True
|
||||
|
||||
def button_draft_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Event has been set to <b>draft</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_new", context=context)
|
||||
return True
|
||||
|
||||
def button_done_send_note(self, cr, uid, ids, context=None):
|
||||
|
@ -313,7 +313,7 @@ class event_event(osv.osv):
|
|||
|
||||
def button_confirm_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Event has been <b>confirmed</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_confirmed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_confirm", context=context)
|
||||
return True
|
||||
|
||||
event_event()
|
||||
|
@ -359,7 +359,7 @@ class event_registration(osv.osv):
|
|||
return self.write(cr, uid, ids, {'state': 'draft'}, context=context)
|
||||
|
||||
def confirm_registration(self, cr, uid, ids, context=None):
|
||||
self.message_post(cr, uid, ids, body=_('State set to open'),subtype_xml_id="registration_subtype_confirmed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to open'),subtype_xml_id="mt_registration_confirm", context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'open'},context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
|
@ -389,13 +389,13 @@ class event_registration(osv.osv):
|
|||
if today >= registration.event_id.date_begin:
|
||||
values = {'state': 'done', 'date_closed': today}
|
||||
self.write(cr, uid, ids, values)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Done'), subtype_xml_id="registration_subtype_closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Done'), context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'),_("You must wait for the starting day of the event to do this action.") )
|
||||
raise osv.except_osv(_('Error!'), _("You must wait for the starting day of the event to do this action."))
|
||||
return True
|
||||
|
||||
def button_reg_cancel(self, cr, uid, ids, context=None, *args):
|
||||
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype_xml_id="registration_subtype_cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype_xml_id="mt_registration_cancel", context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
||||
def mail_user(self, cr, uid, ids, context=None):
|
||||
|
@ -465,12 +465,12 @@ class event_registration(osv.osv):
|
|||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Registration has been <b>created</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
return True
|
||||
|
||||
def do_draft_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Registration has been set as <b>draft</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
return True
|
||||
|
||||
event_registration()
|
||||
|
|
|
@ -11,43 +11,31 @@
|
|||
<field name="action_id" ref="action_client_event_menu"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
<!-- Event subtype -->
|
||||
<record id="mail.event_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
|
||||
<!-- mail: event subtype -->
|
||||
<record id="mail.mt_event_new" model="mail.message.subtype">
|
||||
<field name="name">created</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.event_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">event.event</field>
|
||||
</record>
|
||||
<record id="mail.event_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<record id="mail.mt_event_cancel" model="mail.message.subtype">
|
||||
<field name="name">canceled</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.event_subtype_confirmed" model="mail.message.subtype">
|
||||
<record id="mail.mt_event_confirm" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- Event registration subtype -->
|
||||
<record id="mail.registration_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<!-- mail: event registration subtype -->
|
||||
<record id="mail.mt_registration_cancel" model="mail.message.subtype">
|
||||
<field name="name">canceled</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_confirmed" model="mail.message.subtype">
|
||||
<record id="mail.mt_registration_confirm" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="default" eval="False"/>
|
||||
|
|
Loading…
Reference in New Issue