This question has been flagged
1 Reply
13394 Views

hi all,

i am creating a custom app/module, for which already created some models & views, all working fine (with help of seniors here at odoo.com), today i am trying to add model below but it is not creating, after restart server, tried to check in psql and in developer mode (Settings - Technical - Model) but didn't found this model, in log area (using Pycharm) it is showing  a line as: 2021-01-18 12:38:03,108 13585 INFO odoodev odoo.modules.registry: At least one model cache has been invalidated, signaling through the database


from odoo import models, fields



class StoreCats(models.Model):

    _name = 'tests.storecats'

    _rec_name = 'name'

    _description = "Store Categories"


    name = fields.Char(string="Store Category", required=True)

    description = fields.Char(string="Description")

    deleted_at = fields.Datetime()


please help, this is very simple enough model. also have added entry in __init__.py file under models directory. don't know what i am missing or doing wrong...

regards


Avatar
Discard
Best Answer

This is just a warning, something changed so much that odoo prefers to empty the memory cache than keeping it in sync.

Did you upgraded your module with the -u command line switch ?

Avatar
Discard
Author

thanks for reply :) now its working and i can see the model, will keep in mind to clear memory cache in my browser.

I am upgrading module with its Upgrade menu ( 3 dots on default kanban view ). will check how to on CLI method.

Is there any limitation of files in models directory? i don't think so... I already had 8 .py files (exlcude of __init__.py file), my model classes are 12 as 2 py files have multiple classes defined in it. I am creating separate files for all models except the same group like "Categories & Sub-Categories" both in a single file, for example.

thanks again for a great tip :)

regards