Randhir Mayatra (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_event-rma
into lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
Requested reviews:
Amit Patel (OpenERP) (apa-tiny)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_event-rma/+merge/122224
Hello Sir,
I have add the data into the for the subtype.
Thank you.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_event-rma/+merge/122224
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'event/__openerp__.py'
--- event/__openerp__.py 2012-08-22 07:14:45 +0000
+++ event/__openerp__.py 2012-08-31 10:03:39 +0000
@@ -46,6 +46,7 @@
'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',
=== modified file 'event/event.py'
--- event/event.py 2012-08-22 15:31:45 +0000
+++ event/event.py 2012-08-31 10:03:39 +0000
@@ -264,27 +264,27 @@
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 @@
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 @@
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 @@
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()
=== modified file 'event/event_data.xml'
--- event/event_data.xml 2012-08-17 11:19:36 +0000
+++ event/event_data.xml 2012-08-31 10:03:39 +0000
@@ -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>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp