Odoo Help


Inherit Product Category issue

Mathieu Laflamme
on 7/16/15, 11:16 AM 1,307 views

I want to extend the product.category model and Odoo doesn't let me! 

class ProductCategory(models.Model):
    _inherit = 'product.category' 

I get the following error:

2015-07-16 11:06:27,473 16220 CRITICAL odoo_8a openerp.service.server: Failed to initialize database `odoo_8a`.
Traceback (most recent call last):
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\service\server.py", line 929, in preload_registries
registry = RegistryManager.new(dbname, update_module=update_module)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 351, in load_modules
force, status, report, loaded_modules, update_module)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 255, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 152, in load_module_graph
models = registry.load(cr, package)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\registry.py", line 163, in load
model = cls._build_model(self, cr)
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\models.py", line 595, in _build_model
original_module = pool[name]._original_module if name in parents else cls._module
File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\registry.py", line 102, in __getitem__
return self.models[model_name]
KeyError: 'product.category'

I don't get it... I was able to extend res.partner and res.users with no problem! I'm using Odoo V8

Any help would be appreciated.


Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/16/15, 11:44 AM


It seems you miss to set the 'product' module inside the 'depends' of __openerp__.py file.

Or if it is there, we guess you have setup auto_install=True in __openerp__.py.

Hope this helps.


I didn't know I needed to explicitly indicate the dependencies. I though it could access stuff that are currently installed. But it makes total sense. Thanks

Mathieu Laflamme
on 7/16/15, 2:21 PM
On 7/22/15, 10:25 AM

Depend on your needs, maybe you can have a look here


About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/16/15, 11:16 AM
Seen: 1307 times
Last updated: 7/22/15, 10:25 AM