Skip to content
Permalink
Browse files

WIP cache problem

  • Loading branch information...
seb-odoo committed Apr 4, 2019
1 parent 28e5cbe commit fd88a7e2e309f91c40bfbaf2c2c7bededd4b66cf
Showing with 3 additions and 0 deletions.
  1. +1 −0 addons/website/tests/test_website_favicon.py
  2. +2 −0 odoo/fields.py
@@ -30,6 +30,7 @@ def test_01_website_favicon(self):
bg_color = (135, 90, 123)
image = Image.new('RGB', (1920, 1080), color=bg_color)
website.favicon = image_to_base64(image, 'JPEG')
website.invalidate_cache()
image = base64_to_image(website.favicon)
self.assertEqual(image.format, 'ICO')
self.assertEqual(image.size, (256, 256))
@@ -1035,6 +1035,8 @@ def __set__(self, record, value):
record.write({self.name: write_value})
# Update the cache unless value contains a new record
if not (self.relational and not all(value)):
# TODO SEB there is a problem here, if the value is changed by
# write, the cached value will be the wrong one
record.env.cache.set(record, self, value)

############################################################################

0 comments on commit fd88a7e

Please sign in to comment.
You can’t perform that action at this time.