This question has been flagged
2711 Views

How could I create a wizard, whose function is to select a date and a value and copy it to another date.

suppose it is a film that has a session with some values ​​(room, time, film), and this by a certain date the wizard should select the date 1 and the session and date 2 (where to copy the session date 1). Help please.

I have made this part of the code:

**from osv import osv, fields class cinema_move_sessions(osv.osv_memory): _name = 'cinema.move.sessions'

_columns = {
'info_updates': fields.integer('Number of updated rates',readonly=True),
'date_inicial': fields.date('Date Initial'),
'date_final': fields.date('Date Final'),
'sessions_ids': fields.many2one('cinema.sessions', 'Sessions', required=True),
'state':fields.selection([ ('init','Init'), ('done','Done'), ],'State',readonly=True)
}

_defaults = { 
'state': lambda *a: 'init'
}

cinema_move_sessions()**

-<openerp>

-<data>

-<record id="view_cinema_move_sessions" model="ir.ui.view">

<field name="name">cinema.move.sessions</field>

<field name="model">cinema.move.sessions</field>

<field name="type">form</field>

-<field name="arch" type="xml">

-<form string="Copy sessions between two dates">

-<group attrs="{'invisible':[('state','=','done')]}" colspan="4" col="4">

<field name="date_inicial"/>

<field name="date_final"/>

<field name="sessions_ids"/>

</group>

-<group attrs="{'invisible':[('state','=','init')]}" colspan="4" col="4">

<field name="info_updates"/>

</group>

<separator colspan="4"/>

-<group colspan="2" col="2">

<field name="state" widget="statusbar"/>

</group>

-<group colspan="2" col="2">

<button string="Cancel" states="init" icon="gtk-cancel" special="cancel"/>

<button name="apply_percentage" type="object" string="Assign" states="init" icon="gtk-ok"/>

<button string="Close" states="done" icon="gtk-ok" special="cancel"/>

</group>

</form>

</field>

</record>

-<record id="action_cinema_move_sessions" model="ir.actions.act_window">

<field name="name">Copy sessions between two dates</field>

<field name="res_model">cinema.move.sessions</field>

<field name="view_type">form</field>

<field name="view_mode">form</field>

<field name="view_id" ref="view_cinema_move_sessions"/>

<field name="target">new</field>

</record>

<menuitem id="menu_cinema_move_sessions" name="Copy sessions between two dates" parent="menu_cinema_configuration_wizards" action="action_cinema_move_sessions"/>

</data>

</openerp>

Avatar
Discard