fix(isolation): roll back custom_company enforcement that hid all rec…#260
Merged
engahmed1190 merged 1 commit intoMay 13, 2026
Merged
Conversation
…ords The permission_query_conditions / has_permission hooks added in PR #252 filtered Customer/Supplier/Item Group/Customer Group/Supplier Group/ Brand/Price List by `custom_company IN (user_companies)`. On sites where legacy records have NULL custom_company (e.g. dev-miraaya, where 0 of 39,784 customers were tagged), the strict filter excluded every legacy record from every user — customers were invisible in Desk and POS. Rollback: - hooks.py: remove permission_query_conditions and has_permission blocks for the 7 isolated doctypes - company_isolation.py: reduce to get_user_companies(); drop the build_condition / has_permission helpers and 14 wrappers - validations.py item_query: treat NULL custom_company as global and drop the `1=0` blocker so missing user-companies fall through to stock permissions - 8 custom_company custom field JSONs: reqd 1 → 0 - delete test_company_isolation.py The custom_company column stays (api/items.py uses it for the unrelated allow_global_items POS Profile feature, which already handles NULL sensibly). uninstall.py still removes the fields if the app is fully uninstalled. sync_on_migrate: 1 on the custom field JSONs ensures `bench migrate` propagates reqd=0 to live sites without a separate patch. 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.
…ords
The permission_query_conditions / has_permission hooks added in PR #252 filtered Customer/Supplier/Item Group/Customer Group/Supplier Group/ Brand/Price List by
custom_company IN (user_companies). On sites where legacy records have NULL custom_company (e.g. dev-miraaya, where 0 of 39,784 customers were tagged), the strict filter excluded every legacy record from every user — customers were invisible in Desk and POS.Rollback:
1=0blocker so missing user-companies fall through to stock permissionsThe custom_company column stays (api/items.py uses it for the unrelated allow_global_items POS Profile feature, which already handles NULL sensibly). uninstall.py still removes the fields if the app is fully uninstalled.
sync_on_migrate: 1 on the custom field JSONs ensures
bench migratepropagates reqd=0 to live sites without a separate patch.