Changeset eeba784 in tailbone


Ignore:
Timestamp:
06/27/18 17:29:31 (2 years ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
49f241a
Parents:
0ccb688
Message:

Be smarter about when we sort receiving batch by most recent (for mobile)

i.e. only do so when *not* aggregating products, since that probably needs a
closer look first

Location:
tailbone/views/purchasing
Files:
2 edited

Legend:

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

    r0ccb688 reeba784  
    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 
    371367    def configure_mobile_form(self, f):
    372368        super(PurchasingBatchView, self).configure_mobile_form(f)
  • tailbone/views/purchasing/receiving.py

    r0ccb688 reeba784  
    564564        f.set_readonly('invoice_total')
    565565
     566    def get_mobile_row_data(self, parent):
     567        query = self.get_row_data(parent)
     568        aggregate_products = not bool(parent.truck_dump) # TODO: make this configurable?
     569        if not aggregate_products:
     570            query = query.order_by(model.PurchaseBatchRow.sequence.desc())
     571        return query
     572
    566573    def render_mobile_row_listitem(self, row, i):
    567574        description = row.product.full_description if row.product else row.description
Note: See TracChangeset for help on using the changeset viewer.