Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Register attendees to multiple sessions in Odoo9

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 314
    Comment on it

    If you want to register attendees to multiple sessions follow the below code in your Odoo module.

                    <group>
                        <field name="session_ids">
                        <field name="attendee_ids">
                    </field></field></group>
                    <footer>
                        <button name="subscribe" type="object"
    

    openacademy/wizard.py

    class Wizard(models.TransientModel):
        _name = 'openacademy.wizard'
    
        def _default_sessions(self):
            return self.env['openacademy.session'].browse(self._context.get('active_ids'))
    
        session_ids = fields.Many2many('openacademy.session',
            string="Sessions", required=True, default=_default_sessions)
        attendee_ids = fields.Many2many('res.partner', string="Attendees")
    
        @api.multi
        def subscribe(self):
            for session in self.session_ids:
                session.attendee_ids |= self.attendee_ids
            return {}
    

    Note-Modify the wizard model so that attendees can be registered to multiple sessions.

 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: