This question has been flagged
1 Reply
1734 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???

Avatar
Discard

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

dependency module

Author

Both are in same class LIBU

Author

Both are in same class LIBU

Best Answer

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.

Avatar
Discard
Author

but i use this two classes in a single module SonnyV

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

Author

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,,,,,!!!!!

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.