fix(tablet_pin_reset): manifest data slot + drop notif wrapper (deploy fixes)

Two bugs caught by entech battle test on first deploy:

1. Manifest entry landed in the 'demo' list instead of 'data' because
   my anchor (fp_demo_shopfloor_data.xml) was already in 'demo' —
   the entry pattern-matched into the wrong section. Demo data
   doesn't load on entech (no --load demo), so the mail.template
   never existed. Moved fp_tablet_pin_reset_template.xml to 'data'.

2. The fp.notification.template wrapper record referenced a model
   that doesn't exist until fusion_plating_notifications loads;
   fusion_plating_shopfloor doesn't depend on notifications, so
   the data load ParseError'd. Removed the wrapper — the controller
   calls mail_template.send_mail() directly anyway, not via the
   notification dispatcher. Added an inline comment explaining why
   the wrapper isn't here.

Battle test updated to drop the (now removed) wrapper xmlid check.
Battle test ALL PASS on entech after fixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-25 17:02:18 -04:00
parent 9223f8da7c
commit 1b473a7873
3 changed files with 11 additions and 16 deletions

View File

@@ -48,6 +48,7 @@ Copyright (c) 2026 Nexa Systems Inc. All rights reserved.
'data/fp_tablet_config_data.xml',
'data/fp_tablet_kiosk_user.xml',
'data/fp_tablet_cron.xml',
'data/fp_tablet_pin_reset_template.xml',
'views/fp_shopfloor_station_views.xml',
'views/res_users_views.xml',
'views/fp_bake_oven_views.xml',
@@ -59,7 +60,6 @@ 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': [

View File

@@ -46,13 +46,15 @@
</field>
</record>
<!-- ===== fp.notification.template wrapper ========================= -->
<record id="fp_notif_tablet_pin_reset" model="fp.notification.template">
<field name="name">Tablet PIN Reset Code</field>
<field name="trigger_event">tablet_pin_reset_requested</field>
<field name="mail_template_id" ref="fp_mail_template_tablet_pin_reset"/>
<field name="active" eval="True"/>
</record>
<!-- NB: an fp.notification.template wrapper around this mail.template
would normally live here for admin UI customization, but
fusion_plating_shopfloor does NOT depend on
fusion_plating_notifications, so the wrapper can't be data-loaded
without a cross-module dep. The controller calls
mail_template.send_mail() directly (not via _dispatch), so the
wrapper isn't required for the email to go out. If a wrapper
is needed later for trigger_event-based admin tweaks, add it
in fusion_plating_notifications/data/ instead. -->
<!-- ===== Cleanup cron ============================================ -->
<record id="cron_purge_expired_pin_resets" model="ir.cron">

View File

@@ -100,14 +100,7 @@ tpl = env.ref(
)
_ok(bool(tpl), 'mail.template fp_mail_template_tablet_pin_reset exists')
# 9. Notification template wrapper exists
notif = env.ref(
'fusion_plating_shopfloor.fp_notif_tablet_pin_reset',
raise_if_not_found=False,
)
_ok(bool(notif), 'fp.notification.template fp_notif_tablet_pin_reset exists')
# 10. Cleanup cron exists
# 9. Cleanup cron exists
cron = env.ref(
'fusion_plating_shopfloor.cron_purge_expired_pin_resets',
raise_if_not_found=False,