Changeset 0ccb688 in tailbone


Ignore:
Timestamp:
06/27/18 17:26:38 (2 years ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
eeba784
Parents:
da10c65
Message:

Don't aggregate product for mobile truck dump receiving

also sort batch rows by most recent, for receiver convenience

Location:
tailbone/views/purchasing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tailbone/views/purchasing/batch.py

    rda10c65 r0ccb688  
    365365                            'status_code')
    366366
     367    def get_mobile_row_data(self, parent):
     368        query = self.get_row_data(parent)
     369        return query.order_by(model.PurchaseBatchRow.sequence.desc())
     370
    367371    def configure_mobile_form(self, f):
    368372        super(PurchasingBatchView, self).configure_mobile_form(f)
  • tailbone/views/purchasing/receiving.py

    rda10c65 r0ccb688  
    594594
    595595        if rows:
    596             if len(rows) > 1:
    597                 log.warning("found multiple UPC matches for {} in batch {}: {}".format(
    598                     upc, batch.id_str, batch))
    599             row = rows[0]
     596            aggregate_products = not bool(batch.truck_dump) # TODO: make this configurable?
     597            if aggregate_products:
     598                if len(rows) > 1:
     599                    log.warning("found multiple UPC matches for {} in batch {}: {}".format(
     600                        upc, batch.id_str, batch))
     601                row = rows[0]
     602
     603            else:
     604                other_row = rows[0]
     605                row = model.PurchaseBatchRow()
     606                row.product = other_row.product
     607                self.handler.add_row(batch, row)
     608                # TODO: is this necessary here? is so, then what about further below?
     609                # self.handler.refresh_batch_status(batch)
    600610
    601611        else:
Note: See TracChangeset for help on using the changeset viewer.