Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create function of open event registration and send email to user in OpenERP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 461
    Comment on it

    In OpenERP, first we create registration in event form and then pass the param ids like as list of event registration's IDs and also mapp to the standard dictionary for contextual values than we create email for users and validate to the event form.

    Use this function show below:

    def check_confirm(self, cr, uid, ids, context=None):
           
            if type(ids) in (int, long,):
                ids = [ids]
            data_pool = self.pool.get('ir.model.data')
            unconfirmed_ids = []
            if context is None:
                context = {}
            for registration in self.browse(cr, uid, ids, context=context):
                total_confirmed = registration.event_id.register_current + registration.nb_register
                if total_confirmed <= registration.event_id.register_max or registration.event_id.register_max == 0:
                    self.do_open(cr, uid, [registration.id], context=context)
                else:
                    unconfirmed_ids.append(registration.id)
            if unconfirmed_ids:
                view_id = data_pool.get_object_reference(cr, uid, 'event', 'view_event_confirm_registration')
                view_id = view_id and view_id[1] or False
                context['registration_ids'] = unconfirmed_ids
                return {
                    'name': _('Confirm Registration'),
                    'context': context,
                    'view_type': 'form',
                    'view_mode': 'tree,form',
                    'res_model': 'event.confirm.registration',
                    'views': [(view_id, 'form')],
                    'type': 'ir.actions.act_window',
                    'target': 'new',
                    'context': context,
                    'nodestroy': True
                }
            return True

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: