Hi guys,
I would like to inherit the model 'account.analytic.account' but when I do so I get the following error:
TypeError: The model "account.analytic.account" specifies an unexisting parent class "fleet.vehicle" You may need to add a dependency on the parent class' module.I've created a custom module named 'aa_auto_maatwerk' with the following code.
__init__.py:
# -*- coding: utf-8 -*- import controllers import models
__openerp__.py
# -*- coding: utf-8 -*- { 'name': "aa_auto_maatwerk", 'summary': """Extending fleet""", 'description': """ Extending some features """, 'author': "Your Company", 'website': "http://www.yourcompany.com", 'category': 'Uncategorized', 'version': '0.1', # any module necessary for this one to work correctly 'depends': ['base', 'fleet', 'analytic'], # always loaded 'data': [ # 'security/ir.model.access.csv', 'templates.xml', ], # only loaded in demonstration mode 'demo': [ 'demo.xml', ], }
models.py:
# -*- coding: utf-8 -*- from openerp.osv import osv, fields, orm class aa_auto_maatwerk(orm.Model): _name = 'account.analytic.account' _inherit = ['account.analytic.account'] _columns = { 'car_ids': fields.many2many('fleet.vehicle', 'fleet_to_contract', 'car_id1', 'car_id2', 'Cars'), }
Why am I getting this and what is wrong with this? The model exists in the database. I want this to lay a link to car.vehicle with a one2many.