Skip to content

Commit

Permalink
shopfloor: force icon size in packaging data
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr authored and c2c committed Jan 11, 2024
1 parent 1a4f3f5 commit f3947d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion shopfloor/actions/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion shopfloor/models/product_packaging_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
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."
)

0 comments on commit f3947d9

Please sign in to comment.