mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
[fix] [minor] only post sl entries if stock item exists
This commit is contained in:
@@ -11,6 +11,7 @@ import json
|
||||
class NegativeStockError(webnotes.ValidationError): pass
|
||||
|
||||
def make_sl_entries(sl_entries, is_amended=None):
|
||||
if sl_entries:
|
||||
from stock.utils import update_bin
|
||||
|
||||
cancel = True if sl_entries[0].get("is_cancelled") == "Yes" else False
|
||||
@@ -33,7 +34,8 @@ def make_sl_entries(sl_entries, is_amended=None):
|
||||
update_bin(args)
|
||||
|
||||
if cancel:
|
||||
delete_cancelled_entry(sl_entries[0].get('voucher_type'), sl_entries[0].get('voucher_no'))
|
||||
delete_cancelled_entry(sl_entries[0].get('voucher_type'),
|
||||
sl_entries[0].get('voucher_no'))
|
||||
|
||||
def set_as_cancel(voucher_type, voucher_no):
|
||||
webnotes.conn.sql("""update `tabStock Ledger Entry` set is_cancelled='Yes',
|
||||
|
||||
Reference in New Issue
Block a user