diff --git a/addons/lunch/report/lunch_product_report.py b/addons/lunch/report/lunch_product_report.py index 8ff8858487f..44953be8930 100644 --- a/addons/lunch/report/lunch_product_report.py +++ b/addons/lunch/report/lunch_product_report.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models, tools +from odoo import api, fields, models, tools from odoo.osv import expression @@ -41,6 +41,17 @@ class LunchProductReport(models.Model): else: product_r.image_128 = False + def compute_concurrency_field(self): + """Image caching is based on the `__last_update` field (=self.CONCURRENCY_CHECK_FIELD) + But the image is never cached by the browser because the value fallbacks to + `now` when access logging is disabled. This override sets a "real" value based on the + product or category last update. + """ + for report in self: + product_last_update = report.product_id[self.CONCURRENCY_CHECK_FIELD] + category_last_update = report.category_id[self.CONCURRENCY_CHECK_FIELD] + report[self.CONCURRENCY_CHECK_FIELD] = max(product_last_update, category_last_update) + def _compute_is_available_at(self): """ Is available_at is always false when browsing it