Odoo Help


Function for Wizard ???

Dani Meller
on 1/22/14, 1:16 PM 614 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'




-<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 attrs="{'invisible':[('state','=','init')]}" colspan="4" col="4">

<field name="info_updates"/>


<separator colspan="4"/>

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

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


-<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"/>





-<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>


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



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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 1/22/14, 1:16 PM
Seen: 614 times
Last updated: 3/16/15, 8:10 AM