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.

1

Error in Inheritance!!!

By
aci aisha
on 1/30/15, 5:29 AM 328 views

I perform inheritance as follows,

class trademark_file_details(osv.osv):

    _description = 'Trademark File'

    _name = 'trademark.file.details'
    
    _inherit = 'file.details'

    _columns = {
                'trademark' : fields.char('This file is', required=True),
                }
    _defaults = {
        'name': 'Trademark',
    }

trademark_file_details()

But error occured,,

    'You may need to add a dependency on the parent class\' module.' % (name, parent))
TypeError: The model "trademark.file.details" specifies an unexisting parent class "file.details"
You may need to add a dependency on the parent class' module.

ANY1 can solve it???

from where u call this parent class file.details or ,R u using any existing module .Error is from file.details .So u must mentioned this dependancy class in openerp.py file

Odoo
on 1/30/15, 5:34 AM

dependency module

Odoo
on 1/30/15, 5:35 AM

Both are in same class LIBU

aci aisha
on 1/30/15, 6:14 AM

Both are in same class LIBU

aci aisha
on 1/30/15, 6:14 AM
0
SonnyV
On 1/30/15, 6:09 AM

In the folder of your custom module, locate the __openerp__.py file ( for odoo8 it might be __odoo__.py).

Edit that file and locate the rule that starts with "depends". There between the [brackets] add "file".

Odoo needs to be told on what you depend to run your module, so for every inherit you do, make sure you add this to depends in the above named file.

but i use this two classes in a single module SonnyV

aci aisha
on 1/30/15, 6:15 AM

The rule that starts with depends is formed as a list. Say you inherit from file and account and sale. "depends" : ['file', 'account', 'sale']

Cats&Dogs bvba, SonnyV
on 1/30/15, 6:22 AM

SonnyV,,, I inherit a class named file.details from the module file_details in the same module.....both are in same module,,,,no more than 1 module for dependence,,,,,!!!!!

aci aisha
on 1/30/15, 6:26 AM

Have you put all the necessary files into the __init__.py? Also, sequence is important because you need to have file.details to be instantiated first before trademark.file.details.

Ivan
on 1/30/15, 11:40 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

1 follower(s)

Stats

Asked: 1/30/15, 5:29 AM
Seen: 328 times
Last updated: 3/16/15, 8:10 AM