Skip to content

Commit

Permalink
CPT-61 Revert upstream change in ir_attachment.py
Browse files Browse the repository at this point in the history
Commit:
d3a6a20
  • Loading branch information
borna-ng authored and jhelfferich committed Oct 11, 2024
1 parent a52d525 commit 32750bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odoo/addons/base/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ def check(self, mode, values=None):
self.env['ir.attachment'].flush(['res_model', 'res_id', 'create_uid', 'public', 'res_field'])
self._cr.execute('SELECT res_model, res_id, create_uid, public, res_field FROM ir_attachment WHERE id IN %s', [tuple(self.ids)])
for res_model, res_id, create_uid, public, res_field in self._cr.fetchall():
if not self.env.is_system() and res_field:
raise AccessError(_("Sorry, you are not allowed to access this document."))
if public and mode == 'read':
continue
if not self.env.is_system() and (res_field or (not res_id and create_uid != self.env.uid)):
raise AccessError(_("Sorry, you are not allowed to access this document."))
if not (res_model and res_id):
continue
model_ids[res_model].add(res_id)
Expand Down

0 comments on commit 32750bb

Please sign in to comment.