manipulate data of type date

Asked by pesanhane

I created a file with the extension py containing the following class

class booking_data(osv.osv):
 _name='booking.data'
 _description = ''
 _columns = {
  'start_date': fields.date('Start Date', readonly=True, select=True, help="dia de marcacao da Reserva."),
  'final_date': fields.date('Final Date', readonly=True, select=True, help="Ultimo dia da validade da Reserva."),
       }

and i create xml file with this content

<data>

  <record model="ir.ui.view" id="booking_data_form">
   <field name="name">booking.data.form</field>
   <field name="model">booking.data</field>
                        <field name="type">form</field>
                        <field name="arch" type="xml">
               <form string="Booking data">
                                  <field name="start_date"/>
                    <field name="final_date"/>
                             </form>
   </field>
  </record>

       <record model="ir.ui.view" id="booking_data_tree">
                    <field name="name">booking.data.tree</field>
                    <field name="model">booking.data</field>
                    <field name="type">tree</field>
                    <field name="arch" type="xml">
                            <tree string="Booking data">
                                   <field name="start_date"/>
                    <field name="final_date"/>
                          </tree>
                    </field>
              </record>

 </data>

I I ran the module in openerp 7, and this just shows
Start Date Final Date
and does not show me option to select dates
(calendar)

i would like to know how to make it shows me options do select the dates
from calendar

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
digitalsatori(Shine IT)
Solved:
Last query:
Last reply:
Revision history for this message
Best digitalsatori(Shine IT) (digitalsatori) said :
#1

remove " readonly=True" parameter in your fields definetion.

Revision history for this message
pesanhane (pesanhane) said :
#2

Thanks digitalsatori(Shine IT), that solved my question.