Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Multi step wizard with data from many2many relation?

By
Felix
on 11/4/13, 7:03 AM 1,462 views

Task

Provide a GUI so that partner (table res_partner) can be registered to events (table res_event) via the many2many join table registration (table event_registration).

  1. user selects a single event from a list of events
  2. user selects one or more partners from a list of partner
  3. confirmation of registration triggers inserts into join table

Proposed Solution

Multi step wizard wizard where the first wizard page/step handles step 1 from above (event selection) and the second page/step handles step 2 (partner(s) selection). The confirmation may be included in page 2 or as separate page 3 of the wizard.

Question

Is a wizard the right approach for this task?

How can I get the correct data on each page of the wizard. The partner list on the second page depends on the event selection of the first page as only partners that aren't already registered for this event should be displayed.

I was thinking about using a osv_memory wizard but find it difficult to imagine how and when to initialize the events and partners to be displayed for selection.

class wizard_with_step(osv.osv_memory):
    _name = 'wizard.with.step'
    _columns = { 
          'events_list': ???,
          'partners_list': ???,
          'event_selected': ???,
          'partners_selected': ???,
          'state': fields.selection([('step1', 'Event Selection'), ('step2', 'Parnter Selection'), ('step3', 'Confirmation')])  
          }
    _defaults = {
        'state': 'step1',
    }

    def action_next(self, cr, uid, ids, context=None):
        ???

    def action_previous(self, cr, uid, ids, context=None):
        ???

Would this be a reasonable approach for the task described? If so how should the event and partner data be initialized and where should the intermediate results (the selected event and partners) be stored?

Did you have a look there : https://www.odoo.com/forum/Help-1/question/How-to-create-a-wizard-with-steps--19828 ?

Mind & Go, Mind And Go
on 6/9/14, 2:28 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/4/13, 7:03 AM
Seen: 1462 times
Last updated: 3/16/15, 8:10 AM