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

calendar view :Invalid attribute dictionary: str

By
oumaima
on 5/8/13, 8:40 AM 2,514 views

Hi everyone, I'm trying to display a calendar view in a test module;but i have this error: "TypeError: Invalid attribute dictionary: str"

emploi.py

enter code here

from osv import fields,osv import time from datetime import datetime from tools.translate import _

class emploi(osv.osv):

_name = 'emploi'
_columns = {
  'name': fields.datetime('Date debut', required=True),
  'date_fin': fields.datetime('Date fin', required=True),
}

emploi()

enter code here

emploi.xml

<?xml version="1.0" encoding="utf-8"?>

<openerp> <data> <record model="ir.ui.view" id="view_school_emploi_form"> <field name="name">emploi.form</field> <field name="model">emploi</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Information emploi" version="7.0"> <field name="name" colspan="6"/> <field name="date_fin" colspan="6"/> </form> </field> </record>

    <record model="ir.ui.view" id="view_school_emploi__tree">
    <field name="name">emploi.tree</field>
    <field name="model">emploi</field>
    <field name="type">tree</field>
    <field name="arch" type="xml">
        <tree string="emploi.enseignant">
            <field name="name"/>
            <field name="date_fin"/>
        </tree>
    </field>
</record>

<record model="ir.actions.act_window" id="action_school_emploi_form">
    <field name="name">Emploi</field>
    <field name="res_model">emploi</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form,calendar</field>
</record>

<menuitem name="Gestion emploi Prof" id="menu"/>

<menuitem
    name="Gestion emploi" parent="menu"
    id="menu_emploi"
    sequence="1"/>
<menuitem
    name="Eleves" parent="menu_emploi"
    id="menu_student1"
    action="action_school_emploi_form"
    sequence="1"/>

</data> </openerp>

I add this line :<calendar string="Planning demploi" date_start="name" date_stop="date_fin"> <field name="name" colspan="6" /> <field name="date_fin" colspan="6"/> </calendar> but i have this error :Uncaught TypeError: Cannot read property 'selection' of undefined

oumaima
on 5/8/13, 9:00 AM

Where is your calendar view? You didn't posted it?

Sudhir Arya (SA)
on 5/8/13, 9:01 AM

Hi,I don't understand your question

oumaima
on 5/8/13, 9:04 AM

I mean did you create calendar view in your xml file?

Sudhir Arya (SA)
on 5/8/13, 9:06 AM

Hi,no i didn't create it;i just add these lines in the form view: <calendar string="Planning demploi" date_start="name" date_stop="date_fin"> <field name="name" colspan="6" /> <field name="date_fin" colspan="6"/> </calendar> should i add anything else?

oumaima
on 5/8/13, 9:09 AM

Can you post that calendar view here?

Sudhir Arya (SA)
on 5/8/13, 9:15 AM
0
oumaima
On 5/8/13, 9:20 AM
enter code here

<calendar string="Planning demploi" date_start="name" date_stop="date_fin"> <field name="name" colspan="6"/> <field name="date_fin" colspan="6"/> </calendar>

0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 5/8/13, 9:26 AM

Add this calendar view in you xml and then update your module.

<record id="view_emploi_calendar" model="ir.ui.view">
    <field name="name">emploi.calendar</field>
    <field name="model">emploi</field>
    <field name="arch" type="xml">
        <calendar string="Planning demploi" date_start="name" date_stop="date_fin">
            <field name="name"/>
            <field name="date_fin"/>
        </calendar>
    </field>
</record>

I add the calender view ;but i have this error:Uncaught TypeError: Cannot read property 'selection' of undefined

oumaima
on 5/8/13, 9:39 AM

Can you post whole error list?

Sudhir Arya (SA)
on 5/8/13, 9:44 AM

OpenERP erreur(coté interface) Uncaught TypeError: Cannot read property 'selection' of undefined http://localhost:8069/web/webclient/js?db=dd:5573

oumaima
on 5/8/13, 9:46 AM

I have the same issue any one please help

Anuradha
on 7/31/13, 8:35 AM

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: 5/8/13, 8:40 AM
Seen: 2514 times
Last updated: 3/16/15, 8:10 AM