[19.0][FIX] shopify_connector: allow delivery validation without Shopify access by sawirricardo · Pull Request #17 · OCA/connector-shopify · GitHub
Skip to content

[19.0][FIX] shopify_connector: allow delivery validation without Shopify access - #17

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
sawirricardo:19.0-fix-shopify_connector-picking-validate-access
Sep 29, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:19.0from
sawirricardo:19.0-fix-shopify_connector-picking-validate-access

Conversation

@sawirricardo

Copy link
Copy Markdown
Contributor

Follow-up to #14 (same class of bug, different entry point).

Problem

StockPickingShopifyFulfillmentSync._action_done reads picking.sale_id.shopify_binding_ids as the current user. shopify.order is only readable by group_shopify_manager, so any other user (Inventory / User, …) gets an AccessError when validating a delivery of a sale order:

odoo.exceptions.AccessError: You are not allowed to access 'Shopify Order Binding' (shopify.order) records.
odoo.exceptions.AccessError: Failed to read field sale.order.shopify_binding_ids

Fix

Look the bindings up with sudo(). Only the lookup is elevated: the validation still runs as the user, and _job_push_picking_fulfillment already switches to sudo() itself.

Test

test_stock_user_can_validate_picking_of_shopify_order: an Inventory / User validates a delivery of a Shopify order. The test checks that the picking is done, that the fulfillment push job is enqueued, and that the user still cannot read the bindings. As in #14, the cache is invalidated before validation so a warm cache does not hide the bug.

Verified with ghcr.io/oca/oca-ci/py3.10-odoo19.0:

  • Without the fix, the new test errors with the AccessError above.
  • With the fix, 0 failed, 0 error(s) of 177 tests.
  • pre-commit passes.

18.0 has both this lookup and the one fixed in #14 unsudoed; a backport will follow.

…cess

stock.picking._action_done read sale_id.shopify_binding_ids as the
current user. shopify.order is only readable by Shopify managers, so any
other user (e.g. Inventory / User) got an AccessError when validating a
delivery of a sale order. Look the bindings up with sudo(); the push job
already runs as superuser.
@sawirricardo

Copy link
Copy Markdown
Contributor Author

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-17-by-sawirricardo-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 2bae81e into OCA:19.0 Sep 29, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants