Commit 07ad82d
John75SunCity
fix: Remove barcode scanner from portal & add proper org chart security (v18.0.1.0.18)
ISSUE IDENTIFIED (User Feedback):
❌ Barcode scanner exposed to portal customers (field service feature only)
❌ Organization chart missing proper ACL/security rules for portal users
ANALYSIS:
1. Barcode Scanner (/my/barcode/main):
- Uses batch_barcode_operations model
- ACL: group_records_user, group_records_manager, group_records_admin
- NO portal group access
- Designed for field technicians to scan pickup/retrieval items
- Should NOT be in customer portal
2. Organization Chart (/my/organization):
- Uses res.partner hierarchy with .sudo()
- Missing portal-specific security rules
- Only has group_portal_company_admin check in controller
- NO record-level access rules for res.partner organization viewing
CHANGES:
1. Removed barcode scanner from portal (website_portal_menus.xml):
❌ Deleted portal_menu_barcode_scanner menu item
✅ Feature remains accessible for internal users via backend
2. Restricted organization chart to company admins (website_portal_menus.xml):
✅ Added groups_id filter: group_portal_company_admin
✅ Only company admins see menu item
3. Updated portal hub cards (website_pages.xml):
❌ Removed barcode scanner feature card
✅ Added 'Company Admin Only' badge to organization chart
✅ Kept advanced search feature
✅ Changed to 2-column layout (was 3-column)
4. Created portal organization security (NEW FILE):
security/portal_organization_security.xml:
Rule 1 - Read access for all portal users:
- Domain: res.partner in user's commercial_partner_id hierarchy
- Groups: base.group_portal
- Permissions: read only (no write/create/unlink)
Rule 2 - Create access for company admins:
- Domain: parent_id within commercial_partner_id
- Groups: group_portal_company_admin
- Permissions: read + create (add team members)
5. Updated manifest to include new security file
SECURITY IMPROVEMENTS:
✅ Portal users can only view partners in their organization
✅ Company admins can add sub-contacts to their company
✅ No unauthorized access to other companies' data
✅ Proper record-level filtering with commercial_partner_id
FEATURE ACCESS MATRIX (CORRECTED):
┌─────────────────────┬───────────────┬─────────────────────┐
│ Feature │ Portal Users │ Internal Users │
├─────────────────────┼───────────────┼─────────────────────┤
│ Barcode Scanner │ ❌ NO ACCESS │ ✅ Field Service │
│ Organization Chart │ ✅ Admin Only │ ✅ All Internal │
│ Advanced Search │ ✅ All Users │ ✅ All Internal │
└─────────────────────┴───────────────┴─────────────────────┘
PORTAL HUB CARDS NOW:
✅ 8 total feature cards (was 9, removed barcode)
- 6 core features (inventory, requests, docs, billing, certs, help)
- 2 advanced features (organization [admin], search)
USER IMPACT:
✅ Portal customers no longer see field service tools
✅ Organization chart properly secured with ACLs
✅ Only company admins can view/manage team hierarchy
✅ Cleaner portal UX focused on customer needs
✅ Proper separation of customer vs. technician features1 parent f890703 commit 07ad82d
File tree
4 files changed
+53
-26
lines changed- records_management
- data
- security
4 files changed
+53
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 97 | + | |
108 | 98 | | |
109 | 99 | | |
110 | 100 | | |
111 | | - | |
| 101 | + | |
112 | 102 | | |
| 103 | + | |
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
116 | 107 | | |
117 | | - | |
| 108 | + | |
118 | 109 | | |
119 | 110 | | |
120 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 92 | + | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
104 | 96 | | |
105 | | - | |
| 97 | + | |
| 98 | + | |
106 | 99 | | |
107 | 100 | | |
108 | 101 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments