feat(claims): ready-for-submission gate accepts bundled pages flag

Both the has_documents indicator and the action_confirm missing-items
gate now read x_fc_has_signed_pages_11_12, so orders with pages 11 & 12
bundled inside the original PDF can move to Ready for Submission without
a separate signed-pages file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-19 16:20:35 -04:00
parent 3bef640979
commit 7a891c5aaa
2 changed files with 25 additions and 2 deletions

View File

@@ -71,3 +71,26 @@ class TestSignedPagesGate(TransactionCase):
self.order.x_fc_signed_pages_11_12 = _b64_pdf()
self.order.flush_recordset()
self.assertTrue(self.order.x_fc_trail_has_signed_pages)
def test_ready_for_submission_passes_with_bundled_flag_only(self):
"""Ready-for-submission gate passes when bundled flag is True even
without a separate signed-pages file."""
self.order.write({
'x_fc_adp_application_status': 'application_received',
'x_fc_original_application': _b64_pdf(),
'x_fc_original_application_filename': 'app.pdf',
'x_fc_pages_11_12_in_original': True,
'x_fc_client_ref_1': 'JODO',
'x_fc_client_ref_2': '1234',
'x_fc_reason_for_application': 'first_access',
})
self.order.flush_recordset()
wizard = self.env['fusion_claims.ready.for.submission.wizard'].with_context(
active_id=self.order.id, active_model='sale.order',
).create({
'sale_order_id': self.order.id,
'claim_authorization_date': '2026-05-01',
})
wizard.action_confirm()
self.assertEqual(self.order.x_fc_adp_application_status, 'ready_submission')

View File

@@ -92,7 +92,7 @@ class ReadyForSubmissionWizard(models.TransientModel):
wizard.has_authorization_date = bool(order.x_fc_claim_authorization_date)
wizard.has_client_refs = bool(order.x_fc_client_ref_1 and order.x_fc_client_ref_2)
wizard.has_reason = bool(order.x_fc_reason_for_application)
wizard.has_documents = bool(order.x_fc_original_application and order.x_fc_signed_pages_11_12)
wizard.has_documents = bool(order.x_fc_original_application and order.x_fc_has_signed_pages_11_12)
@api.model
def default_get(self, fields_list):
@@ -145,7 +145,7 @@ class ReadyForSubmissionWizard(models.TransientModel):
# Check documents
if not order.x_fc_original_application:
missing.append('Original ADP Application (upload in Application Received step)')
if not order.x_fc_signed_pages_11_12:
if not order.x_fc_has_signed_pages_11_12:
missing.append('Page 11 & 12 Signed (upload in Application Received step)')
if missing: