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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user