diff --git a/fusion_claims/models/sale_order.py b/fusion_claims/models/sale_order.py index d4b1a41c..a98d3098 100644 --- a/fusion_claims/models/sale_order.py +++ b/fusion_claims/models/sale_order.py @@ -3265,7 +3265,7 @@ class SaleOrder(models.Model): @api.depends( 'x_fc_assessment_start_date', 'x_fc_assessment_end_date', 'x_fc_claim_authorization_date', 'x_fc_original_application', - 'x_fc_signed_pages_11_12', 'x_fc_final_submitted_application', + 'x_fc_has_signed_pages_11_12', 'x_fc_final_submitted_application', 'x_fc_xml_file', 'x_fc_approval_letter', 'x_fc_proof_of_delivery', 'x_fc_vendor_bill_ids', 'invoice_ids', 'invoice_ids.state' ) @@ -3276,7 +3276,7 @@ class SaleOrder(models.Model): ) order.x_fc_trail_has_authorization = bool(order.x_fc_claim_authorization_date) order.x_fc_trail_has_original_app = bool(order.x_fc_original_application) - order.x_fc_trail_has_signed_pages = bool(order.x_fc_signed_pages_11_12) + order.x_fc_trail_has_signed_pages = order.x_fc_has_signed_pages_11_12 order.x_fc_trail_has_final_app = bool(order.x_fc_final_submitted_application) order.x_fc_trail_has_xml = bool(order.x_fc_xml_file) order.x_fc_trail_has_approval_letter = bool(order.x_fc_approval_letter) diff --git a/fusion_claims/tests/test_signed_pages_gate.py b/fusion_claims/tests/test_signed_pages_gate.py index f796699d..8a1d890d 100644 --- a/fusion_claims/tests/test_signed_pages_gate.py +++ b/fusion_claims/tests/test_signed_pages_gate.py @@ -58,3 +58,16 @@ class TestSignedPagesGate(TransactionCase): }) self.order.invalidate_recordset() self.assertFalse(self.order.x_fc_has_signed_pages_11_12) + + def test_trail_has_signed_pages_true_when_bundled(self): + self.order.x_fc_pages_11_12_in_original = True + self.order.flush_recordset() + self.assertTrue(self.order.x_fc_trail_has_signed_pages) + + def test_trail_has_signed_pages_false_when_nothing(self): + self.assertFalse(self.order.x_fc_trail_has_signed_pages) + + def test_trail_has_signed_pages_true_when_separate_file(self): + self.order.x_fc_signed_pages_11_12 = _b64_pdf() + self.order.flush_recordset() + self.assertTrue(self.order.x_fc_trail_has_signed_pages)