From d457b86eaa6fb65754d7218afba5a9f61ed71484 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Thu, 4 Jun 2026 01:09:14 -0400 Subject: [PATCH] fix(fusion_claims): default booking description + isolate order-less task test Review follow-up: the base fusion.technician.task.description is required=True and non-in-store tasks require an address (_check_address_required). So: - action_book_from_wizard now defaults description to 'Service booking' when the payload carries neither description nor issue (avoids a required-field failure). - test_task_without_order_is_allowed now sets description + is_in_store=True so it exercises only the relaxed _check_order_link, not those unrelated base constraints. Co-Authored-By: Claude Opus 4.8 (1M context) --- fusion_claims/models/technician_task.py | 2 +- fusion_claims/tests/test_service_booking.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fusion_claims/models/technician_task.py b/fusion_claims/models/technician_task.py index fae97735..7f13d2e0 100644 --- a/fusion_claims/models/technician_task.py +++ b/fusion_claims/models/technician_task.py @@ -533,7 +533,7 @@ class FusionTechnicianTaskClaims(models.Model): 'duration_hours': dur, 'is_in_store': in_shop, 'x_fc_service_call_type': '%s_%s' % (category, timing), - 'description': payload.get('description') or payload.get('issue') or '', + 'description': payload.get('description') or payload.get('issue') or _('Service booking'), } if partner: task_vals['partner_id'] = partner.id diff --git a/fusion_claims/tests/test_service_booking.py b/fusion_claims/tests/test_service_booking.py index 1dc6cba2..caed18a4 100644 --- a/fusion_claims/tests/test_service_booking.py +++ b/fusion_claims/tests/test_service_booking.py @@ -18,11 +18,15 @@ class TestServiceBooking(TransactionCase): }) def test_task_without_order_is_allowed(self): - # repair for a brand-new client: no SO/PO must NOT raise after the relax + # No SO/PO must NOT raise after the relax. description is required and a + # non-in-store task needs an address, so set both here to isolate the test + # to the order-link relaxation (not those unrelated base constraints). t = self.Task.create({ 'task_type': 'repair', 'technician_id': self.tech.id, 'scheduled_date': date(2026, 6, 3), + 'description': 'Test repair', + 'is_in_store': True, }) self.assertTrue(t.id)