diff --git a/apply_patches.sh b/apply_patches.sh index f147e88..5e28692 100755 --- a/apply_patches.sh +++ b/apply_patches.sh @@ -30,7 +30,7 @@ pt_core () SRC=$PWD DEST=$DESTDIR/core/ - OPTIONS="-p1 --verbose -R" + OPTIONS="-p1 --verbose" pushd $DEST # Already applied: diff --git a/patches/20230309_ir-attachment_allow-portal-users-attachment-access.patch b/patches/20230309_ir-attachment_allow-portal-users-attachment-access.patch index 5d645f4..33c21b5 100644 --- a/patches/20230309_ir-attachment_allow-portal-users-attachment-access.patch +++ b/patches/20230309_ir-attachment_allow-portal-users-attachment-access.patch @@ -2,9 +2,12 @@ diff --git a/odoo/addons/base/models/ir_attachment.py b/odoo/addons/base/models/ index f1d8701a1..0f7926756 100644 --- a/odoo/addons/base/models/ir_attachment.py +++ b/odoo/addons/base/models/ir_attachment.py -@@ -418,7 +418,10 @@ class IrAttachment(models.Model): +@@ -416,9 +416,13 @@ class IrAttachment(models.Model): + """ Restricts the access to an ir.attachment, according to referred mode """ + if self.env.is_superuser(): return True - # Always require an internal user (aka, employee) to access to a attachment +- # Always require an internal user (aka, employee) to access to a attachment ++ # Either internal users or Portal users (for some models) have access to attachments if not (self.env.is_admin() or self.env.user.has_group('base.group_user')): - raise AccessError(_("Sorry, you are not allowed to access this document.")) + res_models = ['account.move', 'stock.picking',