diff --git a/tailbone/views/purchasing/batch.py b/tailbone/views/purchasing/batch.py index bf03fcda..b4156edf 100644 --- a/tailbone/views/purchasing/batch.py +++ b/tailbone/views/purchasing/batch.py @@ -364,10 +364,6 @@ class PurchasingBatchView(BatchMasterView): 'vendor_contact', 'status_code') - def get_mobile_row_data(self, parent): - query = self.get_row_data(parent) - return query.order_by(model.PurchaseBatchRow.sequence.desc()) - def configure_mobile_form(self, f): super(PurchasingBatchView, self).configure_mobile_form(f) diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index 9dcacaf3..212a5073 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -563,6 +563,13 @@ class ReceivingBatchView(PurchasingBatchView): f.set_readonly('po_total') f.set_readonly('invoice_total') + def get_mobile_row_data(self, parent): + query = self.get_row_data(parent) + aggregate_products = not bool(parent.truck_dump) # TODO: make this configurable? + if not aggregate_products: + query = query.order_by(model.PurchaseBatchRow.sequence.desc()) + return query + def render_mobile_row_listitem(self, row, i): description = row.product.full_description if row.product else row.description return "({}) {}".format(row.upc.pretty(), description)