fix: value error on pos submit
This commit is contained in:
parent
8b21d27f04
commit
4b908ebcd6
@ -846,16 +846,15 @@ def get_pos_reserved_serial_nos(filters):
|
|||||||
|
|
||||||
pos_transacted_sr_nos = query.run(as_dict=True)
|
pos_transacted_sr_nos = query.run(as_dict=True)
|
||||||
|
|
||||||
reserved_sr_nos = []
|
reserved_sr_nos = set()
|
||||||
returned_sr_nos = []
|
returned_sr_nos = set()
|
||||||
for d in pos_transacted_sr_nos:
|
for d in pos_transacted_sr_nos:
|
||||||
if d.is_return == 0:
|
if d.is_return == 0:
|
||||||
reserved_sr_nos += get_serial_nos(d.serial_no)
|
[reserved_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
|
||||||
elif d.is_return == 1:
|
elif d.is_return == 1:
|
||||||
returned_sr_nos += get_serial_nos(d.serial_no)
|
[returned_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
|
||||||
|
|
||||||
for sr_no in returned_sr_nos:
|
reserved_sr_nos = list(reserved_sr_nos - returned_sr_nos)
|
||||||
reserved_sr_nos.remove(sr_no)
|
|
||||||
|
|
||||||
return reserved_sr_nos
|
return reserved_sr_nos
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user