Skip to content

Commit

Permalink
Fix model init for res.company. Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
fkantelberg committed May 10, 2024
1 parent 93ebaad commit 9fbed7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/doblib/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.18.0"
VERSION = "0.18.1"
13 changes: 7 additions & 6 deletions src/doblib/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,15 @@ def update_changed(self, db_name, blacklist=None):
with self.env(db_name, False) as env:
model = env["ir.module.module"]
if hasattr(model, "upgrade_changed_checksum"):
# Initialize `res.partner` and `res.users` to prevent exceptions
# caused by the fetching of user data inside of the decorator
# Initialize `res.company`, `res.partner` and `res.users` to prevent
# exceptions caused by the fetching of user data inside of the decorator
# `assert_log_admin_access`. Exceptions occur if an existing module
# adds a new field to `res.users` which gets loaded inside of python
# but doesn't link to a column in the database
utils.info("Initializing the `res.users` models")
# adds a new field to `res.company`, `res.partner` or `res.users` which
# gets loaded inside of python but doesn't link to a column in the
# database
utils.info("Initializing the `res.users` and `res.company` models")
env.registry.init_models(
env.cr, ["res.partner", "res.users"], env.context
env.cr, ["res.company", "res.partner", "res.users"], env.context
)

model.upgrade_changed_checksum(True)
Expand Down

0 comments on commit 9fbed7f

Please sign in to comment.