Created
March 30, 2012 22:30
-
-
Save kyleterry/2256453 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@classmethod | |
def finish_sequencing_on(cls, when, dot=None, only=None, split_printing_at=300): | |
if only is not None: | |
pick_sets = (only,) | |
else: | |
pick_sets = cls.pick_sets_on(when) | |
seq = 0 | |
for p in sorted(pick_sets, key=lambda p: p.sequence): | |
seq = p.finish_sequencing(sequence_start=seq) | |
if dot: | |
dot() | |
if dot: | |
dot("->") | |
cls.color_drop_points(when) | |
telegram.broadcast(channel='beehive-pick_set', subject='Pick Set Sequencing Finished', | |
content='Ready to start printing', add_to_queue=False) | |
StockTransfer = models.get_model("stock_transfer", "StockTransfer") | |
if only is not None: | |
Piece = models.get_model("warehouse_pieces", "Piece") | |
pieces = Piece.objects.filter(pk__in=only.order_pieces.values_list('piece', flat=True)).distinct() | |
pieces = reduce(lambda t, p: t + list(p.breakdown_family), pieces, []) | |
StockTransfer.update_transfers(pieces) | |
else: | |
StockTransfer.update_transfers() | |
for p in pick_sets: | |
p.generate_pdfs(split_printing_at=split_printing_at) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment