Add initial support for mobile "quick row" feature, for ordering
at least for now, ordering only, but hopefully much more soon...
This commit is contained in:
parent
aa6e540abd
commit
68bd3047c4
10 changed files with 143 additions and 23 deletions
|
@ -586,6 +586,13 @@ class PurchasingBatchView(BatchMasterView):
|
|||
# query = super(PurchasingBatchView, self).get_row_data(batch)
|
||||
# return query.options(orm.joinedload(model.PurchaseBatchRow.credits))
|
||||
|
||||
def get_mobile_row_data(self, parent):
|
||||
query = self.get_row_data(parent)
|
||||
return self.sort_mobile_row_data(query)
|
||||
|
||||
def sort_mobile_row_data(self, query):
|
||||
return query.order_by(model.PurchaseBatchRow.modified.desc())
|
||||
|
||||
def configure_row_grid(self, g):
|
||||
super(PurchasingBatchView, self).configure_row_grid(g)
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
index_title = "Ordering"
|
||||
mobile_creatable = True
|
||||
rows_editable = True
|
||||
mobile_rows_creatable = True
|
||||
mobile_rows_quickable = True
|
||||
mobile_rows_editable = True
|
||||
has_worksheet = True
|
||||
|
||||
|
|
|
@ -579,13 +579,6 @@ 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)
|
||||
return self.sort_mobile_row_data(query)
|
||||
|
||||
def sort_mobile_row_data(self, query):
|
||||
return query.order_by(model.PurchaseBatchRow.modified.desc())
|
||||
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue