Odoo Help


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.


Getting error of dependencies while uninstalling / upgrading module..

Vitap ramdevputra
on 11/11/13, 9:32 AM 1,513 views

I want to add 3 fields in hr.contract model. Below is my code of all files I have written.


from openerp.osv import osv
from openerp.osv import fields
class contract_tag(osv.osv):
    #_name = 'hr.contract'
    _inherit = 'hr.contract'
    _columns = { 
    'x_tags' : fields.char('Tags',size=100),
    'vertical_id' : fields.char('Vertical id',size=25),
    'subvertical_id' : fields.char('Sub Vertical Id',size=25)


<?xml version="1.0" encoding="utf-8"?>
    <record model="ir.ui.view" id="contract">
        <field name="name">hr.contract.view.form</field>
        <field name="model">hr.contract</field>
        <field name="inherit_id" ref="hr_contract.hr_contract_view_form" />
        <field name="arch" type="xml">
            <xpath expr="/form/sheet/group/group/field[@name='type_id']" position="after">
            <field name= "x_tags" on_change='onchange_tags(x_tags)'/>
            <field name= "vertical_id"/>
            <field name= "subvertical_id"/>


    'name' : "contract tag",
    'version' : "0.0.17",
    'author' : "etl",
    'depends' : ['hr'],
    'category' : 'Tools',
    'update_xml' : ['add_tag.xml'],
    'data' : [],
    'demo' : [],
    'installable' : True,   

and in **__init__.py"

import contract_tag

For the first time module is installed successfully. But I am getting below error when I uninstall or updgrad my installed module.

File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 876, in create_instance
    'You may need to add a dependency on the parent class\' module.' % (name, parent_name))
TypeError: The model "hr.contract" specifies an unexisting parent class "hr.contract"
You may need to add a dependency on the parent class' module.

Please Help


Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 11/11/13, 10:41 AM

add hr_contract on __openerp__.py:

'depends' : ['hr','hr_contract'],

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)


Asked: 11/11/13, 9:32 AM
Seen: 1513 times
Last updated: 3/16/15, 8:10 AM