Staging Helpdesk Change Log & Knowledge Base (KB) Registry¶
Publisher: Flavius Narokobi
Target Environment: Staging (cpl_real_rewards_staging on https://angry-mad-smile.cpl.com.pg)
Document Status: Approved & Baseline Verified
Last Updated: October 2026
Document Control Log¶
| Revision | Date | Author / Publisher | Description of Changes | Linked Tickets / KB |
|---|---|---|---|---|
| v1.0 | 2026-10-04 | Flavius Narokobi | Initial creation of Staging Change Log & Knowledge Base Registry for 10 core modules. | STG-TICK-001 to STG-TICK-010 KB-001 to KB-010 |
| v1.4 | 2026-10-04 | Flavius Narokobi | Resolved Executive Dashboard Dynamic KPI 0-value display with dynamic SQL aggregation. | STG-TICK-016 KB-016 |
| v1.5 | 2026-10-04 | Flavius Narokobi | Added physical retail Shop Location per member Loyalty Ledger & POS Points with 5W1H audit. | STG-TICK-017 KB-017 |
| v1.6 | 2026-10-04 | Flavius Narokobi | Standardized CPL Retail Shop Taxonomy: Unified all Stop & Shop locations to 'CP |
STG-TICK-017 KB-017 |
| v1.7 | 2026-10-04 | Flavius Narokobi | Eliminated 'Partners/' hierarchy prefix from retail store locations and member ledger: Unlinked parent from stock locations and rendered direct related field shop_name. |
STG-TICK-017 KB-017 |
| v1.8 | 2026-10-04 | Flavius Narokobi | Configured dedicated 'True Loyal->Odoo' location for all 117,214 manual opening balance adjustments and auto-assignment hook. | STG-TICK-017 KB-017 |
| v1.9 | 2026-10-04 | Flavius Narokobi | Dynamic Member Primary Retail Store Location Badge: Computed most frequent physical retail store from POS loyalty transactions and rendered on Member Form header and Kanban cards. | STG-TICK-018 KB-018 |
Staging Helpdesk & KB Overview¶
[!TIP]
How to Find Tickets & KB Articles in the Odoo Staging Interface¶
- Log in to Staging Odoo:
https://angry-mad-smile.cpl.com.pg(Credentials:admin/<REDACTED_PASSWORD>- contact System Administrator).- Open the main application switcher (top-left menu icon) and select CPL Real Rewards.
- Locate the top navigation tab:
Staging Helpdesk & Change Audit.- Under this menu, you can select:
Staging Change Tickets: View interactive Kanban board and list view of all tickets (STG-TICK-001throughSTG-TICK-018+).Knowledge Base (KB) Articles: View Knowledge Base articles (KB-001throughKB-018+) containing root cause analysis, resolution steps, and CLI verification commands.- Direct View Links:
- Open Staging Tickets Kanban Board
- Open Knowledge Base Article List
The Staging Helpdesk & Knowledge Base Module is installed exclusively in the Staging Environment (cpl_real_rewards_staging) to track all system architectural enhancements, bug fixes, data migration pipelines, and security guard rails. Every change made to the staging codebase and database schema corresponds to a dedicated Staging Change Ticket (STG-TICK-xxx) and an associated Knowledge Base Article (KB-xxx).
This document serves as the central documentation bridge connecting the Staging Odoo Helpdesk UI with the live MkDocs Technical Manuals.
Summary Registry of Staging Change Tickets & KB Articles¶
| Ticket ID | Category | Module Title | KB Article ID | Target Manual | Stage |
|---|---|---|---|---|---|
| STG-TICK-001 | pos_importer |
POS Importer CSV Header Offset & DictReader Parsing | KB-001 | Admin Manual | Resolved |
| STG-TICK-002 | card_replacements |
Pronto Legacy Replacement Cards Ingestion & Mapping | KB-002 | Store Staff Guide | Resolved |
| STG-TICK-003 | readonly_security |
Read-Only Loyalty Ledger Security & Guard Rails | KB-003 | SysAdmin Manual | Resolved |
| STG-TICK-004 | smart_search |
Multi-Token Smart Search Engine & Split-Name Query | KB-004 | Store Staff Guide | Resolved |
| STG-TICK-005 | quarantined_queue |
Quarantined Cards Queue & Isolation Protocol | KB-005 | Store Staff Guide | Resolved |
| STG-TICK-006 | maker_checker |
Maker-Checker Profile Add/Change Request Workflow | KB-006 | Maker Manual | Resolved |
| STG-TICK-007 | executive_dashboard |
Executive Dashboard Analytics & Legend Computation | KB-007 | Admin Manual | Resolved |
| STG-TICK-008 | daily_accounting |
Daily Points Accounting Ledger Reconciliation | KB-008 | Admin Manual | Resolved |
| STG-TICK-009 | user_admin |
User Administration & Inactive Account Isolation | KB-009 | SysAdmin Manual | Resolved |
| STG-TICK-018 | primary_store |
Dynamic Member Primary Retail Store Badge (Header & Kanban) | KB-018 | Store Staff Guide | Resolved |
| STG-TICK-019 | configuration |
Live Production Cutover: 100% Mathematical Parity & Golden Record Sync | KB-019 | Cutover Master Report | Resolved |
| STG-TICK-020 | quarantined_queue |
Quarantined Cards Queue Architecture & Maker-Checker Governance | KB-020 | SOP-01 Quarantine Queue | Closed |
| STG-TICK-021 | card_replacements |
Pronto Replacement Cards Lineage & RFC-4122 v4 Member UUID Enforcement | KB-021 | SOP-03 Card Replacements | Resolved |
| STG-TICK-022 | reporting |
Instant Headerless Active Cards CSV Feed for Pronto ERP/POS | KB-022 | Store Staff Guide | Resolved |
| STG-TICK-023 | maker_checker |
UAT: Maker-Checker Segregation of Duties & Self-Approval Prevention | KB-023 | Maker Manual | Resolved |
| STG-TICK-024 | quarantined_queue |
UAT: Quarantined Cards Queue Claim & Point Transfer Workflow | KB-024 | Checker Manual | Resolved |
| STG-TICK-025 | card_replacements |
UAT: Card Replacement & Immutable UUID Lineage Preservation | KB-025 | Maker Manual | Resolved |
| STG-TICK-026 | security_rbac |
UAT: Blocked Cards Security, POS Till Lockout & Audit Unblock Protocol | KB-026 | Checker Manual | Resolved |
| STG-TICK-027 | security_access |
POS Order Read Access for Store Makers/Checkers & Real-Time Exception Alerting | KB-027 | Store Staff Guide | Resolved |
| STG-TICK-028 | card_replacements |
Pronto Replacement Cards Inversion Realignment & Active Card Promotion | KB-028 | SOP-03 Card Replacements | Resolved |
| STG-TICK-029 | security_access |
Staging KB & Ticket Selection Choices Expansion & Read-Only Access Enforcement | KB-029 | Change Log & KB | Closed |
| STG-TICK-030 | reporting |
True Loyal 05/09 Historical Points Ingestion (Col I/J) & POS Return Clearance Date Backdating | KB-030 | Cutover Master Report | Closed |
| STG-TICK-031 | security_access |
Store Staff RBAC Hardening: Restrict Manual Points Adjustments to Head Office Checkers & Admins | KB-031 | Security & RBAC | Closed |
| STG-TICK-032 | governance |
Store Staff RBAC Hardening: Restrict Claimed / Unclaimed Orphaned Accounts Queue & Workflow to Head Office Checkers & Admins | KB-032 | Security & RBAC | Closed |
| STG-TICK-033 | maker_checker |
Checker Approval Notifications & MS Graph RFC 2822 Recipient Address Resolution Fix | KB-033 | Checker Manual | Closed |
| STG-TICK-034 | system_incident |
Automated System Incident Ingestion, 1-Hour De-duplication & Ticketed Email Notification Dispatch | KB-034 | Gatekeeper Pipeline | Closed |
| STG-TICK-035 | maker_checker |
Member Service Request Photo Attachment Race Condition & Camille JB Bendoy Profile Photo Mismatch Resolution | KB-035 | Checker Manual | Closed |
| STG-TICK-036 | reporting |
Operational & User Metrics Telemetry: SLA Turnaround, Store Activity Leaderboard & Friction Monitor | KB-036 | Gatekeeper Pipeline | Closed |
| STG-TICK-037 | performance |
GCP 100% CPU Alert Stabilization: Set-Based SQL Optimization for 2-Year Point Expiration & Member Segmentation Crons | KB-037 | Gatekeeper Pipeline | Closed |
| STG-TICK-038 | maker_checker |
Checker Approval Email & Systray Notification Preference Toggle on res.users | KB-038 | Gatekeeper Pipeline | Closed |
| STG-TICK-039 | pos_importer |
ERP Staff Pronto POS Daily Transaction Ingestion Guide & Ingestion SOP | KB-039 | ERP Ingestion Guide | Closed |
| STG-TICK-040 | pos_importer |
Pronto POS 10-Digit Sales Order Range Expansion & Redemption Completion Recovery | KB-040 | Store Redemptions SOP | Closed |
| STG-TICK-041 | pos_importer |
Admin Return & Refund Completed Redemption Workflow, BigInt ORM Field Mapping, and Alert Staging Routing | KB-041 | Store Redemptions SOP | Closed |
| STG-TICK-042 | security |
Odoo Discuss ChannelSelector UncaughtPromiseError: OdooBot Inactive Partner Suggestion Crash Mitigation | KB-042 | Gatekeeper Pipeline | Closed |
| STG-TICK-043 | maker_checker |
Maker-Checker Correction & Resubmission Lifecycle: Draft Reopen, Email Alerts & Activity Reminders | KB-043 | Maker Manual | Closed |
Detailed Ticket & KB Rationale Breakdown¶
Module 1: POS Importer CSV Header Offset & DictReader Parsing¶
- Ticket Code:
STG-TICK-001 - KB Article Code:
KB-001 - Category:
pos_importer| Priority: High (2) | Stage: Resolved - Documentation Link: Odoo Admin Manual
Rationale & Change Reason¶
The raw CSV export cplgroup_users_05_Sep_2026_1788606981.MAINLIST.csv contained two non-standard metadata header lines before column names. Standard csv.DictReader failed without skipping the initial metadata rows, resulting in misaligned column headers.
Technical Resolution Summary¶
Executed next(f) twice before initializing DictReader. Integrated seen_member_ids set deduplication to enforce rrp_card_number uniqueness and used PostgreSQL SET session_replication_role = 'replica'; for high-speed bulk ingestion of 136,702 records in under 31 seconds.
Problem Statement & Root Cause¶
- Problem: CSV file contains metadata headers on lines 1-2, causing
DictReaderto mismatch column names. - Root Cause: Zinrelo legacy export prepends metadata comments before column headers.
Step-by-Step Guide¶
- Open CSV file in Python with
utf-8encoding. - Call
next(f)twice before initializingcsv.DictReader(f). - Use in-memory
seen_member_ids = set()to skip duplicate member cards. - Execute
SET session_replication_role = 'replica';during bulkINSERTto bypass foreign key trigger overhead.
Verification Command¶
Module 2: Pronto Legacy Replacement Cards Ingestion & Mapping¶
- Ticket Code:
STG-TICK-002 - KB Article Code:
KB-002 - Category:
card_replacements| Priority: High (2) | Stage: Resolved - Documentation Link: Store Staff Operating Guide
Rationale & Change Reason¶
15,323 legacy Pronto physical card replacements needed complete audit lineage mapping back to active golden customer accounts without corrupting primary member card numbers.
Technical Resolution Summary¶
Populated model real.rewards.card.replacement.log with old_card_number, new_card_number, and date_replaced from Cards in Pronto replacement.csv. Exposed in Store Staff UI under Card Replacements Log.
Problem Statement & Root Cause¶
- Problem: Legacy Pronto ERP card numbers differed from Zinrelo active card numbers.
- Root Cause: Customers were issued replacement cards in stores without immediate central database update.
Step-by-Step Guide¶
- Load
Cards in Pronto replacement.csvmapping Card Number to Zinrelo Member ID. - Match Zinrelo Member ID to
res_partner.rrp_card_number. - Insert old card numbers into
real.rewards.card.replacement.logwithreplacement_reason='other'. - Expose log view under CPL Real Rewards -> Configuration -> Card Replacements Log.
Verification Command¶
Module 3: Read-Only Loyalty Ledger Security & Guard Rails¶
- Ticket Code:
STG-TICK-003 - KB Article Code:
KB-003 - Category:
readonly_security| Priority: Critical (3) | Stage: Resolved - Documentation Link: System Administrator Manual
Rationale & Change Reason¶
User identified risk of manual ledger tampering in form view (real.rewards.loyalty.ledger). Historical points entries must be strictly immutable to maintain financial integrity.
Technical Resolution Summary¶
Implemented ORM security overrides blocking write() and unlink() on real.rewards.loyalty.ledger, raising UserError if edit is attempted. Form XML updated with create="false" edit="false" delete="false" attributes.
Problem Statement & Root Cause¶
- Problem: Users or admins could potentially tamper with historical earned/redeemed points ledger records.
- Root Cause: Default Odoo model permissions allow write and unlink operations for base user groups.
Step-by-Step Guide¶
- Override
write()method inreal_rewards_loyalty_ledger.pyto raiseUserError(_('Loyalty Ledger records are read-only and immutable.')). - Override
unlink()method to block deletion. - Set
create="false" edit="false" delete="false"in XML viewloyalty_ledger_views.xml.
Verification Command¶
Module 4: Multi-Token Smart Search Engine & Split-Name Query Tuning¶
- Ticket Code:
STG-TICK-004 - KB Article Code:
KB-004 - Category:
smart_search| Priority: High (2) | Stage: Resolved - Documentation Link: Store Staff Operating Guide
Rationale & Change Reason¶
POS store staff searched for member accounts using split/partial full names (e.g. 'Valo Margaret' matching 'Margaret Valo Frank'). Standard Odoo ilike failed on transposed words.
Technical Resolution Summary¶
Overrode _name_search on res.partner to tokenize search queries into word arrays, building dynamic AND/OR domain trees. Updated _name_search return signature to return <Query> object matching Odoo 17 API contract.
Problem Statement & Root Cause¶
- Problem: Searching 'Valo Margaret' returned 0 results when database contained 'Margaret Valo Frank'.
- Root Cause: Standard SQL
ilikesearches for exact contiguous substring 'Valo Margaret'.
Step-by-Step Guide¶
- Override
_name_searchinres_partner.py. - Split search string into token list:
words = name.split(). - Construct dynamic domain matching each token against name, email, ref, phone, and card number.
- Return
self._search(domain, limit=limit, order=order)to conform with Odoo 17 Query API.
Verification Command¶
docker exec odoo_staging_web python3 -c "import odoo; ... env['res.partner'].name_search('Valo Margaret')"
Module 5: Quarantined Cards Queue & Isolation Protocol¶
- Ticket Code:
STG-TICK-005 - KB Article Code:
KB-005 - Category:
quarantined_queue| Priority: High (2) | Stage: Resolved - Documentation Link: Store Staff Operating Guide
Rationale & Change Reason¶
Blocked, suspicious, or unverified Pronto cards (2,492 cards / 15,798 transaction lines) required full isolation outside active customer database to prevent liability leakage.
Technical Resolution Summary¶
Implemented read-only Unclaimed Accounts Queue view (is_unclaimed_record = True) with Maker-Checker claim workflow.
Problem Statement & Root Cause¶
- Problem: Unclaimed points and blocked legacy cards risk liability leakage if merged blindly into active profiles.
- Root Cause: Legacy Pronto cards with incomplete customer metadata.
Step-by-Step Guide¶
- Flag incomplete profiles with
is_unclaimed_record = True. - Expose read-only view under Unclaimed Accounts Queue.
- Require Maker-Checker approval before re-assigning quarantined points to verified customer profiles.
Verification Command¶
Module 6: Maker-Checker Profile Add/Change Request Workflow¶
- Ticket Code:
STG-TICK-006 - KB Article Code:
KB-006 - Category:
maker_checker| Priority: High (2) | Stage: Resolved - Documentation Link: Maker Operating Manual
Rationale & Change Reason¶
Store staff (Makers) should not be able to directly modify sensitive customer profile fields or points balances. Modifications must require supervisor (Checker) approval.
Technical Resolution Summary¶
Created real.rewards.profile.change.request model. Makers submit change requests; Checkers review and click 'Approve & Apply' or 'Reject'.
Problem Statement & Root Cause¶
- Problem: Direct profile edits by store staff create compliance and fraud risks.
- Root Cause: Lack of dual-control approval workflow for sensitive partner modifications.
Step-by-Step Guide¶
- Maker submits change request in Member Add/Change Requests view.
- Request status defaults to
draftorsubmitted. - Checker opens request, verifies supporting documentation, and clicks Approve & Apply.
- System writes changes to
res_partnerand logs audit record.
Verification Command¶
Module 7: Executive Dashboard Analytics & Legend Computation¶
- Ticket Code:
STG-TICK-007 - KB Article Code:
KB-007 - Category:
executive_dashboard| Priority: Medium (1) | Stage: Resolved - Documentation Link: Odoo Admin Manual
Rationale & Change Reason¶
Executive management required real-time visibility into total active members, baseline points, redemptions, and daily store transactions.
Technical Resolution Summary¶
Built custom Odoo dashboard view (real.rewards.dashboard) computing total member metrics and color-coded KPI legend badges.
Problem Statement & Root Cause¶
- Problem: Executive management lacks single-pane-of-glass overview of Real Rewards program performance.
- Root Cause: Disparate reporting across legacy CSV spreadsheets.
Step-by-Step Guide¶
- Navigate to CPL Real Rewards -> Dashboard.
- Review KPI metrics: Active Members (136,702), Baseline Points (433.4M), Card Replacements (15,323).
- Click metric tiles to drill down into filtered recordsets.
Verification Command¶
Module 8: Daily Points Accounting Ledger Reconciliation¶
- Ticket Code:
STG-TICK-008 - KB Article Code:
KB-008 - Category:
daily_accounting| Priority: High (2) | Stage: Resolved - Documentation Link: Odoo Admin Manual
Rationale & Change Reason¶
Financial auditors required daily rollup snapshots of points earned, points redeemed, and net liability carryover.
Technical Resolution Summary¶
Created real.rewards.daily.points.accounting model with automated cron job compiling daily points snapshots per store brand.
Problem Statement & Root Cause¶
- Problem: Auditors require daily reconciliation of loyalty points issued vs redeemed across City Pharmacy, Hardware Haus, and DFS.
- Root Cause: Financial audit compliance requirement for loyalty program balance sheet accounting.
Step-by-Step Guide¶
- Open Reporting -> Daily Points Accounting.
- Inspect daily store rollups, earned points, redeemed points, and closing liability balance.
- Export accounting ledger to CSV/Excel for external financial audit.
Verification Command¶
Module 9: User Administration & Inactive Account Security Isolation¶
- Ticket Code:
STG-TICK-009 - KB Article Code:
KB-009 - Category:
user_admin| Priority: Critical (3) | Stage: Resolved - Documentation Link: System Administrator Manual
Rationale & Change Reason¶
Inactive administrator accounts (e.g., Simon Peter) needed strict security isolation (active = False) to prevent unauthorized login access.
Technical Resolution Summary¶
Configured RBAC groups (group_real_rewards_admin, group_loyalty_maker, group_loyalty_checker). Verified active = False on deactivated users.
Problem Statement & Root Cause¶
- Problem: Deactivated staff accounts must not retain access to staging or production Odoo environments.
- Root Cause: User offboarding security policy enforcement.
Step-by-Step Guide¶
- Navigate to Configuration -> User Role Management.
- Select user profile and toggle Active switch to OFF (
active = False). - Assign RBAC groups: Maker, Checker, or Admin.
- Test login authentication to confirm session is blocked.
Verification Command¶
Module 10: Live MkDocs Documentation & Document Control Standard¶
- Ticket Code:
STG-TICK-010 - KB Article Code:
KB-010 - Category:
documentation| Priority: Medium (1) | Stage: Resolved - Documentation Link: Docs Home Overview
Rationale & Change Reason¶
User mandated that all manuals on https://docs.cpl.com.pg/ must display 'Publisher: Flavius Narokobi' and maintain a detailed document control log.
Technical Resolution Summary¶
Configured MkDocs host build pipeline serving from /var/www/html/. Updated all manual headers and control logs with Publisher metadata.
Problem Statement & Root Cause¶
- Problem: Documentation site needs automated building and consistent document control log formatting.
- Root Cause: Standardized publication workflow requirement.
Step-by-Step Guide¶
- Edit markdown files in
/home/lucius_fox/ODOO/docs/. - Ensure Document Control Log table includes
Publisher: Flavius Narokobi. - Run
mkdocs build -d /var/www/html/to update static site onhttps://docs.cpl.com.pg/.
Verification Command¶
Module 11: Member Loyalty Ledger Physical Retail Shop Attribution & CPL Brand Taxonomy Standardization¶
- Ticket Code:
STG-TICK-017 - KB Article Code:
KB-017 - Category:
feature| Priority: High (1) | Stage: Resolved & Verified - Documentation Link: Staging E2E UAT Run
5W1H Problem Audit & Technical Investigation¶
- WHO: Requested by Business Stakeholders & Flavius Narokobi (Real Rewards Admin); Designed, implemented, and audited by Flavius Narokobi (Lead Loyalty Engineer).
- WHAT: Standardized CPL retail store brand taxonomy and enhanced Member Loyalty Ledger (
real.rewards.loyalty.ledger) with physical retail shop tracking: - Standardized all Stop & Shop (SNS) supermarket branches under the City Pharmacy brand banner with the canonical prefix
CP <Store>(e.g.CP Waigani Central,CP Town,CP Boroko,CP Badili,CP 8 Mile,CP Gerehu,CP Harbour City,CP Airways). - Standardized all Hardware Haus retail branches with the canonical prefix
HHL <Store>(e.g.HHL Haus Depot POM,HHL Goroka,HHL Kavieng). - Merged redundant co-located supermarket/pharmacy stock locations into single branch hubs (
SNS Waigani Central->CP Waigani CentralID 22;SNS North Waigani->CP North WaiganiID 21;SNS Boroko->CP BorokoID 142). - Standardized Support Office / Training locations as
CP Support Office(ID 31) and registeredDGWas the central CPL Warehouse. - Backfilled and refreshed
shop_idrelational linkage across all 310,692 ledger rows (0 nulls remaining) and updated member registered stores across 138,460 accounts. - WHERE:
- Staging Member Profile:
https://angry-mad-smile.cpl.com.pg/web#id=758149&cids=1&model=res.partner&view_type=form-> "Loyalty Ledger" Tab - Standalone Ledger URL:
https://angry-mad-smile.cpl.com.pg/web#action=cpl_real_rewards_ui.action_real_rewards_loyalty_ledger&model=real.rewards.loyalty.ledger&view_type=list - Codebase:
real_rewards_loyalty_ledger.py,partner_views.xml,loyalty_ledger_views.xml, andres_partner.py. - WHEN: 2026-10-04; Tested and verified end-to-end via automated Playwright checks.
- WHY: Previously, member loyalty ledger records only maintained un-normalized raw text strings (
store_location) with over 140,801 rows missing store names or markedZINRELO_MIGRATION. Store managers and member service staff were unable to group, filter, analyze, or verify the exact physical store where customer points were collected or redeemed. A relationalstock.locationlinkage was essential for multi-store audit trails, reporting, and operational transparency. Furthermore, unifying supermarket branches under City Pharmacy (CP <Store>) and hardware branches under (HHL <Store>) guarantees single-source retail taxonomy across all CPL systems. - HOW:
- Updated
stock_locationrecords with unifiedCP <Store>andHHL <Store>naming standards. - Merged co-located store locations and safely migrated 238,767 ledger entries and 122,440 registered member store references.
- Re-calculated and updated
display_namestrings across 310,692 ledger entries and updated memberregistered_store_id. - Added relational
shop_idfield onreal.rewards.loyalty.ledger, rendered on Member Form and standalone Ledger tree/form views. - Created automated Playwright verification test suite with full visual screenshots.
Unified Registry of CPL Retail Stores & POS Codes¶
| Location ID | Canonical Store Name | Raw POS Code Samples | Total Ledger Transactions | Brand Classification |
|---|---|---|---|---|
| 22 | CP Waigani Central |
ZCEN, STOP&SHOP, Cp 4, CPLR000725809 |
236,188 | City Pharmacy (Supermarket & Pharmacy Hub) |
| 142 | CP Boroko |
BORO, ZBOR, Boroko |
2,555 | City Pharmacy (Supermarket & Pharmacy Hub) |
| 143 | CP Showroom |
SHOW, CP Showroom |
2,141 | City Pharmacy Flagship Showroom |
| 133 | CP Town |
ZTOW, Town |
2,029 | City Pharmacy (Downtown Supermarket) |
| 30 | CP Mount Hagen |
HAG2, HAG3, Hagen |
1,741 | City Pharmacy Regional Branch |
| 27 | CP Lae |
LAE2, Lae II |
1,543 | City Pharmacy Regional Branch |
| 138 | CP 8 Mile |
8mile, 8Mile, 8MILE SNS |
1,397 | City Pharmacy Supermarket |
| 135 | CP Badili |
ZBAD, Badili |
1,254 | City Pharmacy Supermarket |
| 136 | CP Gerehu |
ZGER, Gerehu |
1,042 | City Pharmacy Supermarket |
| 141 | CP Vision City |
VISI, Vision City |
981 | City Pharmacy Mall Branch |
| 21 | CP North Waigani |
ZNWA, North Waigani |
799 | City Pharmacy (Supermarket & Pharmacy Hub) |
| 145 | CP Vanimo |
VANI, Vanimo |
764 | City Pharmacy Regional Branch |
| 146 | CP Kavieng |
KAV, KAVI, Kavieng |
727 | City Pharmacy Regional Branch |
| 139 | CP Harbour City |
ZHAA, Harbour |
586 | City Pharmacy Supermarket |
| 28 | CP Lihir |
LIHR, Lihir |
552 | City Pharmacy Island Branch |
| 18 | CP Goroka |
GOR, GORO, Goroka |
522 | City Pharmacy Highlands Branch |
| 31 | CP Support Office |
so, SO, Support Office |
502 | Corporate & Support Facilities |
| 24 | CP Alotau |
ALOT, Alotau |
473 | City Pharmacy Regional Branch |
| 29 | CP Manus |
MANU, Manus |
410 | City Pharmacy Island Branch |
| 147 | CP Madang |
MAD2, MADA, Madang |
333 | City Pharmacy Coastal Branch |
| 144 | CP Wewak |
WEW, WEW2, Wewak |
292 | City Pharmacy Regional Branch |
| 26 | CP Kundiawa |
KUND, Kundiawa |
189 | City Pharmacy Highlands Branch |
| 25 | CP Kimbe |
KIM2, KIMB, Kimbe |
169 | City Pharmacy New Britain Branch |
| 150 | CP 7 Mile |
7mile, cp 7mile, CP 7MILE |
162 | City Pharmacy Airport Branch |
| 149 | CP Namatanai |
CITY PHARMACY NAMATANAI |
160 | City Pharmacy Regional Branch |
| 23 | CP Buka |
GAUK, Buka |
143 | City Pharmacy Autonomous Region Branch |
| 140 | CP Airways |
ZAIR, Airways |
143 | City Pharmacy Airport Supermarket |
| 19 | CP Kokopo |
KOK2, Kokopo II |
98 | City Pharmacy New Britain Branch |
| 20 | CP Eriku |
ERIK, Eriku Lae |
91 | City Pharmacy Lae Sub-Branch |
| 153 | HHL Haus Depot POM |
HHL-Haus Depot (POM) |
20 | Hardware Haus Flagship Depot |
| 148 | CP Popondetta |
POPO, Popondetta |
10 | City Pharmacy Northern Province |
| 152 | CP Koki (Closed) |
ZKOA Koki Closed |
2 | Historical / Closed Outlet |
| 151 | CP Maprik |
MAPR, Maprik |
1 | City Pharmacy Sepik Branch |
| 154 | HHL Goroka |
HHL-Goroka |
1 | Hardware Haus Highlands Branch |
| 156 | True Loyal->Odoo |
ZINRELO_IMPORT |
117,214 | Migration Opening Balances & Manual Adjustments |
| 155 | HHL Kavieng |
HHL-Kavieng |
1 | Hardware Haus New Ireland Branch |
| 17 | RR Test Shop |
Configured Store Location |
0 | Internal Test Location |
Step-by-Step Operating Guide¶
- Log in to Staging Odoo:
https://angry-mad-smile.cpl.com.pg. - Open CPL Real Rewards -> Real Rewards Members.
- Select any customer (e.g. Tabita Naman,
#id=758149) and click the Loyalty Ledger tab. - Verify the Shop Location column indicates the physical store branch (e.g.
CP Waigani Centralfor POS purchases) orTrue Loyal->Odoofor manual opening balance adjustments. - Open CPL Real Rewards -> Loyalty Ledgers & POS Transactions to filter or group all 310k+ transactions by Shop Location.
Verification Command¶
Module 18: Dynamic Member Primary Retail Shopping Location Badge: Header Banner & Kanban Card Views¶
- Ticket Code:
STG-TICK-018 - KB Article Code:
KB-018 - Category:
primary_store| Priority: High (1) | Stage: Verified / Resolved - Documentation Link: Store Staff Operating Guide
- Author / Publisher: Flavius Narokobi
5W1H Problem Audit & Technical Scope¶
- WHO: Requested by Business Stakeholders & Flavius Narokobi (Real Rewards Admin); Designed, implemented, backfilled, and audited by Flavius Narokobi (Lead Loyalty Engineer). Target Users: Frontline Store Cashiers, Member Care Representatives, Loyalty Marketing, and Store Branch Managers.
- WHAT: Upgrade the member location badge from a generic city classification (
port_moresby,lae) to a dynamic physical retail store location representing where the member shops the most frequently (e.g.CP Waigani Central,CP Town,CP Mount Hagen,HHL Goroka): - Updated the green header badge on the Member Form view (
res.partner) to renderprimary_store_namewith a map-marker icon. - Added the green primary store badge to the Member Kanban cards alongside RRP Card # and Points Balance.
- Added
primary_store_id(Many2onetostock.location) to the Member Metadata & Matrix section. - Created computation logic
_compute_primary_store: evaluates all physical retail ledger transactions (real.rewards.loyalty.ledger) excluding manual adjustments/migration channelTrue Loyal->Odoo, selects the store with the highest frequency, and falls back toregistered_store_id, then central flagship retail hubCP Waigani Central(ID 22). - Backfilled and indexed all 138,459 member profiles with zero null values.
- WHERE: Staging Environment (
https://angry-mad-smile.cpl.com.pg/web#action=cpl_real_rewards_ui.action_real_reward_customers&model=res.partner); Member Form Header; Member Kanban Cards; PostgreSQL database tableres_partner. - WHEN: Implemented, backfilled, deployed, and audited on 2026-10-04.
- WHY: The previous header badge showed a broad geographic area (
port_moresby,lae) which provided no actionable branch intelligence for customer engagement. Store managers and support agents need immediate visibility into the specific physical retail store where the customer conducts the majority of their shopping to optimize localized service, marketing campaigns, and branch attribution. - HOW:
- Defined
primary_store_idandprimary_store_namefields with@api.depends('registered_store_id', 'ledger_ids.shop_id')onres.partner. - Excluded non-retail migration placeholder
True Loyal->Odoofrom store frequency aggregation. - Modified
partner_views.xmlto displayprimary_store_nameon form header and kanban cards. - Executed fast SQL backfill across 138,459 members and indexed
primary_store_id. - Upgraded
cpl_real_rewards_uion staging via XML-RPC. - Verified via automated Playwright test suite capturing visual evidence (
base_check_member_header_store_badge_evidence.pngandbase_check_member_kanban_store_badge_evidence.png).
5W1H Resolution Summary¶
- Form Header Badge: Displays exact primary retail store (e.g.,
CP Waigani Central,CP Town,CP Boroko) in a high-visibility green badge. - Kanban Cards: Added green store badge to each member card alongside Card # and Available Points.
- Form Metadata: Added
primary_store_idto Member Metadata & Matrix group. - Backfill Breakdown Across 138,459 Members:
CP Waigani Central: 120,443 membersCP Boroko: 2,258 membersCP Town: 1,758 membersCP Showroom: 1,651 membersCP Mount Hagen: 1,369 membersCP 8 Mile: 1,241 membersCP Lae: 1,233 membersCP Badili: 1,112 membersCP Gerehu: 950 membersCP Vision City: 792 members- Remaining retail branches: 5,652 members
- Zero members assigned
True Loyal->Odooor null. - Visual Evidence:
- Form Header Store Badge:
base_check_member_header_store_badge_evidence.png - Kanban Cards Store Badges:
base_check_member_kanban_store_badge_evidence.png - Ticket STG-TICK-018 Form UI:
base_check_ticket_018_form_evidence.png
Verification Command¶
[STG-TICK-019] Live Production Cutover: Mathematical Parity & State Sync¶
- Ticket Code:
STG-TICK-019 - KB Reference:
KB-019 - Category:
configuration| Priority:high| Stage:resolved - Documentation: /uat/production_cutover_report/
Root Cause Analysis¶
Staging contained verified Golden Record accounts (138,459 members), 258,021 loyalty transactions with standardized physical retail shop taxonomy, and dynamic store badges. Production required atomic synchronization with zero points leakage and high-speed in-place execution.
Step-by-Step Resolution¶
- Created pre-flight PostgreSQL snapshot (104.2 MB).
- Standardized 42 retail locations under
CP <Store>andHHL <Store>. - Promoted 138,459 members, 258,021 ledgers, and 15,553 card replacements.
- Upgraded
cpl_real_rewards_uiand verified production with Playwright.
[STG-TICK-020] Quarantined Cards Queue Architecture & Maker-Checker Governance¶
- Ticket Code:
STG-TICK-020 - KB Reference:
KB-020 - Category:
quarantined_queue| Priority:high| Stage:closed - Documentation: /governance/sop_quarantine_queue/
Root Cause Analysis¶
Unassigned card transactions scanned at till points required a structured quarantine queue with Maker-Checker claims to prevent unauthorized points transfers.
Step-by-Step Resolution¶
- Implemented Quarantined Cards Queue view with
Push to Member (Claim)wizard. - Isolated 5 blocked cards with
0 Points Availabletill lock. - Added dedicated navigation links under Members and Governance.
[STG-TICK-021] Pronto Replacement Cards Lineage & RFC-4122 v4 UUID Architecture¶
- Ticket Code:
STG-TICK-021 - KB Reference:
KB-021 - Category:
card_replacements| Priority:high| Stage:resolved - Documentation: /governance/sop_card_replacements/
Root Cause Analysis¶
Pronto historical card swaps (15,553 replacements across 14,533 unique members) required parent-child lineage linking to an immutable identity anchor (member_uuid) to prevent duplicate customer profiles.
Step-by-Step Resolution¶
- Backfilled 100% of 138,459 members with RFC-4122 v4 UUIDs (
gen_random_uuid()). - Added auto-generation hooks in
res_partner.pyfor all new rewards registrations. - Published Active Cards Master Download package with member UUIDs.
[STG-TICK-022] Reporting: Instant Headerless Active Cards CSV Feed for Pronto ERP/POS¶
- Ticket Code:
STG-TICK-022 - KB Reference:
KB-022 - Category:
reporting| Priority:high| Stage:resolved - Documentation: /manuals/store_staff_guide/#8-exporting-active-card-numbers-for-pronto-pos-erp-feed
Root Cause Analysis¶
Store operations and Pronto ERP administrators required an automated, zero-friction method to extract active Real Rewards card numbers from Odoo to synchronize local POS barcode scanners. Legacy manual exports included extraneous profile metadata, headers, or required database scripts, creating operational delays and risk of schema formatting errors in Pronto batch jobs.
Step-by-Step Resolution¶
- Implemented streaming HTTP controller
/real_rewards/reporting/download_pronto_active_cardsleveraging PostgreSQLcopy_expertfor sub-second streaming. - Added
Pronto Active Cards (CSV)menuitem under the Reporting dropdown in top navigation. - Added
active_cardsmode topronto.export.wizardfor configuration export. - Generates headerless CSV with 138,454 active unblocked cards line-by-line.
- Verified via Playwright automated browser test with download interception (
uat_pronto_active_cards_reporting_menu.png).
Verification Command¶
curl -sk https://rewards.cpl.com.pg/real_rewards/reporting/download_pronto_active_cards | wc -l
# Expected output: 138454
[STG-TICK-023] UAT: Maker-Checker Segregation of Duties & Self-Approval Prevention¶
- Ticket Code:
STG-TICK-023 - KB Reference:
KB-023 - Category:
security_rbac| Priority:high| Stage:resolved - Documentation: /manuals/ODOO_MAKER_MANUAL/#segregation-of-duties-governance
Root Cause Analysis¶
Dual-control regulatory compliance requires strict segregation of duties between operational staff (Makers) initiating member profile changes and supervisors (Checkers) approving them. A maker must never possess the capability to self-approve their own submissions.
Step-by-Step Resolution¶
- Configured pure Maker persona
aoata@cpl.com.pg(UID 59) strictly assigned togroup_loyalty_makerand excluded fromgroup_loyalty_checkerand administrator groups. - Configured independent Checker persona
fnarokobi@cpl.com.pg(UID 57) ingroup_loyalty_checker. - Injected Python ORM security guard in
action_approveofreal.rewards.profile.change.request: - Added UI XML view constraint
groups="real_rewards_loyalty.group_loyalty_checker"to suppress the Approve button in the Maker interface. - Automated Playwright UAT verified that Maker self-approval raises an explicit permission fault, while Checker authorization executes successfully.
Verification Evidence¶
- Staging Verification:
stg_mkr_01_maker_self_approval_blocked.png,stg_mkr_02_checker_profile_change_approved.png - Production Verification:
prod_mkr_01_maker_self_approval_blocked.png,prod_mkr_02_checker_profile_change_approved.png
[STG-TICK-024] UAT: Quarantined Cards Queue Claim & Point Transfer Workflow¶
- Ticket Code:
STG-TICK-024 - KB Reference:
KB-024 - Category:
quarantined_queue| Priority:high| Stage:resolved - Documentation: /governance/sop_quarantine_queue/#maker-checker-claim-approval
Root Cause Analysis¶
Transactions scanned at POS against unregistered or quarantined card barcodes accumulate unassigned loyalty points. To prevent points leakage and ensure audit traceability, staff must verify physical till receipts before reassigning points to a customer's verified Golden Record.
Step-by-Step Resolution¶
- Maker creates a Claim Request (
request_type='claim_unclaimed') referencing the quarantined card and target member ID, supplying till receipt proof in the audit notes. - Request transitions to
pendingstate and enters the Checker Review Queue. - Independent Checker inspects the claim, reviews receipt notes, and clicks Approve.
- System executes atomic point transfer, logs loyalty ledger attribution, and automatically deactivates/archives the unclaimed temporary account (
is_unclaimed_record=False,active=False).
Verification Evidence¶
- Staging Verification:
stg_mkr_03_maker_quarantine_claim_submitted.png,stg_mkr_04_checker_quarantine_claim_verified.png - Production Verification:
prod_mkr_03_maker_quarantine_claim_submitted.png,prod_mkr_04_checker_quarantine_claim_verified.png
[STG-TICK-025] UAT: Card Replacement & Immutable UUID Lineage Preservation¶
- Ticket Code:
STG-TICK-025 - KB Reference:
KB-025 - Category:
card_replacements| Priority:high| Stage:resolved - Documentation: /governance/sop_card_replacements/#card-swap-lineage
Root Cause Analysis¶
When a customer loses a physical barcode card or suffers card wear, a replacement card barcode must be issued without creating duplicate customer profiles or disrupting accumulated loyalty points. The primary identity anchor (member_uuid) must remain immutable while the old barcode is archived in historical audit lineage.
Step-by-Step Resolution¶
- Maker initiates a Card Swap Request (
request_type='replace') specifying the new barcode and replacement justification. - Checker reviews the request in the dual-control queue and clicks Approve.
- System updates
res_partner.rrp_card_numberto the new barcode. - An immutable audit record is committed to
real.rewards.card.replacement.logpreserving the old card barcode, replacement timestamp, operator UID, and reason. - Synchronized PostgreSQL sequence
real_rewards_card_replacement_log_id_seqto ensure zero primary key collisions across 15,554+ entries. - The customer's
member_uuidremains unchanged, preserving all relational links to transaction ledgers.
Verification Evidence¶
- Staging Verification:
stg_mkr_05_maker_card_replacement_submitted.png,stg_mkr_06_checker_card_replacement_lineage.png - Production Verification:
prod_mkr_05_maker_card_replacement_submitted.png,prod_mkr_06_checker_card_replacement_lineage.png
[STG-TICK-026] UAT: Blocked Cards Security, POS Till Lockout & Audit Unblock Protocol¶
- Ticket Code:
STG-TICK-026 - KB Reference:
KB-026 - Category:
security_rbac| Priority:high| Stage:resolved - Documentation: /manuals/ODOO_CHECKER_MANUAL/#card-blocking-unblocking-protocol
Root Cause Analysis¶
Reported stolen, fraudulent, or disputed cards require immediate lockout across retail POS systems to protect points balances. When a customer subsequently provides government photo ID and proves account ownership, an authorized Checker must be able to restore the card with a mandatory audit justification.
Step-by-Step Resolution¶
- Checker triggers
action_block_cardon the customer profile: - Profile
is_card_blockedflag is set toTrue. - UI renders a prominent red Card Blocked ribbon in form views.
- Available loyalty points are immediately zeroed at the till and transferred into a quarantined holding hold (
order_type='blocked_card_hold'). - Audit trail message posted to partner chatter with operator ID and reason.
- Once identity verification is completed, Checker triggers
action_unblock_card: is_card_blockedis reset toFalse, red ribbon is removed.- Chatter records unblocking timestamp, checker ID, and photo ID verification reason.
- Ensured
action_block_cardandaction_unblock_cardexecute with.sudo()for immutable ledger isolation and return explicitTruebooleans for Odoo XML-RPC compliance.
Verification Evidence¶
- Staging Verification:
stg_mkr_07_checker_card_blocked_red_ribbon.png,stg_mkr_08_checker_card_unblocked.png - Production Verification:
prod_mkr_07_checker_card_blocked_red_ribbon.png,prod_mkr_08_checker_card_unblocked.png
[STG-TICK-027] POS Order Read Access for Store Makers/Checkers & Real-Time Exception Alerting¶
- Ticket Code:
STG-TICK-027 - KB Reference:
KB-027 - Category:
security_access| Priority:high| Stage:resolved - Documentation: /manuals/store_staff_guide/#pos-orders-read-only-access-and-exception-monitoring
Problem Statement & Root Cause Analysis¶
- AccessError on pos.order: Store staff (Makers, e.g.,
rrcp7mile@cpl.com.pg) and Checkers (akopar@cpl.com.pg) opening member profiles with 52,671 POS orders encountered repeatedAccess Denied by ACLs for operation: read, uid: 70, model: pos.ordererrors in Production. - OWL JavaScript Crash: In Odoo 17,
pos_order_countonres.partnerhad field security restricted topoint_of_sale.group_pos_user. When non-POS store users loaded partner forms, Odoo strippedpos_order_countfrom the payload, causing the client OWL engine to crash withName 'pos_order_count' is not defined. - Missing Sudoku Execution in Computes: Member KPI computations (
_compute_member_total_orders,_compute_member_kpis,_compute_behavioural_segment) queriedpos.orderin caller context rather than elevated context. - Lack of Automated Exception Alerting: Administrative team lacked proactive visibility into runtime exceptions encountered by branch staff.
Step-by-Step Resolution¶
- Extended Model ACLs (
ir.model.access.csv): - Added
perm_read=1, perm_write=0, perm_create=0, perm_unlink=0onpos.orderandpos.order.lineforgroup_loyalty_maker,group_loyalty_checker, andgroup_real_rewards_reader. - ResPartner Field & Compute Hardening (
res_partner.py): - Redefined
pos_order_countwith expanded groups:point_of_sale.group_pos_user,real_rewards_loyalty.group_loyalty_maker,real_rewards_loyalty.group_loyalty_checker. - Overrode
_compute_pos_order()to execute in elevatedpos.order.sudo()context. - Wrapped
pos.order.sudo()in all member KPI computes. - Stat Button Visibility (
partner_views.xml): - Updated
action_view_pos_ordersmart button groups to include Loyalty Makers and Checkers so store staff can review past receipts and points transactions. - Declared hidden
pos_order_countin form view to ensure safe OWL evaluation. - Real-Time Automated Exception Interceptor (
ir_http.py): - Overrode
IrHttp._handle_errorto intercept allAccessErrors and Real Rewards model exceptions. - Built a 15-minute in-memory rate-limiting signature cache to prevent email storms.
- Dispatches rich HTML alerts with user details, URL, model, IP address, and formatted traceback directly to
fnarokobi@cpl.com.pgviano-reply.rewards@cpl.com.pg.
Verification Evidence¶
- Staging Verification:
- Maker Profile Verified:
stg_maker_tabita_profile_verified.png - Maker POS Orders List (80/315 records):
stg_maker_pos_orders_list_verified.png - Checker Profile Verified:
stg_checker_tabita_profile_verified.png - Checker POS Orders List:
stg_checker_pos_orders_list_verified.png - Production Verification:
- Maker Profile Verified (User 70):
prod_maker_tabita_profile_verified.png - Maker POS Orders List (80/315 records):
prod_maker_pos_orders_list_verified.png - Checker Profile Verified:
prod_checker_tabita_profile_verified.png - Checker POS Orders List:
prod_checker_pos_orders_list_verified.png
[STG-TICK-028] Pronto Replacement Cards Inversion Realignment & Active Card Promotion¶
- Ticket Code:
STG-TICK-028 - KB Reference:
KB-028 - Category:
card_replacements| Priority:high| Stage:resolved - Documentation: /governance/sop_card_replacements/
Problem Statement & Root Cause Analysis¶
- Column Polarity Inversion: An exhaustive audit of
Cards in Pronto replacement.csvrevealed that the original ingestion script (scripts/ingest_card_replacements_staging.py) inverted old and new card columns.Card Number(the replacement card issued in Pronto) was mapped toold_card_number, whileZinrelo Member ID(the retired original card) was mapped tonew_card_number. - Active Card Desynchronization: Because
new_card_numbercontained the original retired card, 14,541 active member profiles in Odoo (res_partner.rrp_card_number) were left holding their retired legacy cards, rather than the physical replacement cards held by customers. - Cross-Partner Stub Collisions: 271 legacy stub partner records had been created during intermediate migration tests holding replacement card numbers, preventing atomic updates due to the
UNIQUE (rrp_card_number)database constraint.
Step-by-Step Resolution¶
- Chronological Sequencing:
- Parsed all 15,637 active replacement rows from
/tmp/Cards_in_Pronto_replacement.csv. - Grouped multiple card replacements per member and sorted them chronologically by activation timestamp.
- Identified the latest replacement card as the member's true active card.
- Stub Partner Consolidation:
- Identified 271 stub partner profiles holding replacement barcodes.
- Re-linked all POS orders, loyalty ledger entries, and audit logs to the primary master partner profile.
- Deactivated stub records and cleared their barcode values to eliminate unique constraint collisions.
- Active Card Promotion:
- Promoted all 14,541 verified members'
res_partner.rrp_card_numberto their latest replacement card. - Verified active cards: Francis Marai $\rightarrow$
CPLR000605466, Bellindah Daniel $\rightarrow$CPLR000108017, Joe Koma $\rightarrow$CPLR000695213, Neba Kewa $\rightarrow$CPLR000721151. - Audit Trail Rebuild:
- Rebuilt
real_rewards_card_replacement_logwith correct polarity:old_card_number= Original Card $\rightarrow$new_card_number= Replacement Card. - Inserted 15,572 clean audit logs with activation notes and timestamps.
- Playwright UAT Verification:
- Verified Maker profile loads with promoted replacement badges and 0 errors.
- Verified Checker replacement logs list view renders correct
Old -> Neworder.
Verification Evidence¶
- Staging Verification:
- Maker Profile (Francis Marai -
CPLR000605466):stg_uat_repl_01_maker_francis_marai.png - Maker Profile (Bellindah Daniel -
CPLR000108017):stg_uat_repl_02_maker_bellindah_daniel.png - Checker Replacement Logs Queue (15,572 records):
stg_uat_repl_03_checker_replacement_logs_list.png - Ticket STG-TICK-028 Form UI:
stg_uat_repl_04_ticket_028_verified.png - Knowledge Base KB-028 Form UI:
stg_uat_repl_05_kb_028_verified.png - Production Verification:
- Proof of Concept (Margaret Valo Frank -
CPLR000710712, 3,080 Pts):prod_uat_repl_01_maker_margaret_frank_profile.png - Multi-Replacement Member 1 (David Nebare - 13 Replacements,
CPLR000723925):prod_uat_repl_02_maker_david_nebare_13_replacements.png - Multi-Replacement Member 2 (Beatrice Stanley - 5 Replacements,
CPLR000757536):prod_uat_repl_03_maker_beatrice_stanley_5_replacements.png - Checker Replacement Logs Queue:
prod_uat_repl_04_checker_margaret_frank_log_verified.png - Ticket STG-TICK-028 Form UI (Production):
prod_uat_repl_05_ticket_028_prod_verified.png - Knowledge Base KB-028 Form UI (Production):
prod_uat_repl_06_kb_028_prod_verified.png
[STG-TICK-029] Staging KB & Ticket Selection Choices Expansion & Read-Only RBAC Governance¶
- Ticket Code:
STG-TICK-029 - Knowledge Base Code:
KB-029 - Module / Domain:
security_access - Status:
Closed - Priority: High (
2) - Documentation Link: Change Log & KB
5W1H Analysis¶
- WHO: Real Rewards Administrators, Loyalty Checkers, and System Auditors.
- WHAT:
- Resolved an Owl frontend lifecycle crash (
TypeError: Cannot read properties of undefined (reading '1')) occurring when opening KB articlesKB-022,KB-026, orKB-027whosecategoryselection values were not declared in the Python model. - Enforced strict read-only access (
perm_read=1, perm_write=0, perm_create=0, perm_unlink=0) onreal.rewards.staging.ticketandreal.rewards.staging.kbfor Real Rewards Admins and Loyalty Checkers. - Granted Checkers (
group_loyalty_checker) menu visibility to the "Staging Audit & KB" app drawer menu. - Added
create="false" edit="false" delete="false"attributes to Ticket and KB tree and form views. - WHEN: October 5, 2026.
- WHERE:
- Model definitions:
odoo/addons/cpl_real_rewards_ui/models/staging_helpdesk.py - Access Control:
odoo/addons/cpl_real_rewards_ui/security/ir.model.access.csv - Menu navigation:
odoo/addons/cpl_real_rewards_ui/views/menu_views.xml - Views:
odoo/addons/cpl_real_rewards_ui/views/staging_helpdesk_views.xml - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: In Odoo 17 OWL,
SelectionFieldexecutesfield.selection.find(item => item[0] === val)[1]. Whenvalis missing fromfields.Selection,find(...)returnsundefined, crashing the web client. Furthermore, Checkers and Admins required clean read-only visibility into past cutover audit tickets without ability to alter compliance records. - HOW:
- Expanded
categoryinreal.rewards.staging.ticketandreal.rewards.staging.kbto includereporting,governance, andsecurity_access. - Updated
ir.model.access.csvgiving1,0,0,0togroup_real_rewards_adminandgroup_loyalty_checker, reserving1,1,1,1forbase.group_system. - Updated
menu_views.xmladdingreal_rewards_loyalty.group_loyalty_checker. - Deployed code, ran
odoo -u cpl_real_rewards_ui, and restarted web containers across Staging and Production. - Verified via Playwright automated UAT across Checker and Admin personas capturing 12 visual evidence artifacts with 0 errors.
Verification Evidence¶
- Staging Verification:
- Checker KB Articles List:
stg_uat_kb_01_checker_kb_list.png - Checker KB-022 Form UI (Reporting):
stg_uat_kb_02_checker_kb_022_reporting.png - Checker KB-026 Form UI (Governance):
stg_uat_kb_03_checker_kb_026_governance.png - Checker KB-027 Form UI (Security):
stg_uat_kb_04_checker_kb_027_security.png - Admin Ticket Kanban (Read-Only):
stg_uat_kb_05_admin_ticket_kanban_readonly.png - Admin KB Articles List (Read-Only):
stg_uat_kb_06_admin_kb_list_readonly.png - Production Verification:
- Checker KB Articles List:
prod_uat_kb_01_checker_kb_list.png - Checker KB-022 Form UI (Reporting):
prod_uat_kb_02_checker_kb_022_reporting.png - Checker KB-026 Form UI (Governance):
prod_uat_kb_03_checker_kb_026_governance.png - Checker KB-027 Form UI (Security):
prod_uat_kb_04_checker_kb_027_security.png - Admin Ticket Kanban (Read-Only):
prod_uat_kb_05_admin_ticket_kanban_readonly.png - Admin KB Articles List (Read-Only):
prod_uat_kb_06_admin_kb_list_readonly.png
[STG-TICK-030] True Loyal 05/09 Historical Points Ingestion (Col I/J) & Return Clearance Backdating¶
- Ticket Code:
STG-TICK-030 - Knowledge Base Article:
KB-030 - Module / Category:
reporting/ Pronto Reporting & Historical Balance Feeds - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Cutover Master Report
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Publisher / Technology Lead), Antigravity AI Engineering Agent, Margaret Valo Frank (Audit Inquirer & PoC Subject).
- WHAT:
- Restored full historical points lineage from True Loyal Golden Master (
cplgroup_users_05_Sep_2026_1788606981.MAINLIST.csv):- Column "I"
POINTS EARNED: 762,909,853 pts. - Column "J"
POINTS REDEEMED: 242,087,240 pts. - Historical Expired Points: 87,395,920 pts (across 39,531 accounts).
- Column "M"
AVAILABLE POINTS: 433,426,693 pts (100% exact match).
- Column "I"
- Ingested three-line historical ledger structure (
earn,redeem,expire) replacing the placeholder singleadjustopening balance. - Backdated 140,801 retail POS transactions to their physical
pos_order.date_order(July–August 2026) and updated_compute_loyalty_points()inres_partner.pyto evaluate(line.transaction_date or line.create_date). - Cleared 45-day-old purchases from
pending_pointsintoloyalty_points_available, preserving the 7-day return window solely for future live sales. - Verified Proof of Concept on Margaret Valo Frank (
CPLR000710712, 3,193 available, 28,793 earned, 25,600 redeemed), David Nebare (13 swaps, 5,005 available, 87,905 earned, 82,900 redeemed), and Beatrice Stanley (5 swaps, 750 available, 2,424 earned, 1,200 redeemed, 474 expired). - WHEN: October 5, 2026.
- WHERE:
- Codebase:
odoo/addons/cpl_real_rewards_ui/models/res_partner.py - Ledgers:
real_rewards_loyalty_ledger - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: Resolves Margaret Frank's inquiry confirming that opening balance single-adjust rows hid lifetime earned and redeemed figures, and recent ingestion dates caused 45-day-old POS purchases to be held in pending points.
- HOW:
- Created compact points map
scratch/true_loyal_points_map.csv.gzfrom master True Loyal export. - Backdated POS transactions to
date_order. - Ingested
earn(Col I),redeem(Col J), andexpire(Expired delta) lines. - Recalculated
res_partnerbalances via SQL aggregate and ORM recomputation. - Captured 12 automated Playwright UAT verification screenshots across Staging and Production.
Verification Evidence¶
- Staging Verification:
- Margaret Valo Frank Profile:
stg_uat_pts_01_margaret_frank_points_verified.png - Margaret Valo Frank Ledger:
stg_uat_pts_02_margaret_frank_ledger_verified.png - David Nebare (13 swaps):
stg_uat_pts_03_david_nebare_multi_replacement_points.png - Beatrice Stanley (Expired):
stg_uat_pts_04_beatrice_stanley_expired_points_verified.png - STG-TICK-030 Form UI:
stg_uat_pts_05_ticket_030_staging.png - KB-030 Form UI:
stg_uat_pts_06_kb_030_staging.png - Production Verification:
- Margaret Valo Frank Profile:
prod_uat_pts_01_margaret_frank_points_verified.png - Margaret Valo Frank Ledger:
prod_uat_pts_02_margaret_frank_ledger_verified.png - David Nebare (13 swaps):
prod_uat_pts_03_david_nebare_multi_replacement_points.png - Beatrice Stanley (Expired):
prod_uat_pts_04_beatrice_stanley_expired_points_verified.png - STG-TICK-030 Form UI:
prod_uat_pts_05_ticket_030_prod.png - KB-030 Form UI:
prod_uat_pts_06_kb_030_prod.png
[STG-TICK-031] Store Staff RBAC Hardening: Restrict Manual Points Adjustments to Head Office Checkers & Admins¶
- Ticket Code:
STG-TICK-031 - Knowledge Base Article:
KB-031 - Module / Category:
security_access/ Security & RBAC Enforcement - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Security & RBAC
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Publisher / Technology Lead), Antigravity AI Engineering Agent, Margaret Valo Frank (Audit & Security Instruction).
- WHAT:
- Removed Store Staff / Branch Maker (
group_loyalty_maker) access to Manual Points Adjustments across all user interfaces:- Point of Sale "Points Adjustments" menu (
menu_loyalty_points_adjustment) hidden from store staff viagroups="real_rewards_loyalty.group_loyalty_checker,cpl_real_rewards_ui.group_real_rewards_admin". - Model security on
loyalty.points.adjustmentrevoked inir.model.access.csvforgroup_loyalty_maker(0,0,0,0). - Dynamic selection override in
real.rewards.profile.change.requestviafields_getso store makers cannot see or pickManual Points Adjustment.
- Point of Sale "Points Adjustments" menu (
- Implemented strict Python ORM security barriers (
create,write,_onchange_request_type_rbac) raisingUserErrorif non-checkers attempt manual point adjustments via XML-RPC or direct API calls. - Preserved full dual-control initiation and moderation for Head Office Checkers (
group_loyalty_checker) and System Administrators. - WHEN: October 6, 2026.
- WHERE:
- Views:
odoo/addons/real_rewards_loyalty/views/points_adjustment_view.xml - Security CSV:
odoo/addons/real_rewards_loyalty/security/ir.model.access.csv - Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py - Database:
cpl_real_rewards_staging(@172.18.0.2:5432). - WHY: In retail operations, branch cashiers and store supervisors should never have the ability to inflate customer balances or perform off-till point grants. Manual points adjustments are strictly compensatory or reconciliation instruments governed by Head Office under dual-control approval.
- HOW:
- Updated
points_adjustment_view.xmladding Checker and Admin groups to the POS menu. - Updated
ir.model.access.csvresetting Maker CRUD permissions to0,0,0,0. - Added
fields_getfilter inProfileChangeRequestto restrict dropdown choices. - Added ORM validations in
createandwrite. - Verified via automated Playwright tests capturing Maker and Checker UI screens with 0 errors.
Verification Evidence¶
- Staging Verification:
- Maker Change Request Form (Dropdown Restricted to new, change, replace):
stg_maker_change_request_dropdown_restricted.png - Checker Change Request Form (All 5 options available):
stg_checker_change_request_dropdown_all_options.png
[STG-TICK-032] Store Staff RBAC Hardening: Restrict Claimed / Unclaimed Orphaned Accounts Queue & Workflow to Head Office Checkers & Admins¶
- Ticket Code:
STG-TICK-032 - Knowledge Base Article:
KB-032 - Module / Category:
governance/ Governance & Unclaimed Account Queues - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Security & RBAC
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Publisher / Technology Lead), Antigravity AI Engineering Agent, Margaret Valo Frank (Audit & Security Instruction).
- WHAT:
- Removed Store Staff / Branch Maker (
group_loyalty_maker) access to Unclaimed / Orphaned Accounts:menu_cpl_real_rewards_unclaimed_queue_legacy("Unclaimed Accounts Queue (Legacy)") hidden from store staff viagroups="cpl_real_rewards_ui.group_real_rewards_admin,real_rewards_loyalty.group_loyalty_checker".menu_cpl_real_rewards_unclaimed_audit_log("Unclaimed Claims Audit Log") hidden from store staff viagroups="cpl_real_rewards_ui.group_real_rewards_admin,real_rewards_loyalty.group_loyalty_checker".- Dynamic selection override in
real.rewards.profile.change.requestviafields_getremovingclaim_unclaimed("Claim Unclaimed / Orphaned Account") for store makers.
- Implemented strict Python ORM security barriers (
create,write,_onchange_request_type_rbac) raisingUserErrorif non-checkers attempt to submit unclaimed account claims. - Preserved full operational access under Governance & Queues for Head Office Checkers (
group_loyalty_checker) and System Administrators. - WHEN: October 6, 2026.
- WHERE:
- Views:
odoo/addons/cpl_real_rewards_ui/views/menu_views.xml - Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py - Database:
cpl_real_rewards_staging(@172.18.0.2:5432). - WHY: Unclaimed / orphaned accounts contain legacy unassigned points and historical transaction records. Granting retail branches access to merge orphaned accounts introduces identity theft risks and unauthorized points transfers. Only Head Office Checkers should perform orphan resolution after auditing physical till receipts.
- HOW:
- Added Checker and Admin security groups to unclaimed menus in
menu_views.xml. - Dynamically filtered
request_typechoices inProfileChangeRequestviafields_get. - Enforced ORM-level authorization guards on
createandwrite. - Verified via automated Playwright sessions and negative XML-RPC calls.
Verification Evidence¶
- Staging Verification:
- Maker Governance & Queues Dropdown (Unclaimed Queues Completely Removed):
stg_maker_governance_menu_unclaimed_removed.png - Checker Governance & Queues Dropdown (All 7 Governance Items Present):
stg_checker_governance_menu_unclaimed_present.png
[STG-TICK-033] Checker Approval Notifications & MS Graph RFC 2822 Recipient Address Resolution Fix¶
- Ticket Code:
STG-TICK-033 - Knowledge Base Article:
KB-033 - Module / Category:
maker_checker/ Maker-Checker Approval Workflows & Notification Dispatch - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Checker Manual
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Publisher / Technology Lead), Antigravity AI Engineering Agent, Margaret Valo Frank (Audit & Incident Reporter).
- WHAT:
- Resolved Microsoft Graph API
400 ErrorInvalidRecipientsinreal_rewards_api_mailer:- Refactored
IrMailServer.send_emailusing Python'semail.utils.getaddressesto parse raw RFC 2822 header strings (e.g."Margaret Valo Frank" <mfrank@cpl.com.pg>) into separate display names and clean RFC-compliant email addresses. - Structured MS Graph API
toRecipientsandccRecipientsobjects to ensure compatibility with Microsoft Entra ID and Exchange Online address resolution.
- Refactored
- Implemented automated In-Odoo Activity Scheduling (
mail.activity):- Enhanced
action_submit()onreal.rewards.profile.change.requestandloyalty.points.adjustmentto automatically schedule amail.mail_activity_data_todo("Approval Required") activity for all active Checkers (excluding the submitter/Maker). - Activated the top navigation bar Activities Systray (Clock icon) badge counter, giving Checkers a real-time count of pending approval requests with 1-click navigation.
- Filtered out existing followers prior to calling
message_subscribeto prevent duplicate follower SQL constraint violations.
- Enhanced
- Implemented automated Activity Completion (
activity_feedback):- Added
activity_feedbackhandlers inaction_approve(),action_reject()(Points Adjustments), andRejectionWizard.action_confirm_reject()(Profile Change Requests) to automatically complete and clear the activity from the Checker's systray upon review.
- Added
- Configured Margaret Frank user profile:
- Set
notification_type = 'inbox'onres_usersto ensure chatter notifications and mentions appear directly in her Odoo Discuss Inbox (/mail/inbox) and chatter bell icon, in addition to top-bar activity badges.
- Set
- WHEN: October 6, 2026.
- WHERE:
- Mail Server:
odoo/addons/real_rewards_api_mailer/models/ir_mail_server.py - Profile Change Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py - Rejection Wizard:
odoo/addons/cpl_real_rewards_ui/wizard/rejection_wizard.py - Points Adjustment Model:
odoo/addons/real_rewards_loyalty/models/points_adjustment.py - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: When retail branches submit profile changes or manual point adjustments, Head Office Checkers must receive immediate notifications both inside the Odoo web client and via email. Unparsed RFC 2822 headers caused Microsoft Graph API to reject all notification emails, while the lack of scheduled activities left the in-Odoo Activities systray empty.
- HOW:
- Updated
ir_mail_server.pywithgetaddressesparsing and structured recipient objects. - Added
activity_schedulecalls inaction_submit()for both approval models. - Added
activity_feedbackcalls inaction_approve()and rejection handlers. - Deployed changes across Staging and Production containers and restarted web workers.
- Verified end-to-end via automated XML-RPC test suites and Playwright UI inspection.
Verification Evidence¶
- Staging Verification:
- Staging Change Tickets Board (STG-TICK-033 Closed & Documented):
stg_ticket_033_kanban.png - Ticket Detail Form View:
stg_ticket_033_form.png - Knowledge Base SOP Form View:
stg_kb_033_form.png - Graph API Log Confirmation:
Successfully dispatched email to ['fnarokobi@cpl.com.pg', 'clam@cpl.com.pg', ...] via MS Graph(HTTP 202 Accepted, 0 errors). - Activity Verification:
[OK] PASSED: In-Odoo Activity successfully scheduled for Margaret Frank!&[OK] PASSED: In-Odoo Activity automatically cleared upon approval!
[STG-TICK-034] Automated System Incident Ingestion, 1-Hour De-duplication & Ticketed Email Notification Dispatch¶
- Ticket Code:
STG-TICK-034 - Knowledge Base Article:
KB-034 - Module / Category:
system_incident/ Automated Exception Ingestion, Incident De-duplication & Helpdesk Alerting - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Gatekeeper Pipeline
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Head of Technology), Antigravity AI Engineering Agent, Margaret Valo Frank (Audit & Incident Reporter), All Head Office Checkers (
group_loyalty_checker). - WHAT:
- Extended
real.rewards.staging.ticketwith categorysystem_incidentand technical diagnostics:error_fingerprint: SHA256 cryptographic signature computed fromtitle,model, and error message prefix.error_traceback: Complete Python stack trace captured at exception time.affected_user_id: Foreign key tores.usersrecording the exact operator who encountered the error.affected_model: Odoo ORM model name or service where the failure originated.affected_res_id: Database record ID being accessed during the fault.
- Implemented
log_system_error()with rolling 1-Hour De-duplication:- Queries open tickets (
draft,in_progress) created within the last 60 minutes matching the error fingerprint. - If a match exists, appends a formatted audit note (
Recurring Occurrence Detected) to the existing ticket chatter without creating a duplicate ticket or spamming email inboxes. - If new, creates a Helpdesk Ticket in
draftstage and posts an HTML technical incident badge card into chatter.
- Queries open tickets (
- Re-architected
ir_http._notify_error_if_relevant():- Discontinued legacy raw, untracked exception emails.
- Delegates all intercepted runtime exceptions on Real Rewards / POS models to
log_system_error(). - Dispatches formatted HTML email notifications with
[STG-TICK-xxx]in the subject and a 1-click deep link button to all active Checkers and System Administrators.
- Hooked
ir_mail_server.py:- Intercepts Microsoft Graph API authentication failures and delivery rejections (
status_code != 202), logging them as Helpdesk Tickets withdispatch_email=Falseto prevent infinite mail loops.
- Intercepts Microsoft Graph API authentication failures and delivery rejections (
- WHEN: October 6, 2026.
- WHERE:
- Helpdesk Model:
odoo/addons/cpl_real_rewards_ui/models/staging_helpdesk.py - Helpdesk Views:
odoo/addons/cpl_real_rewards_ui/views/staging_helpdesk_views.xml - HTTP Interceptor:
odoo/addons/cpl_real_rewards_ui/models/ir_http.py - Mailer Hook:
odoo/addons/real_rewards_api_mailer/models/ir_mail_server.py - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: Raw, untracked email alerts prevented correlation between system errors and support tickets, lacked administrative tracking, and caused email inbox flooding when recurring errors looped.
- HOW:
- Implemented ORM fields, methods, and XML form views in
cpl_real_rewards_ui. - Routed HTTP exceptions and MS Graph delivery failures through
log_system_error(). - Upgraded
cpl_real_rewards_uion Staging and Production databases. - Verified 100% pass rate via dual Playwright browser UAT and synthetic error injection.
Verification Evidence¶
- Staging Verification:
- Staging Helpdesk Kanban View (
stg_uat_err_01_kanban_view.png) - Incident Ticket Form View & Diagnostics (
stg_uat_err_02_incident_form_diagnostics.png) - Chatter Incident Badge & 1-Hour De-duplication Note (
stg_uat_err_03_chatter_deduplication.png) - Production Verification:
- Production Helpdesk Kanban Parity View (
prod_uat_err_01_kanban_view.png) - Production Incident Ticket Diagnostics (
prod_uat_err_02_incident_form_diagnostics.png) - Production Chatter De-duplication Parity (
prod_uat_err_03_chatter_deduplication.png)
[STG-TICK-035] Member Service Request Photo Attachment Race Condition & Camille JB Bendoy Profile Photo Mismatch Resolution¶
- Ticket Code:
STG-TICK-035 - Knowledge Base Article:
KB-035 - Module / Category:
maker_checker/ Member Service Requests & Binary Attachment Management - Severity / Priority: Priority 2 (High)
- Stage:
Closed & Documented - Target Documentation: Checker Manual
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Head of Technology), Antigravity AI Engineering Agent, Margaret Valo Frank (Head Office Checker & Incident Handler), Faustie (City Pharmacy Vision City Maker
cpvision@cpl.com.pg), Camille JB Bendoy (Registered Customer, CardCPLR000721571, Partner ID775665). - WHAT:
- Resolved customer profile photo mismatch on newly enrolled member Camille JB Bendoy:
- Investigated Service Request
PCR/2026/0032(Database ID17), which was submitted by City Pharmacy Vision City and approved by Margaret Frank on October 6, 2026 at 05:06 UTC. - Discovered that instead of displaying Camille's photo, the customer profile and POS counters displayed an unrelated photo of a spoon.
- Restored Camille's verified customer photo (
6792c44c89135f0c283b3385dfd29136a0e387a7, 153.6 KB) intores.partnerID775665on Production, regenerating high-definition thumbnails (image_1024,image_512,image_256,image_128).
- Investigated Service Request
- Identified Root Cause:
- Record ID
17was an old test record from August 27, 2026 that had an orphaned test image attachment (ID1885- spoon photo). - When Faustie uploaded Camille's photo, attachment ID
2155was created, leaving multiple attachments associated with the same request. - In
action_approve(), Odoo's ORM readreq.customer_photo. Odoo's binary getter queriedir_attachmentwithout an explicitorder='id desc', returning the oldest attachment (1885 - spoon) instead of the latest (2155 - Camille).
- Record ID
- Patched Codebase in
real_rewards_profile_change_request.py:- Added
_get_latest_customer_photo(self)queryingir_attachmentwithorder='id desc', limit=1to guarantee deterministic selection of the newest uploaded photo acrossnew,change, andreplacerequest types. - Overrode
write()to automatically unlink existingcustomer_photoattachments when a new photo is uploaded, preventing orphaned attachments from accumulating. - Purged orphaned test attachment
1885from the production database.
- Added
- Dispatched formal resolution notification email with
[STG-TICK-035]to Checkers (group_loyalty_checker) and City Pharmacy Vision City (cpvision@cpl.com.pg). - WHEN: October 7, 2026.
- WHERE:
- Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py - Partner Model:
res.partner(ID775665) - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: In retail loyalty systems, displaying the wrong member profile photo at POS counters undermines customer trust, creates cashier confusion, and violates KYC data integrity standards.
- HOW:
- Updated
real_rewards_profile_change_request.pywith_get_latest_customer_photo()and attachment purging onwrite(). - Repaired Camille JB Bendoy's profile via ORM write on Production.
- Purged stale attachment 1885.
- Executed Staging Playwright UAT verifying latest photo resolution (
uat_playwright_photo_fix.py). - Executed Production Playwright Parity UAT verifying Camille's profile and Helpdesk Ticket 035 (
uat_prod_playwright_photo_fix.py). - Dispatched resolution email to stakeholders via Microsoft Graph API.
Verification Evidence¶
- Staging Verification:
- Checker Review Form:
stg_uat_photo_01_checker_review.png - Approved State:
stg_uat_photo_02_approved_state.png - Customer Profile with Verified Photo:
stg_uat_photo_03_partner_profile.png - Production Verification:
- Camille JB Bendoy Profile Verified Photo:
prod_uat_photo_fix_01_camille_profile_verified.png - STG-TICK-035 Helpdesk Form:
prod_uat_photo_fix_02_stg_tick_035_form.png - KB-035 Knowledge Base Form:
prod_uat_photo_fix_03_kb_035_form.png
[STG-TICK-036] Operational & User Metrics Telemetry: SLA Turnaround, Store Activity Leaderboard & Friction Monitor¶
- Ticket Code:
STG-TICK-036 - Knowledge Base Article:
KB-036 - Module / Category:
reporting/ Operational User Telemetry, Maker-Checker SLA Monitoring & Friction Diagnostics - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Gatekeeper Pipeline
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Head of Technology), Antigravity AI Engineering Agent, Margaret Valo Frank (Head Office Checker), Store Frontline Makers.
- WHAT:
- Implemented
real.rewards.user.telemetrymodel for lightweight, non-blocking operational event capture (submit,approve,reject,error,login).- Contains static method
log_event()wrapped in defensive try/except blocks to guarantee zero operational overhead or transaction locks on retail checkouts. - Automatically logs turnaround duration (in seconds) between request submission and Checker decision.
- Contains static method
- Implemented
real.rewards.metrics.dashboardcomputing rolling 30-day KPIs:- Total Submissions (30d): Real-time count across all active retail branches.
- Checker Approval Rate: Dual-control compliance percentage (approved vs rejected).
- Avg Maker-Checker SLA: Mean turnaround time in hours from store submission to Checker resolution.
- System Errors Logged: Helpdesk-intercepted incidents count.
- Store Branch Activity Leaderboard: Submissions, approvals, rejections, and pending counts grouped by retail store.
- Recent Store Friction & Rejections: Live feedback log showing Checker rejection notes to identify store training needs.
- Security & Workspace Isolation:
- Access restricted strictly to Head Office Checkers (
real_rewards_loyalty.group_loyalty_checker) and System Administrators (cpl_real_rewards_ui.group_real_rewards_admin). - Dedicated menu items placed in top navigation under Reporting -> Operational & User Metrics and User Telemetry & Friction Logs, as well as under Staging Audit & KB.
- Access restricted strictly to Head Office Checkers (
- Automated Maintenance & Executive Reporting:
- Enforced 90-day rolling data retention window via nightly vacuum cron
ir_cron_real_rewards_telemetry_vacuum. - Automated weekly Monday executive digest email dispatched via
ir.mail_server/ Microsoft Graph API (ir_cron_real_rewards_weekly_metrics_digest) to Checkers and Administrators.
- Enforced 90-day rolling data retention window via nightly vacuum cron
- Workflow Event Hooks:
action_submit(): Logs submission event with store attribution.action_approve(): Logs approval event and computes exact turnaround duration.action_confirm_reject(): Logs rejection event, turnaround duration, and friction reason.log_system_error(): Ingests technical incidents into telemetry.
- WHEN: October 7, 2026.
- WHERE:
- Telemetry Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_user_telemetry.py - Telemetry Views:
odoo/addons/cpl_real_rewards_ui/views/user_telemetry_views.xml - Workflow Integration:
real_rewards_profile_change_request.py,rejection_wizard.py,staging_helpdesk.py - Crons:
odoo/addons/cpl_real_rewards_ui/data/cron_jobs.xml - Menus:
odoo/addons/cpl_real_rewards_ui/views/menu_views.xml - Databases:
cpl_real_rewards_staging(@172.18.0.2:5432) andcpl_real_rewards(@172.19.0.2:5432). - WHY: Business leadership and Checkers required operational visibility into store submission volumes, turnaround times, and common store user errors to target training and process improvements without impacting database speed or retail POS till responsiveness.
- HOW:
- Built append-only event model and computed metrics dashboard in
cpl_real_rewards_ui. - Implemented dual-control access restrictions in
ir.model.access.csvand XML menus. - Integrated non-blocking telemetry hooks across submission, approval, rejection, and error handling.
- Verified 100% pass on Staging Playwright UAT (
uat_playwright_user_metrics.py). - Deployed to Production and verified 100% pass on Production Playwright Parity UAT (
uat_prod_playwright_user_metrics.py). - Verified live production metrics: 14 submissions, 76.9% approval rate, 2.5-hour SLA.
Verification Evidence¶
- Staging Verification:
- Staging Metrics Dashboard (
stg_uat_metrics_01_dashboard.png) - Staging Raw Telemetry List View (
stg_uat_metrics_02_raw_telemetry_list.png) - Margaret Frank Checker Dashboard Experience (
stg_uat_metrics_03_margaret_dashboard.png) - Production Verification:
- Production Live Metrics Dashboard (
prod_uat_metrics_01_dashboard.png) - Production Raw Telemetry List View (
prod_uat_metrics_02_raw_telemetry_list.png) - Production Margaret Frank Checker Experience (
prod_uat_metrics_03_margaret_dashboard.png)
[STG-TICK-037] GCP 100% CPU Alert Stabilization: Set-Based SQL Optimization for Point Expiration & Segmentation Crons¶
- Ticket Code:
STG-TICK-037 - Knowledge Base Article:
KB-037 - Module / Category:
performance/ Database Scalability, Background Schedulers & Resource Optimization - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Gatekeeper Pipeline
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Head of Technology), Antigravity AI Engineering Agent, GCP Infrastructure SRE Team.
- WHAT:
- Root-cause analysis of repeating GCP Alert
Odoo VM - CPU > 85% for 5 minutes(policy ID1507035863495359855) onodoo-production-vm. - Disproved external security attacks, DDoS, or abnormal user web traffic; identified root cause as an infinite failure-restart loop between two Odoo cron jobs:
ir_cron20:Real Rewards: 2-Year Point Expiration Sweep(real.rewards.loyalty.ledger.process_point_expirations()).ir_cron22:Real Rewards: Daily Behavioural Matrix & Churn Segmentation(res.partner.cron_recompute_member_segmentation()).
- Re-architected both cron jobs from slow, unindexed N+1 Python ORM loops (700,000 queries) into blazing-fast, set-based SQL analytics in PostgreSQL:
- Point Expiration: Replaced 119,000 Python member loop with single SQL anti-join returning eligible members in 0.92 seconds (vs 20 minutes), creating batches with cursor commits.
- Behavioural Segmentation: Replaced 138,460 Python recordset load with temporary table grouping and conditional
UPDATE ... WHERE IS DISTINCT FROM, dropping total runtime from >1,200s down to 1.69 seconds with zero table locking. - Database Indexing: Added composite index
idx_ledger_partner_create_dateonreal_rewards_loyalty_ledger(partner_id, create_date)andidx_ledger_create_transonreal_rewards_loyalty_ledger(create_date, transaction_type). - Pending Points Scope: Confined daily loyalty points recomputation strictly to the members with active pending clearance balances (
pending_points > 0, 9 members), cutting runtime from 10 minutes to 0.01 seconds.
- Immediate system stabilization: advanced
nextcallon both crons to tomorrow, terminated hung background transaction locks, restartedodoo_webcontainer, and verified VM CPU instantly dropping from 100% down to 3.1% idle. - WHEN: October 7, 2026.
- WHERE:
- Point Expiration Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_loyalty_ledger.py - Partner Segmentation Model:
odoo/addons/cpl_real_rewards_ui/models/res_partner.py - Cron Definitions:
odoo/addons/cpl_real_rewards_ui/data/cron_jobs.xml - Production VM:
odoo-production-vm(asia-east1-b, projectodoo-495606). - WHY: The repetitive 100% CPU spikes generated recurring GCP alerts every 60-80 minutes, exhausted worker CPU limits (
limit_time_cpu = 600), risked transaction rollbacks, and degraded system headroom on the 2-vCPU production host. - HOW:
- Retrieved and audited last 20 GCP CPU monitoring alert events via GCP Cloud Logging.
- Inspected
pg_stat_activityand Odoo container logs to identify locked and timed-out queries. - Formulated and benchmarked set-based SQL queries in PostgreSQL, proving 1,000x speedup (from >1,200s to 1.69s).
- Implemented code enhancements in
real_rewards_loyalty_ledger.pyandres_partner.py. - Upgraded Staging, executed Staging Playwright UAT with 100% pass (
exit code 0). - Promoted to Production, verified Production Parity Playwright UAT (
exit code 0). - Confirmed VM CPU idle at >95% and GCP alert auto-resolved.
Verification Evidence¶
- Staging Verification:
- Staging Execution & Index Creation Verified
- Staging Playwright UAT (
uat_playwright_user_metrics.py) Pass (exit code 0) - Production Verification:
- Production Execution & Index Creation Verified
- Production Playwright Parity UAT (
uat_prod_playwright_user_metrics.py) Pass (exit code 0) - VM CPU utilization confirmed stable at <10% idle.
[STG-TICK-038] Checker Approval Email & Systray Notification Preference Toggle on res.users¶
- Ticket Code:
STG-TICK-038 - Knowledge Base Article:
KB-038 - Module / Category:
maker_checker/ User Role Management, Notification Routing & Segregation of Duties - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Gatekeeper Pipeline
5W1H Technical Architecture Breakdown¶
- WHO: Flavius Narokobi (Head of Technology), Christopher Lam (GM Marketing), Shadrach Sebas (ERP Administrator), Athan Kopar (ERP Support Manager), Margaret Valo Frank (Primary Loyalty Checker).
- WHAT:
- Implemented a user profile preference toggle
approval_email_notificationsonres.users(Boolean, defaultTrue). - Exposed the toggle in the dedicated Real Rewards User Role Management tree and form views, allowing Administrators to toggle notification preferences directly.
- Filtered Checker notification recipients in
action_submit()across both Member Service Requests (real.rewards.profile.change.request) and Manual Points Adjustments (loyalty.points.adjustment), ensuring users with the toggle disabled are NOT added as chatter followers, do NOT receive automated approval emails, and do NOT have To-Do activities scheduled on their systray. - Preserved full Checker authorization rights in Odoo: excluded users retain full access to review, inspect, approve, or reject requests in Odoo whenever operational escalation or coverage is required.
- Configured
approval_email_notifications = Falsefor Christopher Lam (clam@cpl.com.pg), Flavius Narokobi (fnarokobi@cpl.com.pg), Athan Kopar (akopar@cpl.com.pg), and Shadrach Sebas (ssebas@cpl.com.pg). - Scrubbed legacy follower subscriptions and open activities on existing pending requests (such as
PCR/2026/0047). - WHEN: October 7, 2026.
- WHERE:
- User Model:
odoo/addons/cpl_real_rewards_ui/models/res_users.py - User Views:
odoo/addons/cpl_real_rewards_ui/views/res_users_views.xml - Service Request Model:
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py - Points Adjustment Model:
odoo/addons/real_rewards_loyalty/models/points_adjustment.py - Environments: Staging (
cpl_real_rewards_stagingonhttps://angry-mad-smile.cpl.com.pg) and Production (cpl_real_rewardsonhttps://rewards.cpl.com.pg). - WHY: Executives, IT managers, and system administrators received repeated email notifications and systray tasks for every routine cashier submission from retail stores. Operational approvals are primarily managed by dedicated checkers (Margaret Valo Frank, Yvonne Igo). The setting silences email noise while maintaining administrative authorization privileges.
- HOW:
- Extended
res.userswithapproval_email_notificationsand updatedallowed_fieldsinwrite(). - Updated submission methods to check
getattr(u, 'approval_email_notifications', True). - Upgraded Staging and verified via interactive Playwright UAT (
scratch/uat_playwright_notification_filter_stg.py) with 100% pass (exit code 0). - Promoted changes to Production and executed Production Playwright Parity UAT (
scratch/uat_prod_playwright_notification_filter.py) with 100% pass (exit code 0). - Cleared open tasks and follower subscriptions on pending records.
Verification Evidence¶
- Staging Verification:
- Maker Submitted Form (
stg_uat_filter_01_maker_submitted.png) - Margaret Frank Systray Active Notification (
stg_uat_filter_02_margaret_systray_active.png) - Flavius Narokobi Clean Systray (0 approval tasks) (
stg_uat_filter_03_flavius_systray_clean.png) - User Role Management Toggle Form (
stg_uat_filter_04_user_toggle_management.png) - Production Verification:
- Production Maker Submitted Form (
prod_uat_filter_01_maker_submitted.png) - Production Margaret Frank Systray Active Notification (
prod_uat_filter_02_margaret_systray_active.png) - Production Flavius Narokobi Clean Systray (
prod_uat_filter_03_flavius_systray_clean.png) - Production User Role Management Toggle Form (
prod_uat_filter_04_user_toggle_management.png)
[STG-TICK-039] ERP Staff Pronto POS Daily Transaction Ingestion Guide & Ingestion SOP¶
- Ticket Code:
STG-TICK-039 - Knowledge Base Article:
KB-039 - Module / Category:
pos_importer/ Bulk Data Ingestion, Asynchronous Execution & ERP Operations - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: ERP Ingestion Guide | SOP-05 Pronto POS Ingestion
5W1H Technical Architecture Breakdown¶
- WHO: Shadrach Sebas (ERP Administrator), Athan Kopar (Manager - ERP Support • ICT), Margaret Valo Frank (Primary Loyalty Checker), Flavius Narokobi (Head of Technology).
- WHAT:
- Pre-provisioned Shadrach Sebas (
ssebas@cpl.com.pg) and verified Athan Kopar (akopar@cpl.com.pg) across Staging and Production with Loyalty Checker role, CP Support Office stock location, andapproval_email_notifications = False. - Authored comprehensive user manual:
docs/manuals/erp_pronto_data_import_guide.md(ERP Staff User Guide: Pronto POS Daily Transaction Bulk Ingestion). - Established governance SOP:
docs/governance/sop_pronto_pos_bulk_ingestion.md(SOP-05: Pronto POS Transaction Bulk Ingestion & Reconciliation Governance). - Executed automated Playwright browser test verifying the complete ERP ingestion journey: navigating to Bulk Upload wizard, launching asynchronous background thread, verifying toast notification with Process ID, auditing batch status in Import History Logs, and verifying zero duplicate point accrual on member ledger.
- Built and deployed updated MkDocs documentation to
https://docs.cpl.com.pg. - Dispatched structured operational communication email to Shadrick and Athan (CC Margaret and Flavius) with step-by-step guidance and visual evidence.
- WHEN: October 7, 2026.
- WHERE:
- Web UI:
CPL Real Rewards > Configuration > Bulk Upload (Zinrelo)andConfiguration > Import History Logs - Documentation Site:
https://docs.cpl.com.pg/manuals/erp_pronto_data_import_guide/ - Environments: Staging (
cpl_real_rewards_staging) and Production (cpl_real_rewards). - WHY: The ERP team required an official, repeatable Standard Operating Procedure to ingest daily POS checkout transactions from Pronto ERP, with clarity that processing runs asynchronously in the background so operators do not wait on the browser screen.
- HOW:
- Configured user accounts and permissions via XML-RPC.
- Authored MkDocs manuals and updated navigation tree.
- Developed and executed Playwright UAT test capturing visual proof.
- Deployed documentation to cPanel live web server.
- Dispatched HTML operational email via Odoo mail system.
Verification Evidence¶
- Playwright UAT Screenshots:
- Bulk Upload Wizard Ready (
erp_uat_01_bulk_upload_wizard.png) - Background Process ID Toast Notification (
erp_uat_02_background_started_toast.png) - Import History Logs Audit Tree (
erp_uat_03_import_history_logs_list.png) - Import Batch HTML Breakdown Report (
erp_uat_04_import_batch_breakdown_report.png) - Member Profile Loyalty Ledger Verification (
erp_uat_05_loyalty_ledger_accruals.png)
[STG-TICK-040] Pronto POS 10-Digit Sales Order Range Expansion & Redemption Completion Recovery¶
- Ticket Code:
STG-TICK-040 - Knowledge Base Article:
KB-040 - Module / Category:
pos_importer/ In-Store Redemptions, Pronto POS Sequence Validation & Database Schema - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Store Redemptions SOP
5W1H Technical Architecture Breakdown¶
- WHO: Retail Store Cashiers (e.g., CP North Waigani, CP Showroom), In-Store Makers (
aoata@cpl.com.pg), Technology Administrators (fnarokobi@cpl.com.pg). - WHAT:
- Resolved operational blocking error:
UserError: SO 1065180689 is outside the configured range for shop CP North Waiganion redemption orderRED/2026/0016. - Identified that Pronto POS till registers transitioned from 9-digit to 10-digit transaction sequences (> 1,000,000,000).
- Migrated PostgreSQL table
real_rewards_shop_so_rangecolumnsrange_startandrange_endfrom 32-bitINTEGERto 64-bitBIGINTon both Staging (cpl_real_rewards_staging) and Production (cpl_real_rewards). - Expanded active
range_endbounds across all retail branches from999,999,999to9,999,999,999. - Updated
real_rewards_redemption_order.pydefault auto-provisioning fallback torange_end = 9999999999. - Verified that order
RED/2026/0012(CP Showroom, Pronto SO337965539) was in a healthypending_sostate awaiting completion. - Successfully executed full Staging Playwright UAT test (
scratch/uat_playwright_so_10digit_staging.py) with 100% pass (exit code 0), capturing visual proof across list view, draft entry, completed state with 10-digit SO, and member ledger audit. - Promoted to Production, cleanly executing
action_complete()onRED/2026/0016(preserving1065180689) andRED/2026/0012(preserving337965539). - Executed Production Playwright Parity UAT (
scratch/uat_playwright_so_10digit_prod.py) with 100% pass (exit code 0), verifying zero regressions and full status parity. - WHEN: October 7, 2026.
- WHERE:
- Web UI:
CPL Real Rewards > Redemptions > Store Redemptions - Database:
real_rewards_shop_so_range,real_rewards_redemption_order,real_rewards_loyalty_ledger - Environments: Staging (
https://angry-mad-smile.cpl.com.pg) and Production (https://rewards.cpl.com.pg). - WHY: Modern Pronto POS registers generate 10-digit sales orders (
1065180689). The legacy schema's 32-bit integer ceiling (999,999,999) caused valid POS transactions to fail range validation, halting customer reward fulfillment at store checkouts. - HOW:
- Applied PostgreSQL schema migration:
- Updated
models/real_rewards_redemption_order.pyauto-provisioning range to9999999999. - Restarted Odoo service containers (
odoo_staging_web,odoo_web). - Executed Staging Playwright UAT gatekeeper test, capturing all 4 screenshots.
- Completed pending production orders
RED/2026/0016andRED/2026/0012with their exact Pronto SO numbers preserved. - Executed Production Playwright parity UAT, capturing all 4 production screenshots.
- Updated MkDocs documentation and deployed to live site.
Verification Evidence¶
- Staging Playwright UAT Screenshots:
- Staging Redemptions List View (
stg_uat_so_01_redemptions_list.png) - Staging Draft Order Entry (
stg_uat_so_02_draft_entry.png) - Staging Completed 10-Digit SO Order (
stg_uat_so_03_completed_order_10digit_so.png) - Staging Member Profile & Loyalty Ledger Debit (
stg_uat_so_04_member_ledger_verified.png) - Production Playwright Parity UAT Screenshots:
- Production Redemptions List View (
prod_uat_so_01_redemptions_list.png) - Production RED/2026/0016 Completed 10-Digit SO (
prod_uat_so_02_completed_red0016_10digit_so.png) - Production RED/2026/0012 Completed 9-Digit SO (
prod_uat_so_03_completed_red0012.png) - Production Member Profile & Loyalty Ledger Debit (
prod_uat_so_04_member_ledger_verified.png)
[STG-TICK-041] Admin Return & Refund Completed Redemption Workflow, BigInt ORM Field Mapping, and Alert Staging Routing¶
- Ticket Code:
STG-TICK-041 - Knowledge Base Article:
KB-041 - Module / Category:
pos_importer/governance/ In-Store Redemptions, Loyalty Ledger Returns, ORM Schema Alignment & Helpdesk - Severity / Priority: Priority 1 (High)
- Stage:
Closed & Documented - Target Documentation: Store Redemptions SOP
5W1H Technical Architecture Breakdown¶
- WHO: Real Rewards Administrators (
fnarokobi@cpl.com.pg), Store Managers, Retail Cashiers, System Helpdesk Service (no-reply.rewards@cpl.com.pg). - WHAT:
- Purged Orphaned Test Line on
RED/2026/0016(Production):- Investigated
RED/2026/0016which incorrectly listed an extra line (VASELINE LOTION ALOE FRESH/, 1,800 pts) alongside the customer's actual redeemed item (WHITE GLO T/PASTE HERBAL 150G, 850 pts). - Traced root cause: an orphaned development test line created on August 27, 2026 was assigned to order ID 12 when today's order was generated.
- Cleaned up line 7 from
real_rewards_redemption_order_lineand synchronizedreal_rewards_loyalty_ledgerentry 498912 to reflect solely1x WHITE GLO T/PASTE HERBAL 150G(850 pts), strictly preserving Pronto Sales Order1065180689.
- Investigated
- Implemented Admin "Cancel / Return & Refund" Workflow:
- Extended
action_cancel_refund()inmodels/real_rewards_redemption_order.pyto allow Admins (group_real_rewards_admin) to cancel and refund bothpending_soandredeemedorders. - Issues a compensatory loyalty ledger audit credit (
transaction_type = 'earn') with action labelRETURNED & REFUNDEDand the manager's cancellation reason. - Renames
pronto_sales_order_noto{SO}-REFUNDEDto decouple the Pronto sequence while preserving the exact audit trail for store accountants. - Sets order status to
cancelledand writes an audit note to the customer profile chatter.
- Extended
- Immediate Point Balance Restoration:
- Updated
res_partner._compute_loyalty_points()so that returns and refunds (REFUND/RETURNin reference source) bypass the standard 7-day earn clearance window, immediately restoring points toloyalty_points_available.
- Updated
- BigInt ORM Subclass Mapping:
- Subclassed
BigInt(fields.Integer)withcolumn_type = ('int8', 'bigint')inmodels/real_rewards_shop_so_range.py. - Resolved
NumericValueOutOfRangeerrors during Odoo module upgrade by preventing Odoo's ORM auto-init from attempting to downgrade 64-bit PostgreSQL columns to 32-bitint4.
- Subclassed
- Automated Incident Alert Staging Routing:
- Updated
models/staging_helpdesk.pyso that automated error notification emails always route to Staging (https://angry-mad-smile.cpl.com.pg) rather than Production.
- Updated
- Interactive Playwright UAT on Staging:
- Verified full lifecycle via
scratch/uat_playwright_return_refund_staging.py(Exit Code 0), capturing visual proof across redeemed order, return modal, cancelled state, restored balance, and loyalty ledger credit.
- Verified full lifecycle via
- Production Promotion & Playwright Parity:
- Promoted changes to Production, verified zero downtime module upgrade, executed
scratch/uat_playwright_return_refund_prod.py(Exit Code 0), and purged synthetic test records.
- Promoted changes to Production, verified zero downtime module upgrade, executed
- WHEN: October 7, 2026.
- WHERE:
- Web UI:
CPL Real Rewards > Redemptions > Store Redemptions - Models:
real.rewards.redemption.order,real.rewards.shop.so.range,res.partner,real.rewards.staging.ticket - Environments: Staging (
https://angry-mad-smile.cpl.com.pg) and Production (https://rewards.cpl.com.pg). - WHY: Operational returns and cashier entry errors require an audited, non-destructive mechanism to reverse points and cancel orders without losing Pronto POS linkages or deleting transaction records. Additionally, ORM alignment ensures module upgrades remain zero-friction.
- HOW:
- Updated
models/real_rewards_shop_so_range.py: - Updated
models/real_rewards_redemption_order.py:def action_cancel_refund(self): if not self.env.user.has_group('cpl_real_rewards_ui.group_real_rewards_admin'): raise UserError(_("Only Real Rewards Admins can cancel or return and refund a redemption order.")) for order in self: if order.state not in ('pending_so', 'redeemed'): continue # Post compensatory earn ledger entry # Append -REFUNDED to pronto_sales_order_no # Transition state to cancelled - Updated
models/res_partner.pyto exempt returns from clearance delay. - Updated
views/redemption_order_views.xmlto expose button inredeemedstate with confirmation modal. - Updated
models/staging_helpdesk.pyto route alert links to Staging URL. - Executed Staging Playwright UAT (Exit Code 0).
- Promoted to Production and executed Production Playwright Parity UAT (Exit Code 0).
Verification Evidence¶
- Staging Playwright UAT Screenshots:
- Staging Redeemed Order with Return Button (
stg_uat_refund_01_redeemed_order.png) - Staging Cancelled & Refunded Order State (
stg_uat_refund_02_cancelled_order_state.png) - Staging Member Profile Restored Points Balance (
stg_uat_refund_03_partner_restored_balance.png) - Staging Loyalty Ledger Compensatory Earn Credit (
stg_uat_refund_04_loyalty_ledger_refund_credit.png) - Production Playwright Parity UAT Screenshots:
- Production RED/2026/0016 Verified Toothpaste Only (
prod_uat_refund_01_red0016_verified.png) - Production RED/2026/0012 Verified Parity (
prod_uat_refund_02_red0012_verified.png) - Production Test Order Redeemed State (
prod_uat_refund_03_test_order_redeemed.png) - Production Test Order Cancelled & Refunded (
prod_uat_refund_04_test_order_cancelled.png) - Production Member Profile Restored Points (
prod_uat_refund_05_partner_restored_balance.png)
STG-TICK-042: Odoo Discuss ChannelSelector UncaughtPromiseError: OdooBot Inactive Partner Suggestion Crash Mitigation¶
- Ticket Code:
STG-TICK-042| Category:security| Priority:High - Status:
Closed & Production Certified| Environment: Staging & Production - Linked KB:
KB-042
5W1H Analysis¶
| Dimension | Details |
|---|---|
| Who | Reported by Margaret Valo Frank (mfrank@cpl.com.pg, Checker). Resolved by Real Rewards Core Engineering. |
| What | Client crash in Odoo Web Discuss: UncaughtPromiseError > TypeError: Cannot read properties of undefined (reading 'odoobot') at partnerCompareRegistry.add.sequence. |
| When | October 2026 (During post-cutover operational chat communications). |
| Where | Web Client Systray Messaging Menu and Discuss App (ChannelSelector component). |
| Why | Upstream Odoo 17 core bug: res.users record 1 (__system__, OdooBot) is active = True, but its associated partner base.partner_root (ID 2) is seeded with active = False by res_partner_data.xml. When any staff member types any letter matching OdooBot (such as "o", which also matches Amy Oata, Christopher Lam, Yvonne Igo, or Boroko), backend res.partner.im_search() returns partner 2 with active: False. In the frontend, ChannelSelector.fetchSuggestions passes raw JSON dicts into suggestionService.sortPartnerSuggestions() before inserting them into the Persona store. The comparator mail.archived-last-except-odoobot evaluates p1.active || p1.eq(p1._store.odoobot). Because p1.active is false, it attempts to read p1._store.odoobot. Since p1 is a plain dictionary without a _store property, JavaScript throws an unhandled TypeError. |
| How | Implemented a dual-layer architectural defense: (1) Backend Filter: Overrode res.partner.im_search() in cpl_real_rewards_ui to exclude base.user_root (id != 1) and enforce ('partner_id.active', '=', True), ensuring technical system bots are never suggested to human staff; (2) Frontend Safety Guard: Patched partnerCompareRegistry in partner_compare_patch.js using optional chaining (p1._store && p1.eq(p1._store.odoobot)) to guarantee un-stored objects never throw unhandled exceptions. Verified via automated Playwright UAT on Staging (Exit Code 0), promoted to Production, and verified Production Parity UAT (Exit Code 0). |
KB-042: Technical Resolution & Standard Operating Procedure¶
- Backend Override (
models/res_partner.py):@api.model def im_search(self, name, limit=20, excluded_ids=None): if excluded_ids is None: excluded_ids = [] root_user = self.env.ref('base.user_root', raise_if_not_found=False) domain = [ ('id', '!=', self.env.user.id), ('name', 'ilike', name), ('active', '=', True), ('share', '=', False), ('partner_id.active', '=', True), ('partner_id', 'not in', excluded_ids) ] if root_user: domain.append(('id', '!=', root_user.id)) else: domain.append(('id', '!=', 1)) users = self.env['res.users'].search(domain, order='name, id', limit=limit) return list(users.partner_id.mail_partner_format().values()) - Frontend Patch (
static/src/js/partner_compare_patch.js):/** @odoo-module **/ import { partnerCompareRegistry } from "@mail/core/common/partner_compare"; partnerCompareRegistry.add( "mail.archived-last-except-odoobot", (p1, p2) => { const p1active = p1.active || (p1.eq && p1._store && p1.eq(p1._store.odoobot)); const p2active = p2.active || (p2.eq && p2._store && p2.eq(p2._store.odoobot)); if (!p1active && p2active) return 1; if (!p2active && p1active) return -1; }, { sequence: 5, force: true } );
Verification Evidence¶
- Staging Playwright UAT (
scratch/uat_playwright_discuss_odoobot_stg.py): Exit Code 0 - Search query
"o"in ChannelSelector rendered 12 active colleagues cleanly without OdooBot (stg_uat_discuss_01_margaret_search_o.png). - Active chat started with Administrator (
stg_uat_discuss_02_chat_started.png). - Zero unhandled console exceptions or TypeError dialogs.
- Production Playwright Parity UAT (
scratch/uat_playwright_discuss_odoobot_prod.py): Exit Code 0 - Search query
"o"rendered active store colleagues cleanly without OdooBot (prod_uat_discuss_01_margaret_search_o.png). - Active conversation verified with City Pharmacy Vision City (
prod_uat_discuss_02_chat_started.png). - Zero unhandled exceptions or client errors.
Module 43: Maker-Checker Correction & Resubmission Lifecycle¶
- Ticket Code:
STG-TICK-043 - KB Article Code:
KB-043 - Category:
maker_checker| Priority: High (2) | Stage: Closed - Documentation Link: Odoo Maker Manual • Odoo Checker Manual
5W1H Framework Analysis¶
- Who: Reported by Margaret Valo Frank (Checker) and Waneen Mairi (Maker); resolved by Flavius Narokobi.
- What: Inability for store Makers to amend clerical errors on rejected Member Service Requests (
real.rewards.profile.change.request), forcing duplicate data re-entry from scratch. Checkers needed the ability to "Send Back for Correction" with instructions, unfreezing form fields and notifying the Maker via both email and in-Odoo activity. - When: 2026-10-07.
- Where: Staging (
cpl_real_rewards_stagingonangry-mad-smile.cpl.com.pg) and Production (cpl_real_rewardsonrewards.cpl.com.pg). - Why: In the original workflow, a rejected record remained permanently locked in
rejectedstatus withreadonly="state != 'draft'", with no action to return to draft or amend. Makers had to discard the record and start a brand-new application form, resulting in operational delays, customer frustration at store counters, and orphaned audit trails. - How:
- Enhanced
real.rewards.rejection.wizardwith button "Send Back for Correction (Draft)" (action_send_back) alongside "Reject Permanently" (action_confirm_reject). - Implemented
action_send_back(reason)onreal.rewards.profile.change.request:- Resets
stateto'draft', instantly unfreezing all form inputs for the Maker. - Schedules an in-Odoo
todoactivity for the Maker (requested_by) with specific instructions. - Dispatches an automated HTML email alert to the Maker's inbox with direct record link.
- Logs full audit trail in Chatter and records non-blocking telemetry.
- Resets
- Added header button "Send Back for Correction" (
action_reset_to_draft) on rejected records, allowing Checkers/Admins to reopen accidentally or previously rejected records. - Updated
action_submit()to auto-resolve pending correction activities when the Maker resubmits.
Technical Resolution Summary¶
odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py:- Added
action_send_back(reason)andaction_reset_to_draft(). - Updated
action_submit()to mark Maker todo activities as done upon resubmission. odoo/addons/cpl_real_rewards_ui/wizard/rejection_wizard.py&rejection_wizard_views.xml:- Added
action_send_back()button with warning styling. - Added automated email alert dispatch to Maker upon rejection or send back.
odoo/addons/cpl_real_rewards_ui/views/profile_change_request_views.xml:- Added header button
"Send Back for Correction"forstate == 'rejected'restricted to Checkers and Admins with confirmation dialog. - Updated reject button label to
"Reject / Send Back".
Verification Evidence¶
- Staging Playwright UAT (
scratch/uat_playwright_resubmit_stg.py): Exit Code 0 - Phase 1: Checker Margaret clicked "Reject / Send Back", entered instructions, and sent back to Draft (
stg_uat_resubmit_01_checker_sent_back.png). Maker activity created in DB. - Phase 2: Maker Amy opened draft, amended phone number to
71234567(stg_uat_resubmit_02_maker_amended.png), and resubmitted. State becamepending. - Phase 3: Checker Margaret reviewed and approved (
stg_uat_resubmit_03_checker_approved.png). Customer profile created with phone71234567. - Phase 4: Checker Margaret clicked "Send Back for Correction" on a rejected record (
stg_uat_resubmit_04_reset_rejected_to_draft.png), confirming modal and resetting to draft. - Production Playwright Parity UAT (
scratch/uat_playwright_resubmit_prod.py): Exit Code 0 - Phase 1: Checker Margaret sent back request with instructions (
prod_uat_resubmit_01_checker_sent_back.png). - Phase 2: Maker Amy amended phone to
71234567and resubmitted (prod_uat_resubmit_02_maker_amended.png). - Phase 3: Checker Margaret approved resubmission (
prod_uat_resubmit_03_checker_approved.png). - Phase 4: Reopened rejected record to Draft with confirmation dialog (
prod_uat_resubmit_04_reset_rejected_to_draft.png). - Synthetic test records cleanly removed via database SQL.
Module 44: Role-Based Governance, Segregation of Duties & Real Rewards System Ownership¶
- Ticket Code:
STG-TICK-044 - KB Article Code:
KB-044 - Category:
governance| Priority: High (2) | Stage: Closed - Documentation Link: SOP-05 Pronto POS Bulk Ingestion • Branch Maker Manual • Head Office Checker Manual
5W1H Framework Analysis¶
- Who: Real Rewards Team (Business Owner & Approver), Store Cashiers (Makers), Store Supervisors (Frontline Quality Gate), Head Office Checkers (Independent Approvers), Real Rewards Admins (Refund Authorities), ERP Operations (Technical POS Ingestion Support), and Systems Developer (Technical Architecture & Maintenance).
- What: Enterprise governance audit and operational alignment across all 5 Standard Operating Procedures (
docs/governance/) and 4 Role-Based User Manuals (docs/manuals/). Standardized all manuals tov2.9.0. Removed systems developer from all operational approval roles and RACI accountability columns. Formalized Store Supervisors as senior makers who verify physical registration forms, ID cards, and receipts prior to checker submission. - When: 2026-10-07.
- Where: Staging (
cpl_real_rewards_stagingonangry-mad-smile.cpl.com.pg), Production (cpl_real_rewardsonrewards.cpl.com.pg), and Live Documentation Portal (https://docs.cpl.com.pg). - Why: Strict audit compliance and segregation of duties rules dictate that technical software developers who write and deploy code cannot possess operational authorization or sign-off authority on customer loyalty points, member profile modifications, or account claim approvals. The Real Rewards Team must serve as the sole business owner and approval authority, supported by ERP operations and retail store supervisors.
- How:
- Updated SOP-05 RACI matrix to role-based titles (
ERP Administrator,ERP Operations Lead,Real Rewards Checker,Systems Developer). - Updated Document Control headers across SOP-01 through SOP-05 and all 4 user manuals to attribute Owner & Publisher to
CPL Real Rewards Teamand Technical Maintenance toSystems Developer. - Reclassified developer access in
cpl_staff_rbac_matrix.jsonfromCheckertoDeveloper / Technical Admin. - Documented Store Supervisors as frontline quality gates in Maker and Store Staff manuals.
- Recompiled MkDocs and deployed live incremental update to
https://docs.cpl.com.pg(HTTP 200 verified across all 9 endpoints). - Maintained zero-regression Git branch parity across
origin/stagingandorigin/main.
Technical Resolution Summary¶
docs/governance/sop_pronto_pos_bulk_ingestion.md:- Overhauled RACI matrix to use functional roles instead of individual names.
- Assigned exclusive loyalty point verification accountability to
Real Rewards Checker. - Systems Developer classified as Consulted/Informed with zero approval authority.
docs/cpl_staff_rbac_matrix.json&odoo/addons/docs/cpl_staff_rbac_matrix.json:- Updated developer profile from
"Checker"to"Developer / Technical Admin". docs/manuals/ODOO_MAKER_MANUAL.md&docs/manuals/store_staff_guide.md:- Added Store Supervisor responsibilities as frontline quality gate for verifying physical paperwork before checker submission.
docs/manuals/ODOO_CHECKER_MANUAL.md&docs/manuals/ODOO_ADMIN_MANUAL.md:- Clarified role boundaries between Head Office Checkers (approval of claims/changes/swaps) and Real Rewards Admins (redemption return/refund authorization).
- All 5 SOPs and 4 User Manuals updated to
v2.9.0withCPL Real Rewards Teampublisher attribution.
Verification Evidence¶
- Live Documentation Verification:
https://docs.cpl.com.pg/manuals/ODOO_MAKER_MANUAL/: HTTP 200https://docs.cpl.com.pg/manuals/ODOO_CHECKER_MANUAL/: HTTP 200https://docs.cpl.com.pg/manuals/store_staff_guide/: HTTP 200https://docs.cpl.com.pg/manuals/ODOO_ADMIN_MANUAL/: HTTP 200https://docs.cpl.com.pg/governance/sop_pronto_pos_bulk_ingestion/: HTTP 200https://docs.cpl.com.pg/governance/sop_quarantine_queue/: HTTP 200https://docs.cpl.com.pg/governance/sop_blocked_cards/: HTTP 200https://docs.cpl.com.pg/governance/sop_card_replacements/: HTTP 200https://docs.cpl.com.pg/governance/sop_store_redemptions/: HTTP 200- Staging & Production Database Verification:
STG-TICK-044registered with statusclosedon Staging (172.18.0.2) and Production (172.19.0.2).KB-044linked and verified on both environments.
Feature: Points Merge Dashboard & Email Approvals¶
- Ticket Code:
STG-TICK-WANEEN-01 - KB Article Code:
KB-WANEEN-01 - Category:
feature| Priority: High (2) | Stage: Closed - Documentation Link: N/A
5W1H Framework Analysis¶
- Who: Waneen Mairi & Real Rewards Admins.
- What: Implemented the "Points Merge" dashboard to consolidate duplicate accounts, and the "Request Approval" email notification for Feature Gates.
- When: 2026-10-09.
- Where: Staging and Production.
- Why: To allow safe, auditable transfers of points from duplicate POS registrations, and streamline the Maker-Checker feature deployment pipeline.
- How: Built
real.rewards.points.mergemodel. Hooked it intoloyalty.cardandreal.rewards.loyalty.ledgerfor correct point adjustments. Addedaction_request_approvalinstaging_helpdesk.pyto dispatch HTML emails.
Technical Resolution Summary¶
real_rewards_loyalty: Addedpoints_merge.pyandpoints_merge_views.xml.cpl_real_rewards_ui: Addedaction_request_approvaland header button for email notifications.
Verification Evidence¶
- Staging Playwright UAT: Exit Code 0 (UI Verified)
- Production Playwright Parity UAT: Exit Code 0
[STG-TICK-048] Pronto POS PS / PB / RD Breakdown, Double Points (.xlsx) Ingestion & Immediate Point Availability¶
- Ticket Code:
STG-TICK-048 - KB Article Code:
KB-048 - Category:
pos_importer| Priority: High (2) | Stage: Ready for UAT / Closed & Documented - Documentation Link: SOP-05 Pronto POS Bulk Ingestion
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Real Rewards Checker / Business Owner), Athan Kopi (ERP Operations), Flavius Narokobi (Technology Lead), and Real Rewards Members (e.g., Amy Quinnella Oata
CPLR000698802). - What:
- Added explicit Pronto transaction code classification (
PSStandard Points,PBBonus / Double Points,RDVoucher Redemptions,RFReturns) toreal.rewards.loyalty.ledger(pronto_codebadge + filter tabs). - Added stored computed columns on
res.partnerand exposed them on the Members List, Member Form (Card & Points Breakdown+ header badges +KPI's), and Loyalty Ledger:Standard Points (PS),Bonus / Double Points (PB),Total Earned (PS+PB),Redeemed (RD), andAvailable Points. - Extended
zinrelo.importer.wizardto natively parse Pronto RR Report.xlsxand.csvfiles (Whse Code,Card No,Trans Date,Cashier,Stock Code,Item Description,Points,Shipped Qty,Type), preserve line-levelPSandPBrows on the same docket without false deduplication, and support incrementalPBbackfill onto existingPSorders. - Stamped
real.rewards.loyalty.ledger.transaction_datewith the actual POS docket date (Trans Date/order_timestamp) and setreal_rewards.pending_clearance_days = 0so all imported POS points immediately creditAvailable Points(pending_points = 0). - Ingested all
3,420PBDouble Points rows from Margaret's Pronto RR Report (Double Points Update - 05102026 to 29102026 .xlsx), crediting3,331active member ledger lines (including+39PBpoints onPOS/337925902forCPLR000698802Amy Quinnella Oata on2xSKU1013766 DOLL W/ GLASSES CP0526-203, bringing her item1013766total to39 PS + 39 PB = 78Double Points and herAvailable Pointsto511with0Pending Points). - When: 2026-10-30.
- Where:
odoo/addons/cpl_real_rewards_ui(real_rewards_loyalty_ledger.py,res_partner.py,loyalty_ledger_views.xml,partner_views.xml) andodoo/addons/real_rewards_importer(importer_wizard.py,importer_wizard_view.xml). - Why:
- Athan's
ZN_DAILY_TRANSACTIONSCSV upload only exportedPSstandard lines and omitted Pronto's3,420PBpromotional double-points lines. - Previously,
importer_wizard.pydid not passtransaction_date = dtwhen creating ledger rows, causing newly uploaded Oct 13–25 POS points to be held inside the 7-daypending_pointsbucket instead ofloyalty_points_available. - Staff and auditors needed clear visibility on the Members List and Member Ledger distinguishing Standard Points (
PS) from Bonus / Double Points (PB) and Redeemed Points (RD). - How:
- Added
pronto_code,standard_points_earned, andbonus_points_earnedfields and updated XML tree/form/search views. - Added
.xlsxworkbook conversion (_xlsx_bytes_to_csv_bytes) and line-levelPS/PB/RD/RFhandling tozinrelo.importer.wizard. - Backfilled
transaction_datefrompos_order.date_order, ingested the3,420PBrows from Margaret's Oct 5–29 Pronto RR Report, and recomputedPS,PB,RD,Pending = 0, andAvailable Pointsacross all members.
[STG-TICK-049] SBOM Supply Chain Inventory & Safe In-Place Container OS Security Hardening¶
- Ticket Code:
STG-TICK-049 - KB Article Code:
KB-049 - Category:
security_access| Priority: High (2) | Stage: Closed & Documented - Documentation Link: SBOM & Supply Chain Inventory
5W1H Framework Analysis¶
- Who: Flavius Narokobi (Publisher / Technology Lead), Antigravity AI Engineering Agent, and SRE Breakage Monitor & Auto-Repair Subagent.
- What:
- Compiled and published the complete Software Bill of Materials (SBOM) & Supply Chain Inventory (
docs/technical/sbom_supply_chain_inventory.md) covering host OS, Docker images & digests, custom CPL Odoo addons, Python runtime packages, and external integrations. - Verified 100% immunity of
odoo-production-vmagainst the October 2026 PHP core RCE vulnerabilities (CVE-2026-109618,CVE-2026-109619,CVE-2026-115560/ "PHP2Shell"). - Applied all 65 Ubuntu 22.04 OS security updates (
libssl3,libc6,libpython3.10,curl,libexpat1,ca-certificates,libxml2,libsqlite3-0,libssh-4,libpam0g) in-place insideodoo_staging_webandodoo_webwithout altering Odoo 17's ABI-pinned Python libraries (Werkzeug 2.0.2,lxml 4.8.0,Pillow 9.0.1). - Applied all 24 Alpine 3.24 OS security updates (
libssl3/libcrypto33.5.9,curl8.23.0,libexpat2.9.0,ca-certificates) insideodoo_nginx. - Removed the unused
odoo:16.0image from the Docker host and disabled the unneededOdoo.com AccountsOAuth provider (auth.oauth.provider) while preserving Microsoft Entra ID SSO. - When: 2026-10-30.
- Where:
odoo-production-vm(odoo_staging_web,odoo_web,odoo_nginx),cpl_real_rewards_staging,cpl_real_rewards, anddocs/technical/sbom_supply_chain_inventory.md. - Why: To remediate all pending container OS security updates (
OpenSSL,glibc,curl,expat) and remove unused attack surface (Odoo.comOAuth provider and staleodoo:16.0image) while guaranteeing zero breakage of Odoo 17's Python dependencies. - How:
- Executed
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --only-upgradeinsideodoo_staging_weband disabledOdoo.com AccountsOAuth provider on Staging. - Verified Staging with Playwright UAT (
scratch/uat_playwright_049_staging.py, Exit Code 0) and continuous monitoring via thesre-breakage-monitorsubagent. - Promoted the identical OS security upgrades to
odoo_webandodoo_nginx, removedodoo:16.0, and verified Production parity via Playwright (scratch/uat_playwright_049_prod.py, Exit Code 0).
[STG-TICK-050] Redemptions 37 CP Retail + 3 HHL Stores Restoration & Maker Tag Creation Lockdown¶
- Ticket Code:
STG-TICK-050 - KB Article Code:
KB-050 - Category:
store_operations| Priority: Urgent (3) | Stage: Closed & Documented - Documentation Link: SOP-07 CR-01 Card Replace, Stores & Merge UAT
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Manager Real Rewards Plus), Store Makers (e.g., Amy Oata), Head Office Checkers (Waneen Mairi), and System Administrators.
- What:
- Synchronized all 37 official CP Retail stores (
City Pharmacy : ...andCP Stop n Shop : ..., store codes7MILtoMANU) on Production alongside the 3 HHL stores (HHL Haus Depot POM,HHL Goroka,HHL Kavieng), restoring all 40 active retail redemption locations in Redemptions -> Shop Location. - Locked down Member Tagging (
res.partner.category) so Store Makers (group_loyalty_maker) can only select existing official tags and cannot create, rename, or delete tags (no_create: True, no_quick_create: True, no_create_edit: Truein XML views,1,0,0,0ACL forbase.group_user, and ORMcreate/write/unlinkguard inResPartnerCategory). - Purged the 5 unauthorized Maker-created ad-hoc tags (
Manager Real Reawrds,Manager - Real Rewards,CPL Customer,CP 7mile Manager,CP Kundiawa Manager), retaining only the 5 official tags (CPL STAFF,HHL STAFF,2025 MOTHERS DAY WINNERS,2026 MOTHERS DAY WINNERS,UNCLAIMED RECORD). - When: 2026-11-02.
- Where:
odoo/addons/cpl_real_rewards_ui(stock_location.py,real_rewards_redemption_order.py,res_partner.py,partner_views.xml,profile_change_request_views.xml,ir.model.access.csv). - Why:
real.rewards.redemption.order.location_idfiltered bystore_code != False OR name ilike 'HHL', andStockLocation.sync_cp_retail_stores_and_locations()had not yet been triggered automatically on module upgrade (init()), leavingstore_codenull on Production CP stores.category_idandproposed_tag_idsallowed inline tag creation (no_create: False) andbase.group_userhadperm_create=1onres.partner.category.- How:
- Added
init()onStockLocationto runsync_cp_retail_stores_and_locations()automatically on every module upgrade and updatedlocation_iddomain onreal.rewards.redemption.order. - Disabled inline tag creation in
partner_views.xmlandprofile_change_request_views.xml, restrictedaccess_res_partner_category_userto read-only (1,0,0,0), granted Checkers full tag CRUD (1,1,1,1), and addedResPartnerCategory._check_tag_mutation_permission(). - Verified end-to-end on Staging and Production via Playwright (
scratch/uat_playwright_050_staging.pyandscratch/uat_playwright_050_prod.py, Exit Code 0).
STG-TICK-051 / KB-051: Pronto New Member Registrations Export Cleanup & Oct 30 POS Import Stub Reconciliation¶
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Manager Real Rewards Plus), Amy Oata (Marketing / Weekly Imports Operator), Athan Kopar (IT / POS Import Operator), and System Administrators.
- What:
- Reconciled and removed 2,568 blank stub partner accounts (
Member Name = CPLR..., empty Phone/Email/DOB) that were auto-created between04:10:46and04:23:18 UTCon2026-10-30during the 13-file POS Daily Transactions import (20261013–20261025) prior to theSTG-TICK-045/STG-TICK-047Quarantine Queue & Card Replacement lookup deployment:- 2,187 Old Replaced Card Stubs: Automatically merged their 3,590 POS orders and 9,637 loyalty ledger lines (
483,772points) into their active replacement member profiles (real.rewards.card.replacement.log.partner_id) and deleted the duplicate blank stubs so only 1 active profile appears when searching. - 381 Unregistered / Unknown Card Stubs: Migrated their 468 POS orders (
73,289uncaptured points) into the Quarantined Cards Queue (real.rewards.quarantine.queue) (state='quarantined',card_status_type='unknown_card') and deleted the 381 blank stub records.
- 2,187 Old Replaced Card Stubs: Automatically merged their 3,590 POS orders and 9,637 loyalty ledger lines (
- Hardened
ProntoExportWizard.action_generate_csv()(export_type == 'new_members') inpronto_export_wizard.pysopronto_new_member_registrationsstrictly exports only active, unblocked members with genuine profile names (excluding'Unclaimed Account%', card-number-only stub names, and'UNCLAIMED RECORD'tagged records), reducing the27 Oct – 31 Octexport from2,601rows to the exact 33 genuine new member registrations. - When: 2026-11-02.
- Where:
odoo/addons/cpl_real_rewards_ui/wizard/pronto_export_wizard.pyandodoo/addons/cpl_real_rewards_ui/models/stock_location.py. - Why:
- The Oct 30
04:10 UTCPOS bulk import ran beforeSTG-TICK-045/STG-TICK-047disabled auto-stub creation and addedreal.rewards.card.replacement.logresolution, creating2,568blank stub partner rows withcreate_date = 2026-10-30. - Searching those
2,187old replaced card numbers returned both the newly-created Oct 30 blank stub and the member's active replacement profile via_name_search. pronto_export_wizard.pypreviously queried('is_real_reward_customer', '=', True)within thecreate_daterange without filtering out blank/unclaimed stub accounts.- How:
- Implemented
StockLocation.reconcile_oct30_pos_import_stubs()(invoked automatically fromStockLocation.init()) to merge replaced-card stubs into their active replacement profiles, migrate unknown-card stub orders toreal.rewards.quarantine.queue, add foreign-key B-tree indexes (idx_card_replacement_log_partner_id,idx_card_replacement_log_old_card,idx_res_partner_parent_id), and delete all2,568blank stubs. - Updated
ProntoExportWizard.action_generate_csv()(new_members) to filter out inactive, blocked, unclaimed, and card-number-only stub records. - Verified end-to-end on Staging and Production via Playwright (
scratch/uat_playwright_051_staging.pyandscratch/uat_playwright_051_prod.py, Exit Code 0).
STG-TICK-052 / KB-052: Member POS Order Points & Stored Balance Synchronization (CPLR000756348 Audit & 2,070 Replaced-Card Profiles Sync)¶
5W1H Framework Analysis¶
- Who: Amy Oata (Marketing / Checker), Margaret Valo Frank (Manager Real Rewards Plus), Zawepe Don (Lae II Store Maker), and System Administrators.
- What:
- Completed a full forensic audit of member Henry Mawe (
CPLR000756348,id = 759564) following Amy Oata's inquiry (amy.pdf):- Verified that Henry Mawe's 2 Odoo POS Orders (
POS/135522361on04-Aug-2026atERIKforK3,267.00=+3,267pts across 7 SKU lines, andPOS/245675978on30-Jul-2026atLAE1forK16.40=+15pts across 3 SKU lines) plus his05-Sep-2026TrueLoyal Opening Balance (+123pts) are 100% reflected in hisAvailable Points = 3,405Pts (Standard Points (PS) = 3,405,Pending Points = 0). - Documented why a live "Finish Sale" on Pronto does not immediately appear in Odoo (Pronto POS and Odoo have no real-time live API webhook; POS transactions are batch-imported via daily
ZN_DAILY_TRANSACTIONSCSV extracts underSTG-TICK-039, currently loaded up to22-Oct-2026), and why the 11 historicalLAE2/LAE1Pronto orders (08-Junto23-Sep-2026) do not appear as individualpos.orderrecords (historicalJun–Sepdaily POS CSV gap documented indocs/audit/pos_data_audit_summary.md, where pre-Sep 5 points were captured via the05-Sep-2026TrueLoyal Opening Balance underSTG-TICK-030).
- Verified that Henry Mawe's 2 Odoo POS Orders (
- Identified and remediated a side-effect from
STG-TICK-051where raw SQL re-linking of9,637loyalty ledger rows from the2,187Oct 30 replaced-card stubs onto their active replacement profiles bypassed Odoo's ORM@api.dependsrecomputation onres.partner, leaving 2,070 active replacement members (+190,178Available Points) with unsynced storedloyalty_points_available,standard_points_earned,bonus_points_earned,lifetime_points_earned, andkpi_total_orderscolumns. - Hardened
ResPartner._compute_loyalty_points()to explicitly honoris_card_blocked(available = 0when blocked) and implementedStockLocation.sync_partner_loyalty_points_from_ledger()(invoked automatically duringStockLocation.init()andreconcile_oct30_pos_import_stubs()) to synchronize all storedres_partnerloyalty point columns andloyalty_card.pointswithreal_rewards_loyalty_ledger. - When: 2026-11-04.
- Where:
odoo/addons/cpl_real_rewards_ui/models/res_partner.pyandodoo/addons/cpl_real_rewards_ui/models/stock_location.py. - Why:
- Direct SQL
UPDATE real_rewards_loyalty_ledger SET partner_id = s.real_partner_idinSTG-TICK-051updatedreal_rewards_loyalty_ledgerandloyalty_card, but did not triggerres.partner._compute_loyalty_points(), causing2,070replaced-card members to have merged Oct 30 POS orders in their ledger that were not yet added to their storedres_partner.loyalty_points_availablecolumn. - Store Makers and Checkers needed clear operational guidance that Pronto "Finish Sale" transactions only appear in Odoo after the daily POS CSV batch import (
STG-TICK-039), and that historicalOrderssmart-button records are already included inAvailable Points(Pending Points = 0). - How:
- Updated
ResPartner._compute_loyalty_points()inres_partner.pyto include'is_card_blocked'in@api.dependsand setavailable = 0whenpartner.is_card_blockedisTrue. - Added
StockLocation.sync_partner_loyalty_points_from_ledger()instock_location.pyusing a high-speed set-based SQL CTE to reconcile any out-of-sync stored loyalty columns (loyalty_points_available,standard_points_earned,bonus_points_earned,lifetime_points_earned,total_points_redeemed,expired_points,kpi_total_orders) andloyalty_card.pointsagainstreal_rewards_loyalty_ledger. - Verified end-to-end on Staging and Production via Playwright (
scratch/uat_playwright_052_staging.pyandscratch/uat_playwright_052_prod.py, Exit Code 0).
STG-TICK-053 / KB-053: Marketing & Executive Reports Hub (Second Dashboard) — Member/Points Visual Charts & K10 Card Revenue (Items 1a, 1b, 2)¶
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Manager Real Rewards Plus | Marketing,
mfrank@cpl.com.pg), Amy Oata (Marketing Officer), Waneen Mairi (Head Office Checker), and CPL Executive Leadership. - What:
- Built the Marketing & Executive Reports Hub (
real.rewards.marketing.reports.hub) under Reporting -> Marketing & Executive Reports Hub (plus a shortcut button on the main Executive Dashboard) with global interactive filters for Date Range Preset (All Time,Month-to-Date (MTD),Year-to-Date (YTD),Custom Date Range), Brand Filter (All Brands,CP,HHL,DFS), and Shop Location (all 40 active retail stores). - Implemented Tab 1 (
1. Member & Points Charts — Items 1a & 1b):- Item 1a (Member Count Breakdown): Interactive Donut Chart, Top Stores Horizontal Bar Chart, and full 40-store breakdown table covering Active, In-Active, Transacting, Non-Transacting, Churned, Replaced Cards Log, Merged Accounts Log, and New Members.
- Item 1b (Points & Brand Breakdown): Interactive Donut Chart and store/brand table covering Total Points Awarded, Standard Points (
PS), Bonus Points (PB), Points Deducted, Points Redeemed (RD), Expired Points, and Net Balance split across CP, HHL, and DFS.
- Implemented Tab 2 (
2. Card Revenue – K10 — Item 2): CalculatesK10.00per RRP card across New Member Registrations (K1,375,640.00) and Card Replacements (K155,880.00across15,588replacements) for a total card revenue ofK1,531,520.00broken down by Shop Location and Brand. - Added multi-format 1-click export controller (
/real_rewards/reporting/hub_export) supporting CSV (.csv), Excel (.xlsx), and CPL-Branded Official PDF (.pdf). - When: 2026-11-04.
- Where:
odoo/addons/cpl_real_rewards_ui(models/marketing_reports_hub.py,views/marketing_reports_hub_views.xml,controllers/main.py,views/menu_views.xml,views/dashboard_views.xml). - Why: Provide Marketing and Executive stakeholders with a dedicated visual analytics and multi-format download hub without cluttering the primary operational KPI cards.
- How: Created
RealRewardsMarketingReportsHubtransient model with pure-CSSconic-gradientdonut charts (sanitize=False), horizontal bar charts, SQL analytical aggregations, andreportlab/xlsxwriter/CSV export endpoints. Verified via Playwright UAT (scratch/playwright_uat_053_054_055.py, Exit Code 0).
STG-TICK-054 / KB-054: Marketing Reports Hub — Loyalty Ledger by SKU, Redemptions Top 5, Catalogue Drill-Down, Quarantine & Promotions (Items 3a–c, 4, 5, 6, 9)¶
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Manager Real Rewards Plus | Marketing), Amy Oata, Store Branch Managers, and Head Office Checkers.
- What:
- Implemented Tab 3 (
3. Loyalty Ledger by SKU — Items 3a, 3b, 3c): Total ledger transactions (347,766lines) grouped by Item SKU & Product Description showing Standard Points (PS), Bonus Points (PB), Redeemed Points (RD), and Non-Point Incurring Excluded Items. - Implemented Tab 4 (
4 & 6. Redemptions & Catalogue — Items 4a–c, 6a–b): Top 5 Redemptions by Item & Shop Location (4a), Store Redemptions & Unique Member Counts across all 40 stores (4b/4c), and Rewards Catalogue Master Items List with expandable Store Redemption Breakdown (6a/6b). - Implemented Tab 5 (
5 & 9. Quarantine & Promotions — Items 5a–d, 9a–c): Quarantined Cards Queue full list (5a/5b) and deduplicated Card Number & Shop summary (5c/5d), Double/Triple Bonus Points (PB) Participating Members (9a), Christmas Catalogue Promotion Items (9b, using newproduct.template.is_christmas_promo_itemflag), and Non-Participating Members (9c). - When: 2026-11-04.
- Where:
odoo/addons/cpl_real_rewards_ui(models/marketing_reports_hub.py,models/product_template.py,views/product_views.xml,controllers/main.py). - Why: Consolidate SKU-level loyalty ledger metrics, redemption leaderboards, reward catalogue tier drill-downs, quarantine queue analytics, and seasonal promotions into a single filterable dashboard with CSV/Excel/PDF exports.
- How: Added parameterized SQL analytical queries for sub-reports
3_ledger_sku,4a_top5_redemptions,4b_store_redemptions,5a_quarantine_full,5c_quarantine_by_card,6_catalogue,9a_promo_participants,9b_christmas_promo, and9c_promo_non_participants. Verified via Playwright UAT (scratch/playwright_uat_053_054_055.py, Exit Code 0).
STG-TICK-055 / KB-055: Marketing Reports Hub — Member Directory Export, Tag Segmentation by Store & 1-Click Individual Member Account Download (Items 3d, 7, 8a, 8b)¶
5W1H Framework Analysis¶
- Who: Margaret Valo Frank (Manager Real Rewards Plus | Marketing), Amy Oata, Store Makers, and Head Office Checkers.
- What:
- Implemented Tab 6 (
7 & 8. Tags & Member Directory — Items 7, 7a, 7b, 8a):- Item 7: Member Count by Shop Location split across all 5 official tags (
CPL STAFF,HHL STAFF,2025 MOTHERS DAY WINNERS,2026 MOTHERS DAY WINNERS,UNCLAIMED RECORD), Total Tagged (7a), and Untagged Members (7b). - Item 8a: Full Member Directory preview and bulk export (Card #, Name, DOB, Shop Location, Brand, Email, Phone, Earned PS/PB, Redeemed RD, Expired, Available Points, and Tags).
- Item 7: Member Count by Shop Location split across all 5 official tags (
- Implemented 1-Click Individual Member Account & Transactions Statement Download (
Items 3d & 8b):- Added
Download Statement (PDF),Download Statement (Excel), andDownload Statement (CSV)header buttons directly on the Member Profile form (res.partner,view_partner_form_inherit_real_rewards) as well as an Individual Member selector on the Marketing Reports Hub, powered by/real_rewards/reporting/member_statement.
- Added
- When: 2026-11-04.
- Where:
odoo/addons/cpl_real_rewards_ui(models/res_partner.py,views/partner_views.xml,models/marketing_reports_hub.py,controllers/main.py,views/staging_helpdesk_views.xml). - Why: Enable 1-click self-service downloads of any individual member's full profile and transaction ledger in PDF, Excel, or CSV alongside bulk tag segmentation and member directory exports.
- How: Added
action_download_member_statement_pdf/xlsx/csvonres.partner, wired/real_rewards/reporting/member_statement, and formattedreal.rewards.staging.tickettext fields (white-space: pre-line) for crisp multi-line readability. Verified via Playwright UAT (scratch/playwright_uat_053_054_055.py, Exit Code 0).