[FIX] base: attachment check linked record 'write'
When an attachment is linked to a record (res_id and res_model are set) we check the access rights and access rules of that record. The access we check on linked record has changed as follow: - 15905e78 (2013) => we check `write` access right/rule for `create` - f5ebc509 (2014) => we check `write` access right for all mode - 66644e85 (2015) => we check write access right for all but create mode So currently we check on the linked record for each mode: - create: write access right / write access rule - read: read access right / read access rule - write: write access right / write access rule - unlink: write access right / unlink access rule The behavior is not expected for `unlink`, we should check if we have write access through access rules instead of checking unlink access. Without the change, the added test failed with a `unlink` access rule AccessError on the linked record. opw-2154448 closes #41814 closes odoo/odoo#42236 X-original-commit: 2cadce5628691aef46906be9de9cfec93ac448a2 Signed-off-by:Nicolas Lempereur (nle) <nle@odoo.com>
Please register or sign in to comment