From b6288e54461426d7aac6cfc549cee3e90309a093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 19 Sep 2019 10:23:39 +0000 Subject: [IMP] *: remove image_64 and clean views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are too many image sizes. Since they are stored resized this takes time to generate when saving a new image, it's more rows on the attachment table, more files on the disk, ... 64px is close enough to 128px that it can be removed without a big impact on download size. It will even reduce download and number of requests when both images are displayed because now only one has to be downloaded and then benefit from cache. The difference between the two is typically around 1.5kB which is negligible these days, especially when the request overhead is around 0.5kB already, not even taking into account other factors such as latency. If a 64px image must absolutely be returned, it is still possible to pass the size parameters to the image route. But the current guideline is to handle resizing in the views when necessary. Views ===== - remove width and height attributes when existing CSS rules are overriding them (eg. `.oe_kanban_avatar` in the right context) - add CSS rules instead of width and height attributes when possible - use `object-fit: cover;` where width and height are forced to avoid distortion of non-square images - for products, use `object-fit: contain;` instead, keep ratio but without crop - add new CSS rules where the expected size was max 64px*64px before due to the image size itself - remove `img-fluid` where using size classes to avoid conflicting rules task-2060865 closes odoo/odoo#36147 Signed-off-by: Sébastien Theys (seb) --- doc/reference/views.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/reference') diff --git a/doc/reference/views.rst b/doc/reference/views.rst index efe07c48076..c5788657b67 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -1382,7 +1382,7 @@ take the following attributes: -- cgit v1.2.3 From 5dad570423204c817f61d58b6d56bd376362e1b9 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 28 Aug 2019 08:33:54 +0000 Subject: [FIX] *: remove buggy calls to with_context When .with_context() is called with a dictionary as 1st positional argument, it will replace context (and not modify the referenced keys) It may create bugs when losing the content of the context (e.g. remove partner's language) This is a partial merge of #36164 without the inventory part as discussed. closes odoo/odoo#36729 X-forward: 4717ccfa Signed-off-by: Martin Trigaux (mat) --- doc/reference/reports.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/reference') diff --git a/doc/reference/reports.rst b/doc/reference/reports.rst index ee36f9bfd27..f12efdcab07 100644 --- a/doc/reference/reports.rst +++ b/doc/reference/reports.rst @@ -153,7 +153,7 @@ For example, let's look at the Sale Order report from the Sale module::