This commit is contained in:
gsinghpal
2026-05-18 22:33:23 -04:00
parent 25f568f225
commit 091f98e1f9
76 changed files with 4521 additions and 220 deletions

View File

@@ -424,7 +424,10 @@ class FpCustomerPortal(CustomerPortal):
'icon': '📑',
})
# SHIPPING (idx 4) — packing list + tracking
# SHIPPING (idx 4) — packing list + tracking. Two separate
# docs so each can be pending/ready independently. Previously
# combined into one entry; that broke when tracking_ref landed
# before the packing slip (KeyError 'url').
if job.packing_list_attachment_id:
groups[4]['docs'].append({
'label': 'Packing Slip',
@@ -438,11 +441,26 @@ class FpCustomerPortal(CustomerPortal):
})
else:
groups[4]['docs'].append({
'label': 'Packing Slip · Tracking #',
'sub': 'Available when shipped' + ('' + job.tracking_ref if job.tracking_ref else ''),
'pending': not job.tracking_ref,
'label': 'Packing Slip',
'sub': 'Available once shipped',
'pending': True,
'icon': '📦',
})
if job.tracking_ref:
groups[4]['docs'].append({
'label': 'Tracking #%s' % job.tracking_ref,
'sub': 'Click to track on the carrier site',
'url': job.x_fc_tracking_url or '#',
'icon_class': 'o_fp_doc_icon_shipping',
'icon': '🚚',
})
else:
groups[4]['docs'].append({
'label': 'Tracking #',
'sub': 'Available when shipped',
'pending': True,
'icon': '🚚',
})
return groups