changes
This commit is contained in:
@@ -160,14 +160,14 @@ class FusionShipment(models.Model):
|
||||
vals['packing_list_attachment_id'] = (
|
||||
delivery.packing_list_attachment_id.id
|
||||
)
|
||||
# Once a tracking number exists, the parts have been picked
|
||||
# by the carrier (or are about to be) — advance the portal
|
||||
# state to 'shipped' so the customer sees their order is
|
||||
# on its way. The 'delivered' status flips when FedEx
|
||||
# tracking reports the delivery.
|
||||
if self.tracking_number and portal.state in (
|
||||
'received', 'in_progress', 'ready_to_ship',
|
||||
):
|
||||
vals['state'] = 'shipped'
|
||||
if vals:
|
||||
portal.sudo().write(vals)
|
||||
# State is now derived centrally — see
|
||||
# fusion.plating.portal.job._fp_recompute_portal_state. It
|
||||
# only promotes to 'shipped' when every linked WO is done
|
||||
# AND the shipment.status is 'shipped' or 'delivered'. A
|
||||
# FedEx label booked early (tracking number without the
|
||||
# carrier actually picking up) no longer leapfrogs the
|
||||
# shop floor.
|
||||
if hasattr(portal, '_fp_recompute_portal_state'):
|
||||
portal.sudo()._fp_recompute_portal_state()
|
||||
|
||||
Reference in New Issue
Block a user