[IMP]event:changed in event module as per new spec
bzr revid: sgo@tinyerp.com-20120913064101-85pfg3kbbqnoufzx
This commit is contained in:
parent
8ca3f76711
commit
296ae6e24b
|
@ -287,27 +287,27 @@ 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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_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="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_cancelled", 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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
def button_done_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Event has been <b>done</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
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="confirmed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_confirmed", context=context)
|
||||
return True
|
||||
|
||||
event_event()
|
||||
|
@ -353,7 +353,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'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to open'),subtype_xml_id="registration_subtype_confirmed", context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'open'},context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
|
@ -383,13 +383,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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Done'), subtype_xml_id="registration_subtype_closed", context=context)
|
||||
else:
|
||||
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="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype_xml_id="registration_subtype_cancelled", context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
||||
def mail_user(self, cr, uid, ids, context=None):
|
||||
|
@ -459,12 +459,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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", 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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
event_registration()
|
||||
|
|
|
@ -12,34 +12,51 @@
|
|||
<field name="type">automatic</field>
|
||||
<field name="sequence">100</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<!-- Event subtype -->
|
||||
<record id="mail.event_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_confirmed" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_confirmed" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
|
||||
<!-- 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.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<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>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_confirmed" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
<function model="mail.group" name="message_post">
|
||||
|
|
Loading…
Reference in New Issue