Merge pull request #33382 from rohitwaghchaure/fixed-pick-list-issue

fix: unsupported operand type(s) for +=: 'int' and 'NoneType'
This commit is contained in:
rohitwaghchaure 2022-12-20 09:47:29 +05:30 committed by GitHub
commit 1ed2230e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,13 +192,13 @@ class PickList(Document):
if item_map.get(key): if item_map.get(key):
item_map[key].qty += item.qty item_map[key].qty += item.qty
item_map[key].stock_qty += item.stock_qty item_map[key].stock_qty += flt(item.stock_qty, item.precision("stock_qty"))
else: else:
item_map[key] = item item_map[key] = item
# maintain count of each item (useful to limit get query) # maintain count of each item (useful to limit get query)
self.item_count_map.setdefault(item_code, 0) self.item_count_map.setdefault(item_code, 0)
self.item_count_map[item_code] += item.stock_qty self.item_count_map[item_code] += flt(item.stock_qty, item.precision("stock_qty"))
return item_map.values() return item_map.values()