Move row delete check logic for receiving to batch handler
This commit is contained in:
parent
f942716bf9
commit
82656f263d
|
@ -84,7 +84,6 @@ class ReceivingBatchView(PurchasingBatchView):
|
||||||
|
|
||||||
rows_editable = False
|
rows_editable = False
|
||||||
rows_editable_but_not_directly = True
|
rows_editable_but_not_directly = True
|
||||||
rows_deletable = True
|
|
||||||
|
|
||||||
default_uom_is_case = True
|
default_uom_is_case = True
|
||||||
|
|
||||||
|
@ -379,24 +378,8 @@ class ReceivingBatchView(PurchasingBatchView):
|
||||||
if not super(ReceivingBatchView, self).row_deletable(row):
|
if not super(ReceivingBatchView, self).row_deletable(row):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
batch = row.batch
|
# otherwise let handler decide
|
||||||
|
return self.batch_handler.is_row_deletable(row)
|
||||||
# can always delete rows from truck dump parent
|
|
||||||
if batch.is_truck_dump_parent():
|
|
||||||
return True
|
|
||||||
|
|
||||||
# can always delete rows from truck dump child
|
|
||||||
elif batch.is_truck_dump_child():
|
|
||||||
return True
|
|
||||||
|
|
||||||
else: # okay, normal batch
|
|
||||||
if batch.order_quantities_known:
|
|
||||||
return False
|
|
||||||
else: # allow delete if receiving rom scratch
|
|
||||||
return True
|
|
||||||
|
|
||||||
# cannot delete row by default
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get_instance_title(self, batch):
|
def get_instance_title(self, batch):
|
||||||
title = super(ReceivingBatchView, self).get_instance_title(batch)
|
title = super(ReceivingBatchView, self).get_instance_title(batch)
|
||||||
|
|
Loading…
Reference in a new issue