Fix template/styles for v3 grid views, add purchasing batch status
This commit is contained in:
parent
c774d6c8e3
commit
c18774e5e5
6 changed files with 62 additions and 34 deletions
|
@ -52,6 +52,18 @@ class BatchMasterView2(MasterView2, BatchMasterView):
|
|||
'executed_by',
|
||||
]
|
||||
|
||||
def get_fallback_templates(self, template, mobile=False):
|
||||
if mobile:
|
||||
return [
|
||||
'/mobile/newbatch/{}.mako'.format(template),
|
||||
'/mobile/master/{}.mako'.format(template),
|
||||
]
|
||||
return [
|
||||
'/newbatch/{}.mako'.format(template),
|
||||
'/master2/{}.mako'.format(template),
|
||||
'/master/{}.mako'.format(template),
|
||||
]
|
||||
|
||||
def configure_grid(self, g):
|
||||
super(BatchMasterView2, self).configure_grid(g)
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ class PurchasingBatchView(BatchMasterView):
|
|||
'date_ordered',
|
||||
'created',
|
||||
'created_by',
|
||||
'status_code',
|
||||
'executed',
|
||||
]
|
||||
|
||||
|
@ -107,6 +108,10 @@ class PurchasingBatchView(BatchMasterView):
|
|||
g.set_label('date_ordered', "Ordered")
|
||||
g.set_label('date_received', "Received")
|
||||
|
||||
def grid_extra_class(self, batch, i):
|
||||
if batch.status_code == batch.STATUS_UNKNOWN_PRODUCT:
|
||||
return 'notice'
|
||||
|
||||
# def make_form(self, batch, **kwargs):
|
||||
# if self.creating:
|
||||
# kwargs.setdefault('id', 'new-purchase-form')
|
||||
|
@ -174,6 +179,7 @@ class PurchasingBatchView(BatchMasterView):
|
|||
fs.notes,
|
||||
fs.created,
|
||||
fs.created_by,
|
||||
fs.status_code,
|
||||
fs.complete,
|
||||
fs.executed,
|
||||
fs.executed_by,
|
||||
|
|
|
@ -224,6 +224,7 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
rows = self.Session.query(model.PurchaseBatchRow)\
|
||||
.filter(model.PurchaseBatchRow.batch == batch)\
|
||||
.filter(model.PurchaseBatchRow.upc.in_((provided, checked)))\
|
||||
.filter(model.PurchaseBatchRow.removed == False)\
|
||||
.all()
|
||||
|
||||
if rows:
|
||||
|
@ -252,6 +253,7 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
row.description = "(unknown product)"
|
||||
batch.add_row(row)
|
||||
self.handler.refresh_row(row)
|
||||
self.handler.refresh_batch_status(batch)
|
||||
|
||||
self.Session.flush()
|
||||
return self.redirect(self.mobile_row_route_url('view', uuid=row.uuid))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue