From 00f7e90a3d5bec99b87d4680f2238ba4056cbf22 Mon Sep 17 00:00:00 2001
From: gsinghpal
Date: Tue, 2 Jun 2026 08:55:49 -0400
Subject: [PATCH] feat(fusion_repairs): maintenance foundation - policy +
priced auto-contracts on sale (Plan 1)
Plan 1 of fusion_maintenance, verified on the Westin Enterprise sandbox (westin-fr-test) via odoo shell. Maintenance policy (enabled/interval/flat fee/service product) on the equipment category + per-product fee override; contract gains fee/source/serial/policy/currency; fixed the dead _spawn_maintenance_contracts and wired it into the existing action_confirm (delivery-date anchor w/ fallback, two-regime serial dedup, fee resolution product->category); reminder email shows the flat fee; category form exposes the policy. Verified: trigger creates 1 priced contract (fee 149, next_due commitment+6mo, source=sale); idempotent on re-confirm; product override beats category; no contract when category not maintainable; fee renders as $149.00. v19.0.2.3.0.
NOTE: mail_template_data.xml is noupdate=1 -> the fee line loads on fresh install (the prod deploy) but NOT on -u of an already-installed system. The Westin prod-config test container (workers + log_level=warn) does not run --test-enable post_install tests (a pre-existing module load issue under the test phase), so behaviour was verified by odoo shell instead.
Co-Authored-By: Claude Opus 4.8 (1M context)
---
fusion_repairs/__manifest__.py | 2 +-
fusion_repairs/data/mail_template_data.xml | 6 ++
fusion_repairs/models/maintenance_contract.py | 86 +++++++++++----
fusion_repairs/models/product_template.py | 4 +
.../models/repair_product_category.py | 25 +++++
fusion_repairs/models/repair_service_plan.py | 1 +
fusion_repairs/tests/__init__.py | 2 +
.../tests/test_maintenance_foundation.py | 100 ++++++++++++++++++
.../views/repair_product_category_views.xml | 7 ++
9 files changed, 213 insertions(+), 20 deletions(-)
create mode 100644 fusion_repairs/tests/__init__.py
create mode 100644 fusion_repairs/tests/test_maintenance_foundation.py
diff --git a/fusion_repairs/__manifest__.py b/fusion_repairs/__manifest__.py
index a4288acc..d265c364 100644
--- a/fusion_repairs/__manifest__.py
+++ b/fusion_repairs/__manifest__.py
@@ -4,7 +4,7 @@
{
'name': 'Fusion Repairs',
- 'version': '19.0.2.2.6',
+ 'version': '19.0.2.3.0',
'category': 'Inventory/Repairs',
'summary': 'Guided medical equipment repair intake, dispatch, maintenance, and self-service portal',
'description': """
diff --git a/fusion_repairs/data/mail_template_data.xml b/fusion_repairs/data/mail_template_data.xml
index fb12c0e4..290fd354 100644
--- a/fusion_repairs/data/mail_template_data.xml
+++ b/fusion_repairs/data/mail_template_data.xml
@@ -433,6 +433,12 @@
is due for its next scheduled maintenance visit on
.
+
+
+ Maintenance visit fee:
+ + applicable tax.
+
+