Skip to content

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 ' and Hardware Haus to 'HHL ', merged co-located hubs, and unified Support Office. 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

  1. Log in to Staging Odoo: https://angry-mad-smile.cpl.com.pg (Credentials: admin / <REDACTED_PASSWORD> - contact System Administrator).
  2. Open the main application switcher (top-left menu icon) and select CPL Real Rewards.
  3. Locate the top navigation tab: Staging Helpdesk & Change Audit.
  4. Under this menu, you can select:
  5. Staging Change Tickets: View interactive Kanban board and list view of all tickets (STG-TICK-001 through STG-TICK-018+).
  6. Knowledge Base (KB) Articles: View Knowledge Base articles (KB-001 through KB-018+) containing root cause analysis, resolution steps, and CLI verification commands.
  7. Direct View Links:
  8. Open Staging Tickets Kanban Board
  9. 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 DictReader to mismatch column names.
  • Root Cause: Zinrelo legacy export prepends metadata comments before column headers.

Step-by-Step Guide

  1. Open CSV file in Python with utf-8 encoding.
  2. Call next(f) twice before initializing csv.DictReader(f).
  3. Use in-memory seen_member_ids = set() to skip duplicate member cards.
  4. Execute SET session_replication_role = 'replica'; during bulk INSERT to bypass foreign key trigger overhead.

Verification Command

docker exec odoo_staging_web python3 -u /mnt/scripts/reimport_golden_records.py

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

  1. Load Cards in Pronto replacement.csv mapping Card Number to Zinrelo Member ID.
  2. Match Zinrelo Member ID to res_partner.rrp_card_number.
  3. Insert old card numbers into real.rewards.card.replacement.log with replacement_reason='other'.
  4. Expose log view under CPL Real Rewards -> Configuration -> Card Replacements Log.

Verification Command

docker exec odoo_staging_web python3 -u /mnt/scripts/fast_import_pronto_cards.py

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

  1. Override write() method in real_rewards_loyalty_ledger.py to raise UserError(_('Loyalty Ledger records are read-only and immutable.')).
  2. Override unlink() method to block deletion.
  3. Set create="false" edit="false" delete="false" in XML view loyalty_ledger_views.xml.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M03-01)

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 ilike searches for exact contiguous substring 'Valo Margaret'.

Step-by-Step Guide

  1. Override _name_search in res_partner.py.
  2. Split search string into token list: words = name.split().
  3. Construct dynamic domain matching each token against name, email, ref, phone, and card number.
  4. 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

  1. Flag incomplete profiles with is_unclaimed_record = True.
  2. Expose read-only view under Unclaimed Accounts Queue.
  3. Require Maker-Checker approval before re-assigning quarantined points to verified customer profiles.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M05-01)

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

  1. Maker submits change request in Member Add/Change Requests view.
  2. Request status defaults to draft or submitted.
  3. Checker opens request, verifies supporting documentation, and clicks Approve & Apply.
  4. System writes changes to res_partner and logs audit record.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M06-01)

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

  1. Navigate to CPL Real Rewards -> Dashboard.
  2. Review KPI metrics: Active Members (136,702), Baseline Points (433.4M), Card Replacements (15,323).
  3. Click metric tiles to drill down into filtered recordsets.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M07-01)

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

  1. Open Reporting -> Daily Points Accounting.
  2. Inspect daily store rollups, earned points, redeemed points, and closing liability balance.
  3. Export accounting ledger to CSV/Excel for external financial audit.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M08-01)

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

  1. Navigate to Configuration -> User Role Management.
  2. Select user profile and toggle Active switch to OFF (active = False).
  3. Assign RBAC groups: Maker, Checker, or Admin.
  4. Test login authentication to confirm session is blocked.

Verification Command

python3 scratch/run_comprehensive_10_module_uat.py (UAT-M09-01)

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

  1. Edit markdown files in /home/lucius_fox/ODOO/docs/.
  2. Ensure Document Control Log table includes Publisher: Flavius Narokobi.
  3. Run mkdocs build -d /var/www/html/ to update static site on https://docs.cpl.com.pg/.

Verification Command

curl -k -I https://docs.cpl.com.pg/

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 Central ID 22; SNS North Waigani -> CP North Waigani ID 21; SNS Boroko -> CP Boroko ID 142).
  • Standardized Support Office / Training locations as CP Support Office (ID 31) and registered DGW as the central CPL Warehouse.
  • Backfilled and refreshed shop_id relational 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, and res_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 marked ZINRELO_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 relational stock.location linkage 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_location records with unified CP <Store> and HHL <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_name strings across 310,692 ledger entries and updated member registered_store_id.
  • Added relational shop_id field on real.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

  1. Log in to Staging Odoo: https://angry-mad-smile.cpl.com.pg.
  2. Open CPL Real Rewards -> Real Rewards Members.
  3. Select any customer (e.g. Tabita Naman, #id=758149) and click the Loyalty Ledger tab.
  4. Verify the Shop Location column indicates the physical store branch (e.g. CP Waigani Central for POS purchases) or True Loyal->Odoo for manual opening balance adjustments.
  5. Open CPL Real Rewards -> Loyalty Ledgers & POS Transactions to filter or group all 310k+ transactions by Shop Location.

Verification Command

python3 scratch/base_check.py

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 render primary_store_name with 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 (Many2one to stock.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 channel True Loyal->Odoo, selects the store with the highest frequency, and falls back to registered_store_id, then central flagship retail hub CP 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 table res_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_id and primary_store_name fields with @api.depends('registered_store_id', 'ledger_ids.shop_id') on res.partner.
  • Excluded non-retail migration placeholder True Loyal->Odoo from store frequency aggregation.
  • Modified partner_views.xml to display primary_store_name on form header and kanban cards.
  • Executed fast SQL backfill across 138,459 members and indexed primary_store_id.
  • Upgraded cpl_real_rewards_ui on staging via XML-RPC.
  • Verified via automated Playwright test suite capturing visual evidence (base_check_member_header_store_badge_evidence.png and base_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_id to Member Metadata & Matrix group.
  • Backfill Breakdown Across 138,459 Members:
  • CP Waigani Central: 120,443 members
  • CP Boroko: 2,258 members
  • CP Town: 1,758 members
  • CP Showroom: 1,651 members
  • CP Mount Hagen: 1,369 members
  • CP 8 Mile: 1,241 members
  • CP Lae: 1,233 members
  • CP Badili: 1,112 members
  • CP Gerehu: 950 members
  • CP Vision City: 792 members
  • Remaining retail branches: 5,652 members
  • Zero members assigned True Loyal->Odoo or 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

python3 scratch/base_check.py

[STG-TICK-019] Live Production Cutover: Mathematical Parity & State Sync

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

  1. Created pre-flight PostgreSQL snapshot (104.2 MB).
  2. Standardized 42 retail locations under CP <Store> and HHL <Store>.
  3. Promoted 138,459 members, 258,021 ledgers, and 15,553 card replacements.
  4. Upgraded cpl_real_rewards_ui and verified production with Playwright.

[STG-TICK-020] Quarantined Cards Queue Architecture & Maker-Checker Governance

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

  1. Implemented Quarantined Cards Queue view with Push to Member (Claim) wizard.
  2. Isolated 5 blocked cards with 0 Points Available till lock.
  3. Added dedicated navigation links under Members and Governance.

[STG-TICK-021] Pronto Replacement Cards Lineage & RFC-4122 v4 UUID Architecture

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

  1. Backfilled 100% of 138,459 members with RFC-4122 v4 UUIDs (gen_random_uuid()).
  2. Added auto-generation hooks in res_partner.py for all new rewards registrations.
  3. Published Active Cards Master Download package with member UUIDs.

[STG-TICK-022] Reporting: Instant Headerless Active Cards CSV Feed for Pronto ERP/POS

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

  1. Implemented streaming HTTP controller /real_rewards/reporting/download_pronto_active_cards leveraging PostgreSQL copy_expert for sub-second streaming.
  2. Added Pronto Active Cards (CSV) menuitem under the Reporting dropdown in top navigation.
  3. Added active_cards mode to pronto.export.wizard for configuration export.
  4. Generates headerless CSV with 138,454 active unblocked cards line-by-line.
  5. 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

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

  1. Configured pure Maker persona aoata@cpl.com.pg (UID 59) strictly assigned to group_loyalty_maker and excluded from group_loyalty_checker and administrator groups.
  2. Configured independent Checker persona fnarokobi@cpl.com.pg (UID 57) in group_loyalty_checker.
  3. Injected Python ORM security guard in action_approve of real.rewards.profile.change.request:
    if req.requested_by and req.requested_by.id == self.env.user.id and not self.env.is_superuser():
        raise UserError(_("Segregation of Duties Violation: You cannot approve your own change request (%s). An independent Checker must review and authorize it.") % req.name)
    
  4. Added UI XML view constraint groups="real_rewards_loyalty.group_loyalty_checker" to suppress the Approve button in the Maker interface.
  5. 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

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

  1. 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.
  2. Request transitions to pending state and enters the Checker Review Queue.
  3. Independent Checker inspects the claim, reviews receipt notes, and clicks Approve.
  4. 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

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

  1. Maker initiates a Card Swap Request (request_type='replace') specifying the new barcode and replacement justification.
  2. Checker reviews the request in the dual-control queue and clicks Approve.
  3. System updates res_partner.rrp_card_number to the new barcode.
  4. An immutable audit record is committed to real.rewards.card.replacement.log preserving the old card barcode, replacement timestamp, operator UID, and reason.
  5. Synchronized PostgreSQL sequence real_rewards_card_replacement_log_id_seq to ensure zero primary key collisions across 15,554+ entries.
  6. The customer's member_uuid remains 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

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

  1. Checker triggers action_block_card on the customer profile:
  2. Profile is_card_blocked flag is set to True.
  3. UI renders a prominent red Card Blocked ribbon in form views.
  4. Available loyalty points are immediately zeroed at the till and transferred into a quarantined holding hold (order_type='blocked_card_hold').
  5. Audit trail message posted to partner chatter with operator ID and reason.
  6. Once identity verification is completed, Checker triggers action_unblock_card:
  7. is_card_blocked is reset to False, red ribbon is removed.
  8. Chatter records unblocking timestamp, checker ID, and photo ID verification reason.
  9. Ensured action_block_card and action_unblock_card execute with .sudo() for immutable ledger isolation and return explicit True booleans 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

Problem Statement & Root Cause Analysis

  1. 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 repeated Access Denied by ACLs for operation: read, uid: 70, model: pos.order errors in Production.
  2. OWL JavaScript Crash: In Odoo 17, pos_order_count on res.partner had field security restricted to point_of_sale.group_pos_user. When non-POS store users loaded partner forms, Odoo stripped pos_order_count from the payload, causing the client OWL engine to crash with Name 'pos_order_count' is not defined.
  3. Missing Sudoku Execution in Computes: Member KPI computations (_compute_member_total_orders, _compute_member_kpis, _compute_behavioural_segment) queried pos.order in caller context rather than elevated context.
  4. Lack of Automated Exception Alerting: Administrative team lacked proactive visibility into runtime exceptions encountered by branch staff.

Step-by-Step Resolution

  1. Extended Model ACLs (ir.model.access.csv):
  2. Added perm_read=1, perm_write=0, perm_create=0, perm_unlink=0 on pos.order and pos.order.line for group_loyalty_maker, group_loyalty_checker, and group_real_rewards_reader.
  3. ResPartner Field & Compute Hardening (res_partner.py):
  4. Redefined pos_order_count with expanded groups: point_of_sale.group_pos_user,real_rewards_loyalty.group_loyalty_maker,real_rewards_loyalty.group_loyalty_checker.
  5. Overrode _compute_pos_order() to execute in elevated pos.order.sudo() context.
  6. Wrapped pos.order.sudo() in all member KPI computes.
  7. Stat Button Visibility (partner_views.xml):
  8. Updated action_view_pos_order smart button groups to include Loyalty Makers and Checkers so store staff can review past receipts and points transactions.
  9. Declared hidden pos_order_count in form view to ensure safe OWL evaluation.
  10. Real-Time Automated Exception Interceptor (ir_http.py):
  11. Overrode IrHttp._handle_error to intercept all AccessErrors and Real Rewards model exceptions.
  12. Built a 15-minute in-memory rate-limiting signature cache to prevent email storms.
  13. Dispatches rich HTML alerts with user details, URL, model, IP address, and formatted traceback directly to fnarokobi@cpl.com.pg via no-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

Problem Statement & Root Cause Analysis

  1. Column Polarity Inversion: An exhaustive audit of Cards in Pronto replacement.csv revealed 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 to old_card_number, while Zinrelo Member ID (the retired original card) was mapped to new_card_number.
  2. Active Card Desynchronization: Because new_card_number contained 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.
  3. 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

  1. Chronological Sequencing:
  2. Parsed all 15,637 active replacement rows from /tmp/Cards_in_Pronto_replacement.csv.
  3. Grouped multiple card replacements per member and sorted them chronologically by activation timestamp.
  4. Identified the latest replacement card as the member's true active card.
  5. Stub Partner Consolidation:
  6. Identified 271 stub partner profiles holding replacement barcodes.
  7. Re-linked all POS orders, loyalty ledger entries, and audit logs to the primary master partner profile.
  8. Deactivated stub records and cleared their barcode values to eliminate unique constraint collisions.
  9. Active Card Promotion:
  10. Promoted all 14,541 verified members' res_partner.rrp_card_number to their latest replacement card.
  11. Verified active cards: Francis Marai $\rightarrow$ CPLR000605466, Bellindah Daniel $\rightarrow$ CPLR000108017, Joe Koma $\rightarrow$ CPLR000695213, Neba Kewa $\rightarrow$ CPLR000721151.
  12. Audit Trail Rebuild:
  13. Rebuilt real_rewards_card_replacement_log with correct polarity: old_card_number = Original Card $\rightarrow$ new_card_number = Replacement Card.
  14. Inserted 15,572 clean audit logs with activation notes and timestamps.
  15. Playwright UAT Verification:
  16. Verified Maker profile loads with promoted replacement badges and 0 errors.
  17. Verified Checker replacement logs list view renders correct Old -> New order.

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 articles KB-022, KB-026, or KB-027 whose category selection 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) on real.rewards.staging.ticket and real.rewards.staging.kb for 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) and cpl_real_rewards (@ 172.19.0.2:5432).
  • WHY: In Odoo 17 OWL, SelectionField executes field.selection.find(item => item[0] === val)[1]. When val is missing from fields.Selection, find(...) returns undefined, 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 category in real.rewards.staging.ticket and real.rewards.staging.kb to include reporting, governance, and security_access.
  • Updated ir.model.access.csv giving 1,0,0,0 to group_real_rewards_admin and group_loyalty_checker, reserving 1,1,1,1 for base.group_system.
  • Updated menu_views.xml adding real_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).
  • Ingested three-line historical ledger structure (earn, redeem, expire) replacing the placeholder single adjust opening balance.
  • Backdated 140,801 retail POS transactions to their physical pos_order.date_order (July–August 2026) and updated _compute_loyalty_points() in res_partner.py to evaluate (line.transaction_date or line.create_date).
  • Cleared 45-day-old purchases from pending_points into loyalty_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) and cpl_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.gz from master True Loyal export.
  • Backdated POS transactions to date_order.
  • Ingested earn (Col I), redeem (Col J), and expire (Expired delta) lines.
  • Recalculated res_partner balances 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 via groups="real_rewards_loyalty.group_loyalty_checker,cpl_real_rewards_ui.group_real_rewards_admin".
    • Model security on loyalty.points.adjustment revoked in ir.model.access.csv for group_loyalty_maker (0,0,0,0).
    • Dynamic selection override in real.rewards.profile.change.request via fields_get so store makers cannot see or pick Manual Points Adjustment.
  • Implemented strict Python ORM security barriers (create, write, _onchange_request_type_rbac) raising UserError if 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.xml adding Checker and Admin groups to the POS menu.
  • Updated ir.model.access.csv resetting Maker CRUD permissions to 0,0,0,0.
  • Added fields_get filter in ProfileChangeRequest to restrict dropdown choices.
  • Added ORM validations in create and write.
  • 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 via groups="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 via groups="cpl_real_rewards_ui.group_real_rewards_admin,real_rewards_loyalty.group_loyalty_checker".
    • Dynamic selection override in real.rewards.profile.change.request via fields_get removing claim_unclaimed ("Claim Unclaimed / Orphaned Account") for store makers.
  • Implemented strict Python ORM security barriers (create, write, _onchange_request_type_rbac) raising UserError if 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_type choices in ProfileChangeRequest via fields_get.
  • Enforced ORM-level authorization guards on create and write.
  • 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 ErrorInvalidRecipients in real_rewards_api_mailer:
    • Refactored IrMailServer.send_email using Python's email.utils.getaddresses to 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 toRecipients and ccRecipients objects to ensure compatibility with Microsoft Entra ID and Exchange Online address resolution.
  • Implemented automated In-Odoo Activity Scheduling (mail.activity):
    • Enhanced action_submit() on real.rewards.profile.change.request and loyalty.points.adjustment to automatically schedule a mail.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_subscribe to prevent duplicate follower SQL constraint violations.
  • Implemented automated Activity Completion (activity_feedback):
    • Added activity_feedback handlers in action_approve(), action_reject() (Points Adjustments), and RejectionWizard.action_confirm_reject() (Profile Change Requests) to automatically complete and clear the activity from the Checker's systray upon review.
  • Configured Margaret Frank user profile:
    • Set notification_type = 'inbox' on res_users to 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.
  • 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) and cpl_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.py with getaddresses parsing and structured recipient objects.
  • Added activity_schedule calls in action_submit() for both approval models.
  • Added activity_feedback calls in action_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.ticket with category system_incident and technical diagnostics:
    • error_fingerprint: SHA256 cryptographic signature computed from title, model, and error message prefix.
    • error_traceback: Complete Python stack trace captured at exception time.
    • affected_user_id: Foreign key to res.users recording 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 draft stage and posts an HTML technical incident badge card into chatter.
  • 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 with dispatch_email=False to prevent infinite mail loops.
  • 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) and cpl_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_ui on 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, Card CPLR000721571, Partner ID 775665).
  • WHAT:
  • Resolved customer profile photo mismatch on newly enrolled member Camille JB Bendoy:
    • Investigated Service Request PCR/2026/0032 (Database ID 17), 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) into res.partner ID 775665 on Production, regenerating high-definition thumbnails (image_1024, image_512, image_256, image_128).
  • Identified Root Cause:
    • Record ID 17 was an old test record from August 27, 2026 that had an orphaned test image attachment (ID 1885 - spoon photo).
    • When Faustie uploaded Camille's photo, attachment ID 2155 was created, leaving multiple attachments associated with the same request.
    • In action_approve(), Odoo's ORM read req.customer_photo. Odoo's binary getter queried ir_attachment without an explicit order='id desc', returning the oldest attachment (1885 - spoon) instead of the latest (2155 - Camille).
  • Patched Codebase in real_rewards_profile_change_request.py:
    • Added _get_latest_customer_photo(self) querying ir_attachment with order='id desc', limit=1 to guarantee deterministic selection of the newest uploaded photo across new, change, and replace request types.
    • Overrode write() to automatically unlink existing customer_photo attachments when a new photo is uploaded, preventing orphaned attachments from accumulating.
    • Purged orphaned test attachment 1885 from the production database.
  • 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 (ID 775665)
  • Databases: cpl_real_rewards_staging (@ 172.18.0.2:5432) and cpl_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.py with _get_latest_customer_photo() and attachment purging on write().
  • 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.telemetry model 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.
  • Implemented real.rewards.metrics.dashboard computing 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.
  • 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.
  • 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) and cpl_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.csv and 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 ID 1507035863495359855) on odoo-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_cron 20: Real Rewards: 2-Year Point Expiration Sweep (real.rewards.loyalty.ledger.process_point_expirations()).
    • ir_cron 22: 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_date on real_rewards_loyalty_ledger(partner_id, create_date) and idx_ledger_create_trans on real_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 nextcall on both crons to tomorrow, terminated hung background transaction locks, restarted odoo_web container, 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, project odoo-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_activity and 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.py and res_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_notifications on res.users (Boolean, default True).
  • 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 = False for 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_staging on https://angry-mad-smile.cpl.com.pg) and Production (cpl_real_rewards on https://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.users with approval_email_notifications and updated allowed_fields in write().
  • 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, and approval_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) and Configuration > 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 Waigani on redemption order RED/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_range columns range_start and range_end from 32-bit INTEGER to 64-bit BIGINT on both Staging (cpl_real_rewards_staging) and Production (cpl_real_rewards).
  • Expanded active range_end bounds across all retail branches from 999,999,999 to 9,999,999,999.
  • Updated real_rewards_redemption_order.py default auto-provisioning fallback to range_end = 9999999999.
  • Verified that order RED/2026/0012 (CP Showroom, Pronto SO 337965539) was in a healthy pending_so state 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() on RED/2026/0016 (preserving 1065180689) and RED/2026/0012 (preserving 337965539).
  • 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:
    ALTER TABLE real_rewards_shop_so_range ALTER COLUMN range_start TYPE bigint;
    ALTER TABLE real_rewards_shop_so_range ALTER COLUMN range_end TYPE bigint;
    UPDATE real_rewards_shop_so_range SET range_end = 9999999999 WHERE range_end = 999999999;
    
  • Updated models/real_rewards_redemption_order.py auto-provisioning range to 9999999999.
  • 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/0016 and RED/2026/0012 with 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/0016 which 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_line and synchronized real_rewards_loyalty_ledger entry 498912 to reflect solely 1x WHITE GLO T/PASTE HERBAL 150G (850 pts), strictly preserving Pronto Sales Order 1065180689.
  • Implemented Admin "Cancel / Return & Refund" Workflow:
    • Extended action_cancel_refund() in models/real_rewards_redemption_order.py to allow Admins (group_real_rewards_admin) to cancel and refund both pending_so and redeemed orders.
    • Issues a compensatory loyalty ledger audit credit (transaction_type = 'earn') with action label RETURNED & REFUNDED and the manager's cancellation reason.
    • Renames pronto_sales_order_no to {SO}-REFUNDED to decouple the Pronto sequence while preserving the exact audit trail for store accountants.
    • Sets order status to cancelled and writes an audit note to the customer profile chatter.
  • Immediate Point Balance Restoration:
    • Updated res_partner._compute_loyalty_points() so that returns and refunds (REFUND / RETURN in reference source) bypass the standard 7-day earn clearance window, immediately restoring points to loyalty_points_available.
  • BigInt ORM Subclass Mapping:
    • Subclassed BigInt(fields.Integer) with column_type = ('int8', 'bigint') in models/real_rewards_shop_so_range.py.
    • Resolved NumericValueOutOfRange errors during Odoo module upgrade by preventing Odoo's ORM auto-init from attempting to downgrade 64-bit PostgreSQL columns to 32-bit int4.
  • Automated Incident Alert Staging Routing:
    • Updated models/staging_helpdesk.py so that automated error notification emails always route to Staging (https://angry-mad-smile.cpl.com.pg) rather than Production.
  • 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.
  • 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.
  • 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:
    class BigInt(fields.Integer):
        column_type = ('int8', 'bigint')
    
  • 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.py to exempt returns from clearance delay.
  • Updated views/redemption_order_views.xml to expose button in redeemed state with confirmation modal.
  • Updated models/staging_helpdesk.py to 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

  1. 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())
    
  2. 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

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_staging on angry-mad-smile.cpl.com.pg) and Production (cpl_real_rewards on rewards.cpl.com.pg).
  • Why: In the original workflow, a rejected record remained permanently locked in rejected status with readonly="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.wizard with button "Send Back for Correction (Draft)" (action_send_back) alongside "Reject Permanently" (action_confirm_reject).
  • Implemented action_send_back(reason) on real.rewards.profile.change.request:
    • Resets state to 'draft', instantly unfreezing all form inputs for the Maker.
    • Schedules an in-Odoo todo activity 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.
  • 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

  1. odoo/addons/cpl_real_rewards_ui/models/real_rewards_profile_change_request.py:
  2. Added action_send_back(reason) and action_reset_to_draft().
  3. Updated action_submit() to mark Maker todo activities as done upon resubmission.
  4. odoo/addons/cpl_real_rewards_ui/wizard/rejection_wizard.py & rejection_wizard_views.xml:
  5. Added action_send_back() button with warning styling.
  6. Added automated email alert dispatch to Maker upon rejection or send back.
  7. odoo/addons/cpl_real_rewards_ui/views/profile_change_request_views.xml:
  8. Added header button "Send Back for Correction" for state == 'rejected' restricted to Checkers and Admins with confirmation dialog.
  9. 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 became pending.
  • Phase 3: Checker Margaret reviewed and approved (stg_uat_resubmit_03_checker_approved.png). Customer profile created with phone 71234567.
  • 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 71234567 and 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

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 to v2.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_staging on angry-mad-smile.cpl.com.pg), Production (cpl_real_rewards on rewards.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 Team and Technical Maintenance to Systems Developer.
  • Reclassified developer access in cpl_staff_rbac_matrix.json from Checker to Developer / 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/staging and origin/main.

Technical Resolution Summary

  1. docs/governance/sop_pronto_pos_bulk_ingestion.md:
  2. Overhauled RACI matrix to use functional roles instead of individual names.
  3. Assigned exclusive loyalty point verification accountability to Real Rewards Checker.
  4. Systems Developer classified as Consulted/Informed with zero approval authority.
  5. docs/cpl_staff_rbac_matrix.json & odoo/addons/docs/cpl_staff_rbac_matrix.json:
  6. Updated developer profile from "Checker" to "Developer / Technical Admin".
  7. docs/manuals/ODOO_MAKER_MANUAL.md & docs/manuals/store_staff_guide.md:
  8. Added Store Supervisor responsibilities as frontline quality gate for verifying physical paperwork before checker submission.
  9. docs/manuals/ODOO_CHECKER_MANUAL.md & docs/manuals/ODOO_ADMIN_MANUAL.md:
  10. Clarified role boundaries between Head Office Checkers (approval of claims/changes/swaps) and Real Rewards Admins (redemption return/refund authorization).
  11. All 5 SOPs and 4 User Manuals updated to v2.9.0 with CPL Real Rewards Team publisher attribution.

Verification Evidence

  • Live Documentation Verification:
  • https://docs.cpl.com.pg/manuals/ODOO_MAKER_MANUAL/: HTTP 200
  • https://docs.cpl.com.pg/manuals/ODOO_CHECKER_MANUAL/: HTTP 200
  • https://docs.cpl.com.pg/manuals/store_staff_guide/: HTTP 200
  • https://docs.cpl.com.pg/manuals/ODOO_ADMIN_MANUAL/: HTTP 200
  • https://docs.cpl.com.pg/governance/sop_pronto_pos_bulk_ingestion/: HTTP 200
  • https://docs.cpl.com.pg/governance/sop_quarantine_queue/: HTTP 200
  • https://docs.cpl.com.pg/governance/sop_blocked_cards/: HTTP 200
  • https://docs.cpl.com.pg/governance/sop_card_replacements/: HTTP 200
  • https://docs.cpl.com.pg/governance/sop_store_redemptions/: HTTP 200
  • Staging & Production Database Verification:
  • STG-TICK-044 registered with status closed on Staging (172.18.0.2) and Production (172.19.0.2).
  • KB-044 linked 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.merge model. Hooked it into loyalty.card and real.rewards.loyalty.ledger for correct point adjustments. Added action_request_approval in staging_helpdesk.py to dispatch HTML emails.

Technical Resolution Summary

  1. real_rewards_loyalty: Added points_merge.py and points_merge_views.xml.
  2. cpl_real_rewards_ui: Added action_request_approval and 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 (PS Standard Points, PB Bonus / Double Points, RD Voucher Redemptions, RF Returns) to real.rewards.loyalty.ledger (pronto_code badge + filter tabs).
  • Added stored computed columns on res.partner and 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), and Available Points.
  • Extended zinrelo.importer.wizard to natively parse Pronto RR Report .xlsx and .csv files (Whse Code, Card No, Trans Date, Cashier, Stock Code, Item Description, Points, Shipped Qty, Type), preserve line-level PS and PB rows on the same docket without false deduplication, and support incremental PB backfill onto existing PS orders.
  • Stamped real.rewards.loyalty.ledger.transaction_date with the actual POS docket date (Trans Date / order_timestamp) and set real_rewards.pending_clearance_days = 0 so all imported POS points immediately credit Available Points (pending_points = 0).
  • Ingested all 3,420 PB Double Points rows from Margaret's Pronto RR Report (Double Points Update - 05102026 to 29102026 .xlsx), crediting 3,331 active member ledger lines (including +39 PB points on POS/337925902 for CPLR000698802 Amy Quinnella Oata on 2x SKU 1013766 DOLL W/ GLASSES CP0526-203, bringing her item 1013766 total to 39 PS + 39 PB = 78 Double Points and her Available Points to 511 with 0 Pending 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) and odoo/addons/real_rewards_importer (importer_wizard.py, importer_wizard_view.xml).
  • Why:
  • Athan's ZN_DAILY_TRANSACTIONS CSV upload only exported PS standard lines and omitted Pronto's 3,420 PB promotional double-points lines.
  • Previously, importer_wizard.py did not pass transaction_date = dt when creating ledger rows, causing newly uploaded Oct 13–25 POS points to be held inside the 7-day pending_points bucket instead of loyalty_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, and bonus_points_earned fields and updated XML tree/form/search views.
  • Added .xlsx workbook conversion (_xlsx_bytes_to_csv_bytes) and line-level PS/PB/RD/RF handling to zinrelo.importer.wizard.
  • Backfilled transaction_date from pos_order.date_order, ingested the 3,420 PB rows from Margaret's Oct 5–29 Pronto RR Report, and recomputed PS, PB, RD, Pending = 0, and Available Points across 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-vm against 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 inside odoo_staging_web and odoo_web without 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/libcrypto3 3.5.9, curl 8.23.0, libexpat 2.9.0, ca-certificates) inside odoo_nginx.
  • Removed the unused odoo:16.0 image from the Docker host and disabled the unneeded Odoo.com Accounts OAuth 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, and docs/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.com OAuth provider and stale odoo:16.0 image) while guaranteeing zero breakage of Odoo 17's Python dependencies.
  • How:
  • Executed apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --only-upgrade inside odoo_staging_web and disabled Odoo.com Accounts OAuth provider on Staging.
  • Verified Staging with Playwright UAT (scratch/uat_playwright_049_staging.py, Exit Code 0) and continuous monitoring via the sre-breakage-monitor subagent.
  • Promoted the identical OS security upgrades to odoo_web and odoo_nginx, removed odoo: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

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 : ... and CP Stop n Shop : ..., store codes 7MIL to MANU) 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: True in XML views, 1,0,0,0 ACL for base.group_user, and ORM create/write/unlink guard in ResPartnerCategory).
  • 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_id filtered by store_code != False OR name ilike 'HHL', and StockLocation.sync_cp_retail_stores_and_locations() had not yet been triggered automatically on module upgrade (init()), leaving store_code null on Production CP stores.
  • category_id and proposed_tag_ids allowed inline tag creation (no_create: False) and base.group_user had perm_create=1 on res.partner.category.
  • How:
  • Added init() on StockLocation to run sync_cp_retail_stores_and_locations() automatically on every module upgrade and updated location_id domain on real.rewards.redemption.order.
  • Disabled inline tag creation in partner_views.xml and profile_change_request_views.xml, restricted access_res_partner_category_user to read-only (1,0,0,0), granted Checkers full tag CRUD (1,1,1,1), and added ResPartnerCategory._check_tag_mutation_permission().
  • Verified end-to-end on Staging and Production via Playwright (scratch/uat_playwright_050_staging.py and scratch/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 between 04:10:46 and 04:23:18 UTC on 2026-10-30 during the 13-file POS Daily Transactions import (20261013–20261025) prior to the STG-TICK-045 / STG-TICK-047 Quarantine 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,772 points) 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,289 uncaptured points) into the Quarantined Cards Queue (real.rewards.quarantine.queue) (state='quarantined', card_status_type='unknown_card') and deleted the 381 blank stub records.
  • Hardened ProntoExportWizard.action_generate_csv() (export_type == 'new_members') in pronto_export_wizard.py so pronto_new_member_registrations strictly exports only active, unblocked members with genuine profile names (excluding 'Unclaimed Account%', card-number-only stub names, and 'UNCLAIMED RECORD' tagged records), reducing the 27 Oct – 31 Oct export from 2,601 rows to the exact 33 genuine new member registrations.
  • When: 2026-11-02.
  • Where: odoo/addons/cpl_real_rewards_ui/wizard/pronto_export_wizard.py and odoo/addons/cpl_real_rewards_ui/models/stock_location.py.
  • Why:
  • The Oct 30 04:10 UTC POS bulk import ran before STG-TICK-045 / STG-TICK-047 disabled auto-stub creation and added real.rewards.card.replacement.log resolution, creating 2,568 blank stub partner rows with create_date = 2026-10-30.
  • Searching those 2,187 old 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.py previously queried ('is_real_reward_customer', '=', True) within the create_date range without filtering out blank/unclaimed stub accounts.
  • How:
  • Implemented StockLocation.reconcile_oct30_pos_import_stubs() (invoked automatically from StockLocation.init()) to merge replaced-card stubs into their active replacement profiles, migrate unknown-card stub orders to real.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 all 2,568 blank 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.py and scratch/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/135522361 on 04-Aug-2026 at ERIK for K3,267.00 = +3,267 pts across 7 SKU lines, and POS/245675978 on 30-Jul-2026 at LAE1 for K16.40 = +15 pts across 3 SKU lines) plus his 05-Sep-2026 TrueLoyal Opening Balance (+123 pts) are 100% reflected in his Available Points = 3,405 Pts (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_TRANSACTIONS CSV extracts under STG-TICK-039, currently loaded up to 22-Oct-2026), and why the 11 historical LAE2/LAE1 Pronto orders (08-Jun to 23-Sep-2026) do not appear as individual pos.order records (historical Jun–Sep daily POS CSV gap documented in docs/audit/pos_data_audit_summary.md, where pre-Sep 5 points were captured via the 05-Sep-2026 TrueLoyal Opening Balance under STG-TICK-030).
  • Identified and remediated a side-effect from STG-TICK-051 where raw SQL re-linking of 9,637 loyalty ledger rows from the 2,187 Oct 30 replaced-card stubs onto their active replacement profiles bypassed Odoo's ORM @api.depends recomputation on res.partner, leaving 2,070 active replacement members (+190,178 Available Points) with unsynced stored loyalty_points_available, standard_points_earned, bonus_points_earned, lifetime_points_earned, and kpi_total_orders columns.
  • Hardened ResPartner._compute_loyalty_points() to explicitly honor is_card_blocked (available = 0 when blocked) and implemented StockLocation.sync_partner_loyalty_points_from_ledger() (invoked automatically during StockLocation.init() and reconcile_oct30_pos_import_stubs()) to synchronize all stored res_partner loyalty point columns and loyalty_card.points with real_rewards_loyalty_ledger.
  • When: 2026-11-04.
  • Where: odoo/addons/cpl_real_rewards_ui/models/res_partner.py and odoo/addons/cpl_real_rewards_ui/models/stock_location.py.
  • Why:
  • Direct SQL UPDATE real_rewards_loyalty_ledger SET partner_id = s.real_partner_id in STG-TICK-051 updated real_rewards_loyalty_ledger and loyalty_card, but did not trigger res.partner._compute_loyalty_points(), causing 2,070 replaced-card members to have merged Oct 30 POS orders in their ledger that were not yet added to their stored res_partner.loyalty_points_available column.
  • 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 historical Orders smart-button records are already included in Available Points (Pending Points = 0).
  • How:
  • Updated ResPartner._compute_loyalty_points() in res_partner.py to include 'is_card_blocked' in @api.depends and set available = 0 when partner.is_card_blocked is True.
  • Added StockLocation.sync_partner_loyalty_points_from_ledger() in stock_location.py using 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) and loyalty_card.points against real_rewards_loyalty_ledger.
  • Verified end-to-end on Staging and Production via Playwright (scratch/uat_playwright_052_staging.py and scratch/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): Calculates K10.00 per RRP card across New Member Registrations (K1,375,640.00) and Card Replacements (K155,880.00 across 15,588 replacements) for a total card revenue of K1,531,520.00 broken 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 RealRewardsMarketingReportsHub transient model with pure-CSS conic-gradient donut charts (sanitize=False), horizontal bar charts, SQL analytical aggregations, and reportlab/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,766 lines) 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 new product.template.is_christmas_promo_item flag), 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, and 9c_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).
  • Implemented 1-Click Individual Member Account & Transactions Statement Download (Items 3d & 8b):
    • Added Download Statement (PDF), Download Statement (Excel), and Download 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.
  • 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/csv on res.partner, wired /real_rewards/reporting/member_statement, and formatted real.rewards.staging.ticket text fields (white-space: pre-line) for crisp multi-line readability. Verified via Playwright UAT (scratch/playwright_uat_053_054_055.py, Exit Code 0).