Bash
Overview
The PPID System Architecture
+--------------------+ +----------------------+ +-------------------+
| Public Website | | Odoo Backend | | Database |
| (QWeb Frontend) | | (Custom Module) | | (PostgreSQL 16) |
| | | | | |
| Beranda |<--->| ppid.permohonan |<--->| permohonan |
| Permohonan Form | | ppid.keberatan | | keberatan |
| Keberatan Form | | ppid.sengketa | | sengketa |
| Status Tracking | | REST API Controllers | | tanggapan |
| Profil PPID | | Wizard (Email) | | users / partners |
+--------------------+ +----------------------+ +-------------------+
| |
+--------[ Docker ]---------+
odoo:18.0 + postgres:16
Step One: Project Structure
File Structure
odoo-ppid19/
├── docker-compose.yml # Docker stack (Odoo + PostgreSQL)
├── .gitignore
├── README.md
└── addons/
└── ppid/
├── __manifest__.py # Module manifest & dependencies
├── __init__.py
├── controllers/
│ ├── api_controller.py # REST API (permohonan, keberatan, tanggapan)
│ ├── auth_controller.py # Auth, register, profile endpoints
│ ├── main_controller.py # Main web controller
│ └── website_controller.py
├── models/
│ ├── permohonan.py # Information request model
│ ├── keberatan.py # Objection model
│ ├── sengketa.py # Dispute resolution model
│ ├── sidang.py # Hearing/session model
│ ├── tanggapan.py # Response to permohonan
│ ├── tanggapan_keberatan.py
│ ├── kategori.py # Information category
│ ├── kategori_pemohon.py # Applicant category
│ ├── alasan_pengajuan.py # Objection reasons
│ ├── res_users.py # Extended user model
│ └── res_partner.py # Extended partner model
├── views/
│ ├── beranda.xml # Home page
│ ├── navbar.xml # Navigation bar
│ ├── footer.xml # Footer
│ ├── permohonan_views.xml
│ ├── keberatan_views.xml
│ ├── sengketa_views.xml
│ ├── profil/ # Profile subpages
│ ├── layanan/ # Service subpages
│ └── tata_cara/ # Procedure subpages
├── wizard/
│ ├── penerimaan.py # Accept wizard (email)
│ └── penolakan.py # Reject wizard (email)
├── security/
│ ├── ppid_security.xml # Groups: Staff & Manager
│ └── ir.model.access.csv
├── data/
│ └── website_pages.xml
└── static/
└── src/
├── css/ # Custom stylesheets
└── js/ # Custom JavaScript
Docker Deployment
Yaml
Bash
Step Two: Module Manifest & Dependencies
Python
- base — Core Odoo models
- website — QWeb website engine and routing
- mail — Chatter, followers, email notifications (mail.thread)
- auth_signup — Public user registration support
Step Three: Core Data Models
Permohonan (Information Request)
Python
Status projectsflow
verifikasi
│
▼ [Proses]
permohonan_diproses
│
├──▶ [Terima] permohonan_dikabulkan_seluruhnya
├──▶ [Terima Sebagian] permohonan_dikabulkan_sebagian
└──▶ [Tolak] permohonan_ditolak
Python
Keberatan (Objection)
Python
Sengketa (Dispute Resolution)
Python
Data Model Relationships
res.users
│
├──▶ ppid.permohonan ──▶ ppid.tanggapan
│ │
│ └──▶ ppid.sengketa ──▶ ppid.sidang
│
└──▶ ppid.keberatan ──▶ ppid.tanggapan_keberatan
│
└──▶ ppid.sengketa
Step Four: REST API Endpoints
Authentication
POST /api/auth/token # Get access token (login + password + db)
POST /api/register # Register new citizen account
GET /api/profile # Get current user profile
POST /api/gantipassword # Change user password
Permohonan Endpoints
GET /api/permohonan # List user's permohonan (paginated, 20/page)
POST /api/permohonan/create # Submit new permohonan
GET /api/permohonan/<id> # Get single permohonan detail
Keberatan Endpoints
GET /api/keberatan # List user's keberatan (paginated)
POST /api/keberatan/create # Submit new keberatan
GET /api/keberatan/<id> # Get single keberatan detail
Tanggapan (Response) Endpoints
GET /api/tanggapan?permohonan_id= # Get responses for a permohonan
POST /api/tanggapan/create # Add response to permohonan
GET /api/tanggapan_keberatan?keberatan_id=
POST /api/tanggapan_keberatan/create
GET /api/alasan_pengajuan # List objection reasons (public)
API Controller Sample
Python
Graceful Fallback for restful Addon
Python
Step Five: QWeb Frontend — Laravel to Odoo Migration
Conversion Reference
Website Page Structure
/beranda # Home page with hero, services, procedures
/profil/seputar-ppid # About PPID
/profil/struktur-organisasi # Organizational structure
/profil/visi-misi # Vision & mission
/profil/regulasi # Regulations
/profil/jadwal-layanan # Service schedule
/profil/standar-layanan # Service standards
/tata-cara/permohonan-informasi # How to request information
/tata-cara/pengajuan-keberatan # How to file an objection
/layanan/permohonan-informasi # Request information form
/layanan/permohonan-keberatan # File objection form
/layanan/laporan-layanan-informasi # Service reports
Navbar Template (QWeb)
Xml
Design System
Css
Step Six: Email Wizards (Acceptance & Rejection)
Acceptance Wizard Trigger
Python
Step Seven: Security & Access Control
Xml
Access Control Matrix
Optimization Tips
Auto-Expire Permohonan After 3 Days
Python
Timezone-Aware API Responses
Python
Chatter Integration for Audit Trail
Python
Feature Comparison Table
Running the Project
Bash
- Backend: http://localhost:8069/web → Apps → PPID
- Frontend: http://localhost:8069/beranda