This commit is contained in:
gsinghpal
2026-02-23 00:32:20 -05:00
parent d6bac8e623
commit e8e554de95
549 changed files with 1330 additions and 124935 deletions

View File

@@ -71,6 +71,13 @@ class DeviceApprovalWizard(models.TransientModel):
help='ADP Claim Number from the approval letter',
)
approval_date = fields.Date(
string='Approval Date',
default=fields.Date.context_today,
help='Date ADP approved the application. Defaults to today but can be changed '
'if ADP approved before the letter was received.',
)
# Approval Documents - for Mark as Approved mode
is_mark_approved_mode = fields.Boolean(
string='Mark Approved Mode',
@@ -281,6 +288,7 @@ class DeviceApprovalWizard(models.TransientModel):
update_vals = {
'x_fc_adp_application_status': new_status,
'x_fc_claim_approval_date': self.approval_date or fields.Date.context_today(self),
}
# Save claim number if provided
@@ -340,8 +348,8 @@ class DeviceApprovalWizard(models.TransientModel):
# Post approval to chatter with all documents in ONE message
from markupsafe import Markup
from datetime import date
approval_date_str = (self.approval_date or fields.Date.context_today(self)).strftime('%B %d, %Y')
device_details = f'{approved_count} approved'
if unapproved_count > 0:
device_details += f', {unapproved_count} not approved'
@@ -364,7 +372,7 @@ class DeviceApprovalWizard(models.TransientModel):
body=Markup(
'<div class="alert alert-success" role="alert">'
'<h5 class="alert-heading"><i class="fa fa-check-circle"/> Application Approved</h5>'
f'<p class="mb-1"><strong>Date:</strong> {date.today().strftime("%B %d, %Y")}</p>'
f'<p class="mb-1"><strong>Date:</strong> {approval_date_str}</p>'
f'<p class="mb-1"><strong>Devices:</strong> {device_details}</p>'
f'{docs_html}'
'</div>'
@@ -379,7 +387,7 @@ class DeviceApprovalWizard(models.TransientModel):
body=Markup(
'<div class="alert alert-success" role="alert">'
'<h5 class="alert-heading"><i class="fa fa-check-circle"/> Application Approved</h5>'
f'<p class="mb-1"><strong>Date:</strong> {date.today().strftime("%B %d, %Y")}</p>'
f'<p class="mb-1"><strong>Date:</strong> {approval_date_str}</p>'
f'<p class="mb-1"><strong>Devices:</strong> {device_details}</p>'
'</div>'
),