Odoo Help

Welcome!

This community 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.

0

How to open calendar view with selected date in OpenERP V8 and OpenERP V7

By
Ghanshyam Prajapati
on 4/11/14, 5:01 AM 1,093 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

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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