update KillHouseFreeBarInformationViewSet
This commit is contained in:
@@ -11828,12 +11828,13 @@ class KillHouseFreeBarInformationViewSet(viewsets.ModelViewSet):
|
|||||||
free_bar.acceptor_rejector = user.fullname
|
free_bar.acceptor_rejector = user.fullname
|
||||||
if 'killer_key' in request.data.keys() and request.data['killer_key'] != None and request.data[
|
if 'killer_key' in request.data.keys() and request.data['killer_key'] != None and request.data[
|
||||||
'killer_key'] != '':
|
'killer_key'] != '':
|
||||||
pre_kill_house = free_bar.input_warehouse
|
if free_bar.input_warehouse:
|
||||||
if (pre_kill_house.total_input_warehouse_free_weight - free_bar.weight_of_carcasses) - pre_kill_house.total_selling_warehouse_free_weight < 0 :
|
pre_kill_house = free_bar.input_warehouse
|
||||||
return Response(
|
if (pre_kill_house.total_input_warehouse_free_weight - free_bar.weight_of_carcasses) - pre_kill_house.total_selling_warehouse_free_weight < 0 :
|
||||||
{"result": "به علت عدم موجودی کشتارکن امکان جابجایی وجود ندارد! "},
|
return Response(
|
||||||
status=status.HTTP_403_FORBIDDEN)
|
{"result": "به علت عدم موجودی کشتارکن امکان جابجایی وجود ندارد! "},
|
||||||
pre_product = RolesProducts.objects.filter(kill_house=pre_kill_house, trash=False, name='مرغ گرم').first()
|
status=status.HTTP_403_FORBIDDEN)
|
||||||
|
pre_product = RolesProducts.objects.filter(kill_house=pre_kill_house, trash=False, name='مرغ گرم').first()
|
||||||
exclusive_killer = KillHouse.objects.filter(trash=False, key=request.data['killer_key']).first()
|
exclusive_killer = KillHouse.objects.filter(trash=False, key=request.data['killer_key']).first()
|
||||||
if exclusive_killer.killer and exclusive_killer.type == 'public':
|
if exclusive_killer.killer and exclusive_killer.type == 'public':
|
||||||
if not free_bar.public_killer:
|
if not free_bar.public_killer:
|
||||||
|
|||||||
Reference in New Issue
Block a user