Lewati ke isi

UAT Setup & Execution Guide

Last Updated: 2026-03-17
Purpose: Quick setup guide untuk menjalankan UAT Inventory dan Kesiswaan/BK secara E2E
Database: scoladev


Prerequisites Checklist

Sebelum menjalankan UAT, pastikan environment sudah siap:

1. Backend Check (5 menit)

# Check Odoo backend running
ps aux | grep odoo-bin
# Expected: python3 odoo-bin --config config/scola-dev.conf -d scoladev

# If not running, start it:
cd /home/scola/odoo
./odoo-bin --config config/scola-dev.conf -d scoladev &

2. Frontend Check (5 menit)

# Check frontend dev server running
ps aux | grep vite
# Expected: node .../vite/bin/vite.js (port 5173)

# If not running, start it:
cd /home/scola/odoo/scola-fe-v2
npm run dev &

3. Database Modules Check (3 menit)

Login ke Odoo backend (http://localhost:8069) sebagai admin dan verify:

  • ✅ Module scola_inventory installed
  • ✅ Module scola_student_activity installed
  • ✅ Module scola_core installed
  • ✅ Module scola_parent installed
  • ✅ Module openeducat_core installed

Setup UAT Users

📌 Operational note: gunakan halaman User Management UI untuk setup kecil/manual, tetapi SSOT UAT sekarang ada di uat-scenarios.md dan testing-guidelines.md.

Best for: Creating < 20 users, one-time UAT setup, user-friendly approach

  1. Login to frontend as admin: http://localhost:5173
  2. Navigate to: AdminManajemen Pengguna or directly to /admin/users
  3. Click "Tambah Pengguna" button
  4. Fill in form for each user (see table below)
  5. Click "Buat Pengguna"

Pros: - ✅ No terminal access required - ✅ User-friendly GUI - ✅ Instant validation - ✅ Visual feedback

Cons: - ⚠️ Manual one-by-one creation - ⚠️ Not ideal for bulk (100+ users)

See: uat-scenarios.md for role/skenario yang perlu divalidasi setelah user dibuat.


UAT User Credentials

For easy reference when creating users via UI:

Inventory Module Users:

Name Username Password Scola Role Email
Admin Sarpras (Kepala TU) ka.tu katu123 head_admin [email protected]
Wakasek Sarpras wakasek.sarpras wakasek123 vice_principal_infrastructure [email protected]
Staf Pengadaan (Staf TU) staf.tu staftu123 admin_staff [email protected]
Bendahara bendahara bendahara123 treasurer [email protected]
Laboran laboran laboran123 lab_technician [email protected]

Kesiswaan/BK Module Users:

Name Username Password Scola Role Email
Guru BK (Counselor) bk_user bk123 counselor [email protected]
Wali Kelas (Homeroom) wali_user wali123 homeroom [email protected]
Wakasek Kesiswaan wakasek.kesiswaan wakasek123 vice_principal_student_affairs [email protected]
Kepala Sekolah kepsek kepsek123 principal [email protected]
Administrator admin admin admin [email protected]

Portal Users (Auto-created via script or op.student/op.parent records):

Name Username Password Scola Role Notes
UAT Student SICUAT001 student123 student Auto-created from op.student (NSN: 9000000001)
UAT Parent 3200000000000001 parent123 parent Auto-created from op.parent (NIK: 3200000000000001)

💡 Tip: Copy-paste these credentials when creating users via UI to ensure consistency with UAT documentation.


Option B: Via Python Scripts (Sequential Execution)

Best for: Bulk creation, automated UAT setup, scripted environments

cd /home/scola/odoo

# 1. Create Inventory UAT Users
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_inventory_uat_users.py

# 2. Create Kesiswaan/BK UAT Users
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_kesiswaan_uat_users.py

Expected Output:

=== Creating Inventory UAT Users ===
Created: ka.tu
Created: wakasek.sarpras
Created: staf.tu
Created: bendahara
Created: laboran
=== Users Created Successfully ===

=== Creating Kesiswaan/BK UAT Users ===
Created: bk_user
Created: wali_user
Created: wakasek.kesiswaan
Created: kepsek
Updated: admin
Created student: UAT Student (NSN 9000000001)
Ensured student user: SICUAT001
Created parent: UAT Parent (NIK 3200000000000001)
Ensured parent user: 3200000000000001
=== UAT Users Ready ===

Pros: - ✅ Fast bulk creation - ✅ Idempotent (can re-run safely) - ✅ Auto-assigns security groups - ✅ Creates linked records (student/parent)

Cons: - ⚠️ Requires terminal access - ⚠️ Less user-friendly for non-developers


Option C: Combined Script Wrapper (For Repeated UAT Resets)

If you need to re-run setup multiple times, create a wrapper:

cat > /home/scola/odoo/scripts/setup_all_uat_users.sh << 'EOF'
#!/bin/bash
echo "Setting up all UAT users for scoladev..."
cd /home/scola/odoo

echo "1. Creating Inventory UAT Users..."
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_inventory_uat_users.py

echo "2. Creating Kesiswaan/BK UAT Users..."
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_kesiswaan_uat_users.py

echo "✅ All UAT users created successfully!"
EOF

chmod +x /home/scola/odoo/scripts/setup_all_uat_users.sh
./scripts/setup_all_uat_users.sh

Verify User Setup

Manual Verification via Odoo Backend

  1. Login to Odoo as admin: http://localhost:8069
  2. Navigate to: Settings → Users & Companies → Users
  3. Search for each user and verify:

Inventory Users: - ka.tu - scola_role: head_admin - wakasek.sarpras - scola_role: vice_principal_infrastructure - staf.tu - scola_role: admin_staff - bendahara - scola_role: treasurer - laboran - scola_role: lab_technician

Kesiswaan Users: - bk_user - scola_role: counselor - wali_user - scola_role: homeroom - wakasek.kesiswaan - scola_role: vice_principal_student_affairs - kepsek - scola_role: principal - admin - scola_role: admin (or scola_is_admin: True)

Portal Users: - SICUAT001 (student login) - scola_role: student - 3200000000000001 (parent login) - scola_role: parent

API Verification (Quick Test)

# Test Inventory user login
curl -X POST http://127.0.0.1:8069/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"ka.tu","password":"katu123"}' | jq

# Test Kesiswaan user login
curl -X POST http://127.0.0.1:8069/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"bk_user","password":"bk123"}' | jq

# Test Student login
curl -X POST http://127.0.0.1:8069/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"SICUAT001","password":"student123"}' | jq

# Test Parent login
curl -X POST http://127.0.0.1:8069/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"3200000000000001","password":"parent123"}' | jq

Expected Response:

{
  "success": true,
  "user": {
    "id": ...,
    "name": "...",
    "role": "..."
  }
}


Inventory Sample Data

# Create sample products, locations, stock
cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf << 'PYTHON'
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})

# Create sample product category
category = env['scola.inventory.product.category'].create({
    'name': 'Office Supplies',
    'code': 'OFFICE',
})

# Create sample products
products = [
    {'name': 'Ballpoint Pen', 'code': 'PEN001', 'category_id': category.id, 'unit': 'pcs'},
    {'name': 'A4 Paper (Ream)', 'code': 'PAPER001', 'category_id': category.id, 'unit': 'ream'},
    {'name': 'Whiteboard Marker', 'code': 'MARKER001', 'category_id': category.id, 'unit': 'pcs'},
]

for p in products:
    env['scola.inventory.product'].create(p)

env.cr.commit()
print("✅ Sample inventory data created")
PYTHON

Kesiswaan Sample Data

# Create sample violation categories, achievement levels
cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf << 'PYTHON'
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})

# Create violation categories
categories = [
    {'name': 'Kerajinan', 'code': 'KERAJ', 'points': -5},
    {'name': 'Sikap', 'code': 'SIKAP', 'points': -10},
    {'name': 'Kerapian', 'code': 'RAPIH', 'points': -3},
]

for cat in categories:
    existing = env['scola.violation.category'].search([('code', '=', cat['code'])])
    if not existing:
        env['scola.violation.category'].create(cat)

# Create achievement levels
levels = [
    {'name': 'Kelas', 'code': 'KELAS', 'points': 5},
    {'name': 'Sekolah', 'code': 'SEKOLAH', 'points': 10},
    {'name': 'Kecamatan', 'code': 'KEC', 'points': 15},
    {'name': 'Kabupaten/Kota', 'code': 'KAB', 'points': 20},
    {'name': 'Provinsi', 'code': 'PROV', 'points': 30},
    {'name': 'Nasional', 'code': 'NAS', 'points': 50},
    {'name': 'Internasional', 'code': 'INTL', 'points': 100},
]

for level in levels:
    existing = env['scola.achievement.level'].search([('code', '=', level['code'])])
    if not existing:
        env['scola.achievement.level'].create(level)

env.cr.commit()
print("✅ Sample kesiswaan data created")
PYTHON

Run UAT Tests

Inventory UAT

Documentation: scola-fe-v2/docs/implementation/Inventory/INVENTORY_UAT_DOCUMENTATION.md

Quick Test Flow:

  1. Login as ka.tu / katu123
  2. Navigate to /inventory/products
  3. Create new product → SUCCESS
  4. Navigate to /inventory/stock
  5. View stock list → SUCCESS
  6. Navigate to /inventory/procurement/requests
  7. Create purchase request → SUCCESS

Critical Scenarios (30-45 mins each): - SC-01: Master Data (Produk, Lokasi, Gudang) - SC-03: Pengadaan: Purchase Request & Order - SC-06: Asset Register & Label - SC-09: Stock Opname

Kesiswaan/BK UAT

Documentation: scola-fe-v2/docs/implementation/Kesiswaan/KESISWAAN_BK_UAT_DOCUMENTATION.md

Quick Test Flow:

  1. Login as bk_user / bk123
  2. Navigate to /counseling/dashboard
  3. View dashboard → SUCCESS
  4. Navigate to /counseling/violations
  5. Create new violation report → SUCCESS
  6. Navigate to /counseling/student-timeline
  7. Select student UAT Student → Timeline renders → SUCCESS

Critical Scenarios (30-45 mins each): - Skenario 1: Pencatatan Pelanggaran Lengkap - Skenario 2: Pencatatan dan Approval Prestasi - Skenario 3: Penanganan Kasus Konseling - Skenario 7: Pengajuan Izin Siswa


Troubleshooting

Issue: User login fails with "Access Denied"

Cause: Security groups not assigned

Fix:

# Re-run the UAT setup scripts
cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_inventory_uat_users.py
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_kesiswaan_uat_users.py

Issue: Menu items not showing in frontend

Cause: Role capability check failing or ACL backend mismatch

Fix:

# Check user scola_role assignment
cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf << 'PYTHON'
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
user = env['res.users'].search([('login', '=', 'bk_user')])
print(f"User: {user.name}")
print(f"Scola Role: {user.scola_role}")
print(f"Groups: {user.groups_id.mapped('name')}")
PYTHON

Issue: Routes return 404 or redirect

Cause: Frontend routes not matching documentation

Verify:

# Check actual routes in codebase
grep -r "path.*counseling/violations" scola-fe-v2/src/router/
grep -r "path.*inventory/products" scola-fe-v2/src/router/

Issue: Student/Parent login fails

Cause: Student or parent user not created properly

Fix:

# Check if student/parent exist
cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf << 'PYTHON'
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})

student = env['op.student'].search([('nsn', '=', '9000000001')])
print(f"Student: {student.full_name if student else 'NOT FOUND'}")
print(f"Student User: {student.user_id.login if student and student.user_id else 'NO USER'}")

parent = env['op.parent'].search([('nik', '=', '3200000000000001')])
print(f"Parent: {parent.parent_name if parent else 'NOT FOUND'}")
print(f"Parent User: {parent.user_id.login if parent and parent.user_id else 'NO USER'}")
PYTHON

# If not found, re-run Kesiswaan setup script
./odoo-bin shell -d scoladev -c config/scola-dev.conf < custom_addons_scola/gcgscola/create_kesiswaan_uat_users.py


UAT Completion Checklist

Inventory UAT

  • [ ] All test users login successfully
  • [ ] Master data CRUD works (products, locations)
  • [ ] Purchase request/order flow complete
  • [ ] Asset register and inspection works
  • [ ] Stock opname creates and validates
  • [ ] Audit log shows activities
  • [ ] RBAC prevents unauthorized access

Kesiswaan/BK UAT

  • [ ] All test users login successfully
  • [ ] Violation CRUD and approval works
  • [ ] Achievement CRUD and approval works
  • [ ] Counseling case management works
  • [ ] Timeline shows integrated history
  • [ ] Incident TPPK workflow works
  • [ ] Student permit approval works
  • [ ] Extracurricular enrollment works
  • [ ] Privacy mode enforced on sensitive data
  • [ ] ACL backend guards menu visibility

Post-UAT Cleanup (Optional)

If you need to reset UAT users for fresh testing:

cd /home/scola/odoo
./odoo-bin shell -d scoladev -c config/scola-dev.conf << 'PYTHON'
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})

# Delete UAT users (except admin)
uat_logins = [
    'ka.tu', 'wakasek.sarpras', 'staf.tu', 'bendahara', 'laboran',
    'bk_user', 'wali_user', 'wakasek.kesiswaan', 'kepsek',
    'SICUAT001', '3200000000000001'
]

for login in uat_logins:
    user = env['res.users'].search([('login', '=', login)])
    if user:
        user.active = False
        print(f"Deactivated: {login}")

env.cr.commit()
print("✅ UAT users deactivated. Re-run setup scripts to recreate.")
PYTHON

References