Misc. API improvements for sake of mobile receiving
This commit is contained in:
parent
ad9c193061
commit
a721ec4a43
4 changed files with 74 additions and 17 deletions
|
@ -130,6 +130,7 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
model_title_plural = "Receiving Batches"
|
||||
index_title = "Receiving"
|
||||
downloadable = True
|
||||
bulk_deletable = True
|
||||
rows_editable = True
|
||||
mobile_creatable = True
|
||||
mobile_rows_filterable = True
|
||||
|
@ -200,6 +201,7 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
'truck_dump_status',
|
||||
'rowcount',
|
||||
'order_quantities_known',
|
||||
'receiving_complete',
|
||||
'complete',
|
||||
'executed',
|
||||
'executed_by',
|
||||
|
@ -639,9 +641,6 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
default_value=default_status)
|
||||
return filters
|
||||
|
||||
def get_purchase(self, uuid):
|
||||
return self.Session.query(model.Purchase).get(uuid)
|
||||
|
||||
def mobile_create(self):
|
||||
"""
|
||||
Mobile view for creating a new receiving batch
|
||||
|
@ -759,9 +758,9 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
Assign the original purchase order to the given batch. Default
|
||||
behavior assumes a Rattail Purchase object is what we're after.
|
||||
"""
|
||||
purchase = self.get_purchase(po_form.validated[self.purchase_order_fieldname])
|
||||
if isinstance(purchase, model.Purchase):
|
||||
batch.purchase_uuid = purchase.uuid
|
||||
purchase = self.handler.assign_purchase_order(
|
||||
batch, po_form.validated[self.purchase_order_fieldname],
|
||||
session=self.Session())
|
||||
|
||||
department = self.department_for_purchase(purchase)
|
||||
if department:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue