From 2aa4bce08975cafdeb8b03239fd426c7c66d79c1 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Mon, 25 May 2026 16:51:25 -0400 Subject: [PATCH] feat(tablet): mail template + notification + cleanup cron (Task 5) Mail template renders the 4-digit code in both subject (mobile notification glance) and body (big bold display). Per Rule 25 only core res.users fields referenced; the code itself comes from ctx. fp.notification.template wrapper enables admin UI customization of the body without touching code. tablet_pin_reset_requested added to TRIGGER_EVENTS selection. Daily ir.cron purges used/expired rows > 7 days old (audit trail lives in fp.tablet.session.event, not here, so aggressive cleanup is safe). Manifest bump 19.0.34.2.0 -> 19.0.35.0.0 (triggers asset cache invalidation on -u so the new template + SCSS load cleanly). Phase 1 backend complete. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../models/fp_notification_template.py | 2 + .../fusion_plating_shopfloor/__manifest__.py | 3 +- .../data/fp_tablet_pin_reset_template.xml | 68 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 fusion_plating/fusion_plating_shopfloor/data/fp_tablet_pin_reset_template.xml diff --git a/fusion_plating/fusion_plating_notifications/models/fp_notification_template.py b/fusion_plating/fusion_plating_notifications/models/fp_notification_template.py index 5b847b84..3a782f19 100644 --- a/fusion_plating/fusion_plating_notifications/models/fp_notification_template.py +++ b/fusion_plating/fusion_plating_notifications/models/fp_notification_template.py @@ -28,6 +28,8 @@ TRIGGER_EVENTS = [ ('cert_awaiting_issuance', 'Cert Awaiting Issuance'), ('cert_voided_re_notify', 'Cert Voided — Please Re-Issue'), ('job_shipped', 'Job Shipped (manual mark)'), + # Spec 2026-05-25 — tablet PIN self-service reset + ('tablet_pin_reset_requested', 'Tablet PIN Reset Code Requested'), ] # Sub 6 — map each trigger event to a communication stream. Contacts on diff --git a/fusion_plating/fusion_plating_shopfloor/__manifest__.py b/fusion_plating/fusion_plating_shopfloor/__manifest__.py index b701503a..e0252d35 100644 --- a/fusion_plating/fusion_plating_shopfloor/__manifest__.py +++ b/fusion_plating/fusion_plating_shopfloor/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating — Shop Floor', - 'version': '19.0.34.2.0', + 'version': '19.0.35.0.0', 'category': 'Manufacturing/Plating', 'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer.', 'description': """ @@ -59,6 +59,7 @@ Copyright (c) 2026 Nexa Systems Inc. All rights reserved. ], 'demo': [ 'data/fp_demo_shopfloor_data.xml', + 'data/fp_tablet_pin_reset_template.xml', ], 'assets': { 'web.assets_backend': [ diff --git a/fusion_plating/fusion_plating_shopfloor/data/fp_tablet_pin_reset_template.xml b/fusion_plating/fusion_plating_shopfloor/data/fp_tablet_pin_reset_template.xml new file mode 100644 index 00000000..b3efd578 --- /dev/null +++ b/fusion_plating/fusion_plating_shopfloor/data/fp_tablet_pin_reset_template.xml @@ -0,0 +1,68 @@ + + + + + + + FP: Tablet PIN Reset Code + + 🔒 Your ENTECH tablet temporary PIN: {{ ctx.get('code', '----') }} + {{ (object.company_id.email or user.email) }} + {{ object.email or object.login }} + + +
+
+
+ Electroless Nickel Technologies Inc. (ENTECH) +
+

Your tablet temporary PIN

+

+ Hi , use this 4-digit PIN to unlock the + shop-floor tablet and set a new permanent PIN. +

+
+ +
+

+ This code expires in 72 hours. If you didn't request it, ignore + this email — no action needed. The previous PIN (if any) stays + valid until you successfully complete the reset on the tablet. +

+
+
+
+ + + + Tablet PIN Reset Code + tablet_pin_reset_requested + + + + + + + Fusion Plating: Purge expired tablet PIN reset codes + + code + model._cron_purge_expired() + 1 + days + + + +