Skip to Content
Menu
This question has been flagged
2 Replies
2798 Views

I have installed calendar module and I have inherited with "calendar.event"  model...and customised one Tab in form view...then while run the server getting error "KeyError: 'calendar.event' 

Please let me know the solution..

code:

from openerp import models,fields

class Mom(models.Model):

 _inherit='calendar.event'

 agenda=fields.Text(string="Agenda")

XML:

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

<openerp>

    <data>

    <record id="mom_view_id" model="ir.ui.view">

            <field name="name">calendar.event</field>

            <field name="model">calendar.event</field>

            <field name="inherit_id" ref="calendar.view_calendar_event_form"/>

            <field name="arch" type="xml">

                <notebook>

                    <page string="Meeting Additional Info" groups="base.group_no_one">

                        <group>

                            <field name="agenda"/>

                        </group>

                    </page>

                </notebook>

            </field>

        </record>

    </data>

</openerp>


Avatar
Discard

Have you defined calendar module in depends of your module.

Best Answer

Here you are inherit the calendar.event model and this model is in calendar module so you are first set dependencies in  openerp.py   v9 

'depends':['calendar']

Avatar
Discard
Author

Yes, thank you.. it's working

Related Posts Replies Views Activity
3
Aug 24
5503
4
Jul 24
38817
5
Apr 23
93737
3
Nov 22
2957
3
Aug 22
3040