From f3947d903d0f34b6ac19c459870676721aaacbf7 Mon Sep 17 00:00:00 2001 From: JuMiSanAr Date: Thu, 11 Jan 2024 11:00:55 +0100 Subject: [PATCH] shopfloor: force icon size in packaging data --- shopfloor/actions/data.py | 4 +++- shopfloor/models/product_packaging_type.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shopfloor/actions/data.py b/shopfloor/actions/data.py index a67136554d2..0b364c22547 100644 --- a/shopfloor/actions/data.py +++ b/shopfloor/actions/data.py @@ -321,7 +321,9 @@ def _packaging_icon_data(self, rec, field): icon_data = {"alt_text": rec.packaging_type_id.name} if not rec.packaging_type_id.shopfloor_icon: return icon_data - icon_data["url"] = "/web/image/product.packaging.type/{}/shopfloor_icon/".format( + icon_data[ + "url" + ] = "/web/image/product.packaging.type/{}/shopfloor_icon/30x30".format( rec.packaging_type_id.id ) return icon_data diff --git a/shopfloor/models/product_packaging_type.py b/shopfloor/models/product_packaging_type.py index 05eec70b7c3..16c58b1bb92 100644 --- a/shopfloor/models/product_packaging_type.py +++ b/shopfloor/models/product_packaging_type.py @@ -7,4 +7,6 @@ class ProductPackagingType(models.Model): _inherit = "product.packaging.type" - shopfloor_icon = fields.Binary(help="Icon to be displayed in the frontend qty picker. Its final size will be a 30x30 image, which means that squared icons work best.") \ No newline at end of file + shopfloor_icon = fields.Binary( + help="Icon to be displayed in the frontend qty picker. Its final size will be a 30x30 image, which means that squared icons work best." + )