Skip to content

Commit 07ad82d

Browse files
author
John75SunCity
committed
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 features
1 parent f890703 commit 07ad82d

File tree

4 files changed

+53
-26
lines changed

4 files changed

+53
-26
lines changed

records_management/__manifest__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Records Management - Enterprise Edition",
3-
'version': '18.0.1.0.17',
3+
'version': '18.0.1.0.18',
44
'category': 'Productivity/Records',
55
"summary": "Complete Enterprise Records Management System with NAID AAA Compliance",
66
"description": "Records Management - Enterprise Grade DMS Module. Enterprise physical & digital records lifecycle, NAID AAA + ISO 15489 compliance, portal, shredding, retention, audit, billing.",
@@ -72,6 +72,7 @@
7272
"security/intelligent_search_security.xml",
7373
"security/naid_security.xml",
7474
"security/portal_request_security.xml",
75+
"security/portal_organization_security.xml",
7576
"security/work_order_portal_rules.xml",
7677
"security/portal_container_rules.xml",
7778
"security/portal_document_rules.xml",

records_management/data/website_pages.xml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,29 +92,20 @@
9292
</div>
9393
</div>
9494

95-
<!-- Row 3: NEW Features (Previously Hidden) -->
95+
<!-- Row 3: Advanced Features -->
9696
<div class="row mt-4">
97-
<div class="col-lg-4 mb-4">
98-
<div class="card h-100 border-primary">
99-
<div class="card-body text-center">
100-
<i class="fa fa-barcode fa-3x text-primary mb-3"></i>
101-
<h4 class="card-title">Barcode Scanner</h4>
102-
<p class="card-text">Scan containers, files, and items for quick access</p>
103-
<a href="/my/barcode/main" class="btn btn-primary">Launch Scanner</a>
104-
</div>
105-
</div>
106-
</div>
107-
<div class="col-lg-4 mb-4">
97+
<div class="col-lg-6 mb-4">
10898
<div class="card h-100 border-success">
10999
<div class="card-body text-center">
110100
<i class="fa fa-sitemap fa-3x text-success mb-3"></i>
111-
<h4 class="card-title">Organization</h4>
101+
<h4 class="card-title">Organization Chart</h4>
112102
<p class="card-text">View your team hierarchy and manage contacts</p>
103+
<span class="badge badge-warning mb-2">Company Admin Only</span>
113104
<a href="/my/organization" class="btn btn-success">View Organization</a>
114105
</div>
115106
</div>
116107
</div>
117-
<div class="col-lg-4 mb-4">
108+
<div class="col-lg-6 mb-4">
118109
<div class="card h-100 border-info">
119110
<div class="card-body text-center">
120111
<i class="fa fa-search fa-3x text-info mb-3"></i>

records_management/data/website_portal_menus.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<odoo>
33
<data noupdate="0">
44
<!-- ================================================================== -->
5-
<!-- WEBSITE PORTAL MENU CONFIGURATION - OPTIMIZED HIERARCHY -->
5+
<!-- WEBSITE PORTAL MENU CONFIGURATION - OPTIMIZED HIERARCHY -->
66
<!-- Portal Hub as main menu with all portal features as children -->
77
<!-- ================================================================== -->
88

@@ -89,20 +89,13 @@
8989
<field name="sequence">80</field>
9090
</record>
9191

92-
<!-- Barcode Scanner Hub (NEW - Previously Hidden) -->
93-
<record id="portal_menu_barcode_scanner" model="website.menu">
94-
<field name="name">Barcode Scanner</field>
95-
<field name="url">/my/barcode/main</field>
96-
<field name="parent_id" ref="portal_hub_main_menu"/>
97-
<field name="sequence">60</field>
98-
</record>
99-
100-
<!-- Organization Chart (NEW - Previously Hidden) -->
92+
<!-- Organization Chart (Company Admin Only) -->
10193
<record id="portal_menu_organization" model="website.menu">
10294
<field name="name">Organization</field>
10395
<field name="url">/my/organization</field>
10496
<field name="parent_id" ref="portal_hub_main_menu"/>
105-
<field name="sequence">90</field>
97+
<field name="sequence">60</field>
98+
<field name="groups_id" eval="[(4, ref('records_management.group_portal_company_admin'))]" />
10699
</record>
107100

108101
</data>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data noupdate="1">
4+
<!-- ================================================================== -->
5+
<!-- PORTAL ORGANIZATION CHART SECURITY RULES -->
6+
<!-- Ensures portal company admins can view their organization hierarchy -->
7+
<!-- ================================================================== -->
8+
9+
<!-- Portal Company Admin: Can view organization hierarchy (res.partner) -->
10+
<!-- NOTE: res.partner already has base portal rules, but we need to ensure -->
11+
<!-- organization chart viewing works properly with commercial_partner_id -->
12+
<record id="res_partner_portal_organization_rule" model="ir.rule">
13+
<field name="name">res.partner: Portal organization chart access</field>
14+
<field name="model_id" ref="base.model_res_partner"/>
15+
<field name="domain_force">[
16+
'|',
17+
('id', 'child_of', user.partner_id.commercial_partner_id.id),
18+
('id', '=', user.partner_id.commercial_partner_id.id)
19+
]</field>
20+
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
21+
<field name="perm_read" eval="True"/>
22+
<field name="perm_write" eval="False"/>
23+
<field name="perm_create" eval="False"/>
24+
<field name="perm_unlink" eval="False"/>
25+
</record>
26+
27+
<!-- Portal Company Admin: Can create sub-contacts in their organization -->
28+
<record id="res_partner_portal_company_admin_create_rule" model="ir.rule">
29+
<field name="name">res.partner: Portal company admin can add team members</field>
30+
<field name="model_id" ref="base.model_res_partner"/>
31+
<field name="domain_force">[
32+
('parent_id', 'child_of', user.partner_id.commercial_partner_id.id)
33+
]</field>
34+
<field name="groups" eval="[(4, ref('records_management.group_portal_company_admin'))]"/>
35+
<field name="perm_read" eval="True"/>
36+
<field name="perm_write" eval="False"/>
37+
<field name="perm_create" eval="True"/>
38+
<field name="perm_unlink" eval="False"/>
39+
</record>
40+
41+
</data>
42+
</odoo>

0 commit comments

Comments
 (0)