Highlight "has inventory" rows for delete item batch
also pass list of such rows to template context
This commit is contained in:
parent
60fe7cf29c
commit
661d536e9d
|
@ -88,10 +88,20 @@ class DeleteProductBatchView(BatchMasterView):
|
||||||
'status_text',
|
'status_text',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def template_kwargs_view(self, **kwargs):
|
||||||
|
kwargs = super(DeleteProductBatchView, self).template_kwargs_view(**kwargs)
|
||||||
|
batch = kwargs['batch']
|
||||||
|
|
||||||
|
kwargs['rows_with_inventory'] = [row for row in batch.active_rows()
|
||||||
|
if row.status_code == row.STATUS_HAS_INVENTORY]
|
||||||
|
|
||||||
|
return kwargs
|
||||||
|
|
||||||
def row_grid_extra_class(self, row, i):
|
def row_grid_extra_class(self, row, i):
|
||||||
if row.status_code == row.STATUS_PRODUCT_NOT_FOUND:
|
if row.status_code == row.STATUS_PRODUCT_NOT_FOUND:
|
||||||
return 'warning'
|
return 'warning'
|
||||||
if row.status_code in (row.STATUS_DELETE_NOT_ALLOWED,
|
if row.status_code in (row.STATUS_DELETE_NOT_ALLOWED,
|
||||||
|
row.STATUS_HAS_INVENTORY,
|
||||||
row.STATUS_PENDING_CUSTOMER_ORDERS):
|
row.STATUS_PENDING_CUSTOMER_ORDERS):
|
||||||
return 'notice'
|
return 'notice'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue