odoo/odoo#214822

Created by fw-bot
Merged at 7c3dcf5762f0c1c965b531d018bdbc7b605b80b3

Statuses:

label
odoo-dev:saas-18.2-v17_fix_pos_online_payment-443300-fw
head
9bbbe73788f74d810cfb1f4f90f486c644007d40
merged
4 months ago by POS IoT, Joseph Caburnay (jcb)
odoo/odoo
17.0 #193881
18.0 #214550
saas-18.1 #214583
saas-18.2 #214822
saas-18.3 #215042
saas-18.4
19.0
master #215057

[FW][FIX] pos_online_payment: access error if no customer when paying online

  • STEP TO REPRODUCE: Have 2 company (1 is Default San Francisco the other is VN company),Start enviroment in VN company -> config an online payment method with
    Demo/Wire
    Transfer -> Start session and create pos order with no customer then Validate -> Customer scan QR code using mobile (not logged in) -> 403 forbidden error, read the log said: Sorry, Public user for VN company (id=10) doesn't have 'read' access to: User (res.users)
  • REASON: when request.env.ref('base.public_user') it will get public user from San Francisco company while the request user is Public User of VN company, the record rule prevent that
  • SOLUTION: Fix by using method _get_public_user() in res.company, this
    commit also move _get_public_user() from website to base module so other
    modules can use it

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #214583
Forward-Port-Of: #193881