Invoice showing No stock when stock is present for that item

I have added stock for items via stock entry against temporary opening for a warehouse ,
And its showing in the item master as well

But when i go to submit the item its showing insufficient stock error for the same warehouse.


Why is it showing reserved quantity

Heres the traceback

Traceback (most recent call last):
File “/home/global/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 831, in submit
self._submit()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 820, in _submit
self.save()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 1029, in composer
return composed(self, method, *args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 1012, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/global/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 129, in on_submit
self.update_stock_ledger()
File “/home/global/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 324, in update_stock_ledger
self.make_sl_entries(sl_entries)
File “/home/global/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 265, in make_sl_entries
make_sl_entries(sl_entries, is_amended, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 38, in make_sl_entries
update_bin(args, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/utils.py”, line 120, in update_bin
bin.update_stock(args, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/bin.py”, line 46, in update_stock
}, allow_negative_stock=allow_negative_stock, via_landed_cost_voucher=via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 107, in init
self.build()
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 117, in build
self.raise_exceptions()
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 386, in raise_exceptions
frappe.throw(msg, NegativeStockError, title=‘Insufficent Stock’)
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
NegativeStockError: 8.0 units of Item شكولاتة كادبورى رواندي ويفر مغطى بالشكولاتة والحليب 150 جم needed in Warehouse خيطان مخزن - TF to complete this transaction.

desk.min.js?ver=1514902916.0:1700 Traceback (most recent call last):
File “/home/global/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/global/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/global/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/global/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 831, in submit
self._submit()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 820, in _submit
self.save()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 1029, in composer
return composed(self, method, *args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 1012, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/global/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/global/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 129, in on_submit
self.update_stock_ledger()
File “/home/global/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 324, in update_stock_ledger
self.make_sl_entries(sl_entries)
File “/home/global/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 265, in make_sl_entries
make_sl_entries(sl_entries, is_amended, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 38, in make_sl_entries
update_bin(args, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/utils.py”, line 120, in update_bin
bin.update_stock(args, allow_negative_stock, via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/bin.py”, line 46, in update_stock
}, allow_negative_stock=allow_negative_stock, via_landed_cost_voucher=via_landed_cost_voucher)
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 107, in init
self.build()
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 117, in build
self.raise_exceptions()
File “/home/global/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 386, in raise_exceptions
frappe.throw(msg, NegativeStockError, title=‘Insufficent Stock’)
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/global/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
NegativeStockError: 8.0 units of Item شكولاتة كادبورى رواندي ويفر مغطى بالشكولاتة والحليب 150 جم needed in Warehouse خيطان مخزن - TF to complete this transaction.

I added another stock entry fot his particular item , still it showing as stock needed…
Its even showing available qty at stock as more in the sales invoice items stock details…

Still this error?

Any thing i can do to avoid or remove this error from my side?

Error still coming for some items ,
Shows there is no stock when infact there is stock and its showing.

@rohit_w
Is this a erpnext issue or only my particular setup?

Even in warehouse its showing positive stock for that item…

Thanks

Can you check stock is available before the posting date and time you have entered in the invoice.

1 Like

ah! ,
So the system checks the stock for that day for a back dated entry?

that was the issue, was creating opening invoices for a back date and i added the stock entry on a later date…

Thanks for the quick assistance.

1 Like