Esempio n. 1
0
    def done(cls, shipments):
        """
        Add endicia shipments to a open manifest
        """
        ShippingManifest = Pool().get('shipping.manifest')

        super(ShipmentOut, cls).done(shipments)

        for shipment in shipments:
            if shipment.carrier and \
                    shipment.carrier.carrier_cost_method == 'endicia':
                with Transaction().set_user(0):
                    manifest = ShippingManifest.get_manifest(
                        shipment.carrier, shipment.warehouse
                    )
                shipment.manifest = manifest
                shipment.save()