feat: filter company warehouse in stock transfer#11
Merged
Conversation
sayanthns
added a commit
that referenced
this pull request
May 1, 2026
… gaps Audit findings #11 + #12. #11: Stock Entry list view was unfiltered — Branch Users with read on Stock Entry could see every company's stock entries (cross-branch leakage). Add `stock_entry_permission_query` to branch_filters.py: filters by header from_warehouse / to_warehouse OR per-row s_warehouse / t_warehouse against branch warehouse list, with owner fallback. Wired in hooks.permission_query_conditions. #12: Branch Users hit "Not Permitted" when opening a Sales Invoice / Purchase Invoice / Purchase Receipt whose set_warehouse defaults to a global warehouse outside their branch (e.g. "Stores - <abbr>"). Same failure mode that was already fixed for Quotation + Delivery Note. Adding ten new Property Setters with ignore_user_permissions=1: - Sales Invoice.set_warehouse - Sales Invoice Item.warehouse / .cost_center - Purchase Invoice.set_warehouse - Purchase Invoice Item.warehouse / .cost_center - Purchase Receipt.set_warehouse - Purchase Receipt Item.warehouse / .cost_center / .rejected_warehouse Each registered in hooks.fixtures filter list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.