Skip to content

Commit

Permalink
[FIX] computing image must be done in sudo
Browse files Browse the repository at this point in the history
Indeed computing image can generate thumbnail and the api user may not have the access right for it
  • Loading branch information
sebastienbeau authored and Pierrick Brun committed Mar 15, 2021
1 parent 4a3d25e commit 5fb1c55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shopinvader_image/models/shopinvader_image_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class ShopinvaderImageMixin(models.AbstractModel):
_description = "Shopinvader Image Mixin"
_image_field = None

images = fields.Serialized(compute="_compute_image", string="Shopinvader Image")
images = fields.Serialized(
compute="_compute_image",
string="Shopinvader Image",
compute_sudo=True,
)

def _compute_image(self):
# Note: this computed field depend on the lang used in the context
Expand Down

0 comments on commit 5fb1c55

Please sign in to comment.