Odoo Help


Integrity Error with calendar.event module

on 6/6/13, 1:35 PM 1,134 views

Hi everyone,i wanna add a calendar for each professor: but i have this error: Integrity Error

The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set

[object with reference: date - date]


from osv import fields,osv

import time from datetime import datetime from tools.translate import _

class professeur_entity(osv.osv): #il faut hériter de l'objet calendar.event pour qu'on puisse hériter la vue calendar _inherit='calendar.event' _name = 'professeur.entity' _columns = { 'name': fields.char('Nom', required=True, size=32), 'prenom': fields.char('Prenom', required=True, size=32), 'le':fields.many2one('calendar.event', 'Emploi du temps',help="emploi du temps"),




enter code here
<menuitem name="Gestion professeur" id="menu_prof"/>    

   <menuitem name="Enseignant" id="menu_prof1" parent="menu_prof"/>

<record model="ir.ui.view" id="view_school_prof_form">
    <field name="name">prof.form</field>
    <field name="model">professeur.entity</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
       <form string="Enseignant"  version="7.0">
           <group col="4" colspan="6">       
               <field name="name"/>
               <field name="prenom"/>
               <field name="emp_ids"/>  



    <record model="ir.ui.view" id="view_school_prof_tree">
    <field name="name">prof.tree</field>
    <field name="model">professeur.entity</field>
    <field name="type">tree</field>
    <field name="arch" type="xml">
        <tree string="Enseignants"  version="7.0">
               <field name="name"/>
               <field name="prenom"/>       
            <field name="emp_ids"/>                

<record model="ir.actions.act_window" id="action_school_prof_form">
    <field name="name">enseignants</field>
    <field name="res_model">professeur.entity</field>
    <field name="view_type">form</field>
    <field name="view_id" ref="base_calendar.event_calendar_view"/><!--Il faut ajouter id de vue calendar de cette façon -->
    <field name="view_mode">tree,form</field>

    <!--  Et finalement il y a le menu qui contient l'action pour ouvrir la vue tree de ton module -->

<menuitem action="action_school_prof_form" id="menu_prof2" parent="menu_prof1" />

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

1 follower(s)


Asked: 6/6/13, 1:35 PM
Seen: 1134 times
Last updated: 3/16/15, 8:10 AM