Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] base: Update wrong cache invalidation #1220

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/cla/individual/jbjourget-b.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
France, 2023-11-27

I hereby agree to the terms of the Odoo Individual Contributor License
Agreement v1.0.

I declare that I am authorized and able to make this agreement and sign this
declaration.

Signed,

Jean-Benoît Jourget 137054756+jbjourget-b@users.noreply.github.com https://github.com/jbjourget-b
15 changes: 2 additions & 13 deletions odoo/addons/base/models/ir_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,7 @@ def write(self, values):
# we're writing a res_id=False on any record
default_set = False
if self._ids:
self.env.cr.execute(
'SELECT EXISTS (SELECT 1 FROM ir_property WHERE id in %s AND res_id IS NULL)', [self._ids])
default_set = self.env.cr.rowcount == 1 or any(
v.get('res_id') is False
for v in values
)
default_set = values.get('res_id') is False or any(not p.res_id for p in self)
r = super(Property, self).write(self._update_values(values))
if default_set:
# DLE P44: test `test_27_company_dependent`
Expand All @@ -139,13 +134,7 @@ def create(self, vals_list):
return r

def unlink(self):
default_deleted = False
if self._ids:
self.env.cr.execute(
'SELECT EXISTS (SELECT 1 FROM ir_property WHERE id in %s)',
[self._ids]
)
default_deleted = self.env.cr.rowcount == 1
default_deleted = any(not p.res_id for p in self)
r = super().unlink()
if default_deleted:
self.clear_caches()
Expand Down