diff options
| author | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
|---|---|---|
| committer | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2012-10-05 17:35:03 +0530 |
| commit | cdff4611b0a588546afb9b706bbd2d0fbda7bf2f (patch) | |
| tree | 0a0a99b33e52547987ab69b2a29f3ec23c188142 /addons/event | |
| parent | 7202b8f7efbc76e2a40b1a4a8d7a95ed0d2ce573 (diff) | |
| parent | ba97319054728490e4d8a601382dd6fd2ab4f970 (diff) | |
[MERGE] merge with main addons
bzr revid: rpr@tinyerp.com-20121005120503-07e0zo8ucv8k0q3s
Diffstat (limited to 'addons/event')
| -rw-r--r-- | addons/event/__openerp__.py | 3 | ||||
| -rw-r--r-- | addons/event/event.py | 11 | ||||
| -rw-r--r-- | addons/event/event_data.xml | 19 | ||||
| -rw-r--r-- | addons/event/event_view.xml | 37 | ||||
| -rw-r--r-- | addons/event/report/__init__.py | 2 | ||||
| -rw-r--r-- | addons/event/res_partner_view.xml | 4 | ||||
| -rw-r--r-- | addons/event/security/event_security.xml | 2 | ||||
| -rw-r--r-- | addons/event/wizard/event_confirm.py | 2 |
8 files changed, 44 insertions, 36 deletions
diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index 8860d32686e..aa9f209df88 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -39,12 +39,13 @@ Key Features * Use emails to automatically confirm and send acknowledgements for any event registration """, 'author': 'OpenERP SA', - 'depends': ['base_setup', 'board', 'email_template', 'google_map'], + 'depends': ['base_setup', 'board', 'email_template'], 'data': [ 'security/event_security.xml', 'security/ir.model.access.csv', 'wizard/event_confirm_view.xml', 'event_view.xml', + 'event_data.xml', 'report/report_event_registration_view.xml', 'board_association_view.xml', 'res_partner_view.xml', diff --git a/addons/event/event.py b/addons/event/event.py index 44def4f0c76..0eb2dda8312 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -223,6 +223,7 @@ class event_event(osv.osv): 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c), 'user_id': lambda obj, cr, uid, context: uid, } + def subscribe_to_event(self, cr, uid, ids, context=None): register_pool = self.pool.get('event.registration') user_pool = self.pool.get('res.users') @@ -252,6 +253,7 @@ class event_event(osv.osv): _constraints = [ (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']), ] + def onchange_event_type(self, cr, uid, ids, type_event, context=None): if type_event: type_info = self.pool.get('event.type').browse(cr,uid,type_event,context) @@ -347,7 +349,6 @@ class event_registration(osv.osv): 'phone': fields.char('Phone', size=64), 'name': fields.char('Name', size=128, select=True), } - _defaults = { 'nb_register': 1, 'state': 'draft', @@ -359,8 +360,10 @@ 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) - return self.write(cr, uid, ids, {'state': 'open'}, context=context) + for reg in self.browse(cr, uid, ids, context=context or {}): + self.pool.get('event.event').message_post(cr, uid, [reg.event_id.id], body=_('New registration confirmed: %s.') % (reg.name or '', ),subtype="event.mt_event_registration", context=context) + self.message_post(cr, uid, ids, body=_('Registration confirmed.'), context=context) + return self.write(cr, uid, ids, {'state': 'open'},context=context) def create(self, cr, uid, vals, context=None): obj_id = super(event_registration, self).create(cr, uid, vals, context) @@ -391,7 +394,7 @@ class event_registration(osv.osv): self.write(cr, uid, ids, values) 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): diff --git a/addons/event/event_data.xml b/addons/event/event_data.xml index 5e34ddcfe02..47efca17d6d 100644 --- a/addons/event/event_data.xml +++ b/addons/event/event_data.xml @@ -12,14 +12,19 @@ <field name="state">open</field> </record> - <!-- notify all employees of module installation --> - <record model="mail.message" id="module_install_notification"> - <field name="model">mail.group</field> - <field name="res_id" ref="mail.group_all_employees"/> - <field name="type">notification</field> - <field name="subject">Events Organisation application installed!</field> - <field name="body">From the top Events menu, you can organize events, manage registrations, automate communication around your event and sell events through your quotations.</field> + <!-- mail: event subtype --> + <record id="event.mt_event_registration" model="mail.message.subtype"> + <field name="name">New Registrations</field> + <field name="res_model">event.event</field> + <field name="default" eval="False"/> </record> + <!-- notify all employees of module installation --> + <function model="mail.group" name="message_post"> + <!-- ids, subject, body, parent_id=False, type='notification', content_subtype='html' --> + <value eval="[ref('mail.group_all_employees')]"/> + <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 has been installed</value> + </function> </data> </openerp> diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index fd396053d5d..6ad8fb20467 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -1,15 +1,14 @@ <?xml version="1.0"?> <openerp> <data> - - <act_window - id="act_event_list_register_event" - name="Registration" - res_model="event.registration" - src_model="event.event" - view_mode="calendar,tree,form,graph" - context="{'search_default_event_id': active_id, 'default_event_id': active_id}" - view_type="form"/> + + <record id="act_event_list_register_event" model="ir.actions.act_window"> + <field name="res_model">event.registration</field> + <field name="view_type">form</field> + <field name="name">Registrations</field> + <field name="view_mode">calendar,tree,form,graph</field> + <field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id}</field> + </record> <!-- Top menu item --> <menuitem name="Events" @@ -247,12 +246,12 @@ <t t-name="kanban-box"> <div class="oe_module_vignette"> <a type="open" class="oe_module_icon"> - <div class="oe_event_date "><t t-esc="record.date_begin.raw_value.getDate()"/></div> - <div class="oe_event_month_year"> - <t t-esc="record.date_begin.raw_value.toString('MMM')"/> - <t t-esc="record.date_begin.raw_value.getFullYear()"/> - </div> - <div class="oe_event_time"><t t-esc="record.date_begin.raw_value.toString('hh:mm tt')"/></div> + <div class="oe_event_date "><t t-esc="record.date_begin.raw_value.getDate()"/></div> + <div class="oe_event_month_year"> + <t t-esc="record.date_begin.raw_value.toString('MMM')"/> + <t t-esc="record.date_begin.raw_value.getFullYear()"/> + </div> + <div class="oe_event_time"><t t-esc="record.date_begin.raw_value.toString('hh:mm tt')"/></div> </a> <div class="oe_module_desc"> <h4><a type="open"><field name="name"/></a></h4> @@ -272,10 +271,10 @@ </p> <t t-if="record.register_avail.raw_value != 0"> <t t-if="!record.is_subscribed.raw_value"> - <input t-att-id="record.id.raw_value" type="text" name="subscribe" class="no_of_seats" value="1" onchange="document.getElementById('btn_sub' +this.id).setAttribute('data-context',JSON.stringify({'ticket':this.value}))"/> - <button t-att-id="'btn_sub'+record.id.raw_value" type="object" name="subscribe_to_event" class="oe_mail_button_follow"> - <span >Subscribe</span> - </button> + <input t-att-id="record.id.raw_value" type="text" name="subscribe" class="no_of_seats" value="1" onchange="document.getElementById('btn_sub' +this.id).setAttribute('data-context',JSON.stringify({'ticket':this.value}))"/> + <button t-att-id="'btn_sub'+record.id.raw_value" type="object" name="subscribe_to_event" class="oe_mail_button_follow"> + <span >Subscribe</span> + </button> </t> </t> <t t-if="record.is_subscribed.raw_value"> diff --git a/addons/event/report/__init__.py b/addons/event/report/__init__.py index 1c60e2715df..4f2516e5615 100644 --- a/addons/event/report/__init__.py +++ b/addons/event/report/__init__.py @@ -21,4 +21,4 @@ import report_event_registration -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml index 8e5ff480c2c..c3e8073a7ae 100644 --- a/addons/event/res_partner_view.xml +++ b/addons/event/res_partner_view.xml @@ -16,7 +16,7 @@ <attribute name="invisible">False</attribute> </xpath> <xpath expr="//page[@name='page_history']" position="inside"> - <group name="grp_event" string="Event"> + <group name="grp_event" string="Events"> <field name="event_ids" colspan="4" nolabel="1"> <tree string="Events"> <field name="name" string="Event"/> @@ -24,7 +24,7 @@ </tree> </field> </group> - <group name="grp_registration" string="Registration"> + <group name="grp_registration" string="Registrations"> <field name="event_registration_ids" colspan="4" nolabel="1"> <tree string="Events Registration"> <field name="event_begin_date" string="Date"/> diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index f46bc5fff96..2cc749a1a40 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -3,7 +3,7 @@ <data> <record model="ir.module.category" id="module_category_event_management"> - <field name="name">Event</field> + <field name="name">Events</field> <field name="description">Helps you manage your Events.</field> <field name="sequence">3</field> </record> diff --git a/addons/event/wizard/event_confirm.py b/addons/event/wizard/event_confirm.py index e21d523bb12..e001aac9937 100644 --- a/addons/event/wizard/event_confirm.py +++ b/addons/event/wizard/event_confirm.py @@ -34,4 +34,4 @@ class event_confirm(osv.osv_memory): event_confirm() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
