Files
odoo_source/addons/pos_self_order/models
Ethan Vincent 5e4e6e919f [FIX] pos_self_order: decode home images as sudo
**Current behavior:**
Trying to access the mobile order menu for a pos restaurant
with some non-default landing page images as a non-admin user
will result in an access error.

**Expected behavior:**
The images should load on this page for anyone who has a valid
access token for the page route.

**Steps to reproduce:**
1. Make a restaurant in the POS application

2. Enable mobile ordering and set a database user with `user`
     level access to the POS app to be the default user for
     this newly created restaurant

3. Upload a splash image for the restaurant

3. On the POS dashboard, select the three vertical dot button
     on the restaurant -> `Mobile Menu` to get the access error

**Cause of the issue:**
The default user on the restaurant POS will not necessarily
have access rights to the `ir.attachment` model/records.

**Fix:**
Get the images as sudo()- IMO there isn't a reason these should
be inaccessible to anybody considering they are intended to be
seen on the landing page by people trying to order.

opw-3748314

closes odoo/odoo#155589

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-29 10:34:20 +00:00
..