~carlos-realsystems/+junk/openacademy

« back to all changes in this revision

Viewing changes to openacademy/wizard/create_attendee_view.xml

  • Committer: Carlos Contreras
  • Author(s): carlos at com
  • Date: 2011-09-09 21:08:55 UTC
  • Revision ID: carlos@realsystems.com.mx-20110909210855-m0gds7nj5760jxul

[IMP] Implementacion de Wizard
Creamos el modelo del wizard herendado
de las clase osv.osv_memory.
uno que es el contenedor del wizard
y el otro que es el objeto contenido
Adicionalmente devolvemos en el wizard
una vista del elemento que se afecta.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding='UTF-8' ?>
 
2
<openerp>
 
3
     <data>
 
4
                 
 
5
                <record model='ir.ui.view' id='create_attendee_form_view'>
 
6
                <field name='name'>Create Attendee Wizard</field>
 
7
                <field name='model'>openacademy.create.attendee.wizard</field>
 
8
                <field name='type'>form</field>
 
9
                <field name='arch' type='xml'>
 
10
                        <form string="Add Attendee" col='2' > 
 
11
                        <group height='300' width='400'>
 
12
                                <field name='session_id' colspan='4' />
 
13
                                <separator colspan='4' />
 
14
                                <field name='attendee_ids' mode='tree' nolabel='1' colspan='4' >
 
15
                                        <tree string='Attendees' editable='top' >
 
16
                                                <field name='partner_id' />
 
17
                                        </tree>
 
18
                                </field>
 
19
                        </group>
 
20
                        <group>
 
21
                                <button 
 
22
                                        type='special'
 
23
                                        special='cancel'
 
24
                                        string='_Cancel'
 
25
                                        icon='gtk-cancel'
 
26
                                
 
27
                                />
 
28
                                <button 
 
29
                                        type='object'
 
30
                                        name='action_add_attendee'
 
31
                                        string='_Add attendees'
 
32
                                        icon='gtk-ok'
 
33
                                        confirm='Are you sure you want to add these attendees?'
 
34
                                
 
35
                                />
 
36
                        </group>
 
37
                                
 
38
                        </form>         
 
39
                                
 
40
                </field>        
 
41
        </record>
 
42
 
 
43
<!-- Action: debe ir antes del menu que lo llama -->
 
44
        <record model='ir.actions.act_window' id='create_attendee_wizard_action'>
 
45
             <field name='name'>Add attendee</field>
 
46
             <field name='res_model'>openacademy.create.attendee.wizard</field>
 
47
             <field name='view_type'>form</field>
 
48
             <field name='view_mode'>form</field>
 
49
             <field name='target' >new</field>
 
50
             <field name='view_id' ref="create_attendee_form_view" />
 
51
        </record>
 
52
                                         
 
53
     <menuitem
 
54
             id="openacademy_create_attendee_wizard_menu"
 
55
             name="Add attendee"
 
56
             sequence='50'
 
57
             icon='STOCK_FLOPPY'
 
58
             web_icon='images/openacademy.png'
 
59
             web_icon_hover='images/openacademy-hover.png'
 
60
             action='create_attendee_wizard_action'
 
61
             parent='openacademy_menu'
 
62
        />      
 
63
        
 
64
        <act_window
 
65
                name='Add ateendees'
 
66
                src_model = 'openacademy.session'
 
67
                res_model = 'openacademy.create.attendee.wizard'
 
68
                id='session_create_attendee_wizard'
 
69
                view_mode='form'
 
70
                target='new'
 
71
                key2='client_action_multi'
 
72
        />
 
73
        
 
74
        <act_window
 
75
                id="course_action"
 
76
                name="Courses"
 
77
                src_model = 'openacademy.session'
 
78
                res_model = 'openacademy.course'                
 
79
                domain="[('id','=',course_id)]"
 
80
                view_type="form"
 
81
                view_mode="tree,form"
 
82
                key2='client_action_multi'
 
83
        />
 
84
 
 
85
     </data>
 
86
</openerp>