Odoo Help

0

How to Open Calendar view in OpenERP 8

By
Ghanshyam Prajapati
on 4/11/14, 5:00 AM 1,763 views

Hello Everyone,

I need your help,
in my .py file,,

class test_hr(osv.osv):
_name = 'test.hr'
_columns= {
        'name' : fields.char('Name', size=20, readonly=True),
        'user_id': fields.many2one('res.users', 'Users'),
        'from_datetime': fields.datetime('From Datetime'),
        'to_datetime': fields.datetime('To Datetime'),
}

in view file,

    <record id="view_test_hr_state_calendar" model="ir.ui.view">
        <field name="name">test.hr.calendar</field>
        <field name="model">test.hr</field>
        <field name="arch" type="xml">
            <calendar string="Test Schedule" date_start="from_datetime" date_stop="to_datetime" color="user_id" avatar_model="res.users" display="[name]" mode="day">
                <field name="name"/>
                <field name="user_id"/>
                <field name="from_datetime"/>
                <field name="to_datetime"/>
            </calendar>
        </field>
    </record>

i created one record, with,

  • user_id = Administrator,
  • from_datetime = '2014-03-01 08:00:00'
  • to_datetime = '2014-03-01 12:00:00'

Now the case is, I have one wizard with date field, when i select date '2014-03-01' and then click on button, it should return calendar view with '2014-03-01' date, and also should display above record in calendar view,

Please help me out,

Thanks

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.

Register

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)

Stats

Asked: 4/11/14, 5:00 AM
Seen: 1763 times
Last updated: 3/16/15, 8:10 AM