[IMP]add the data into event for subtype
bzr revid: rma@tinyerp.com-20120831100012-mlzik593orznp9aj
This commit is contained in:
@@ -46,6 +46,7 @@ Note that:
|
||||
'data': [
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'event_data.xml',
|
||||
'wizard/event_confirm_view.xml',
|
||||
'event_view.xml',
|
||||
'report/report_event_registration_view.xml',
|
||||
|
||||
+10
-10
@@ -264,27 +264,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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, 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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, 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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="close", 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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="confirm", context=context)
|
||||
return True
|
||||
|
||||
event_event()
|
||||
@@ -331,7 +331,7 @@ class event_registration(osv.osv):
|
||||
|
||||
def confirm_registration(self, cr, uid, ids, context=None):
|
||||
self.message_post(cr, uid, ids, body=_('State set to open'), context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'open'}, context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'open'}, subtype="open", context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(event_registration, self).create(cr, uid, vals, context)
|
||||
@@ -360,13 +360,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'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Done'), subtype="close", 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'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype="cancel", context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
||||
def mail_user(self, cr, uid, ids, context=None):
|
||||
@@ -436,12 +436,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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, 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, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
|
||||
return True
|
||||
|
||||
event_registration()
|
||||
|
||||
@@ -12,6 +12,38 @@
|
||||
<field name="type">automatic</field>
|
||||
<field name="sequence">100</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</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_close" model="mail.message.subtype">
|
||||
<field name="name">close</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancel" model="mail.message.subtype">
|
||||
<field name="name">cancel</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_confirm" model="mail.message.subtype">
|
||||
<field name="name">confirm</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_registration'))]"/>
|
||||
</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'))]"/>
|
||||
</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>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
<function model="mail.group" name="message_post">
|
||||
@@ -20,5 +52,6 @@
|
||||
<value>From the top menu Events, you can organize events, manage registrations, automate communication around your event and sell events through your quotations.</value>
|
||||
<value>Module Events Organisation has been installed</value>
|
||||
</function>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user