fix: stock ledger entry created against draft stock entry (#25540)

This commit is contained in:
rohitwaghchaure 2021-05-01 13:53:39 +05:30 committed by GitHub
parent e91b0021ac
commit 00ea336b52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -416,7 +416,7 @@ class update_entries_after(object):
frappe.db.set_value("Stock Entry Detail", sle.voucher_detail_no, "basic_rate", outgoing_rate)
# Update outgoing item's rate, recalculate FG Item's rate and total incoming/outgoing amount
stock_entry = frappe.get_doc("Stock Entry", sle.voucher_no)
stock_entry = frappe.get_doc("Stock Entry", sle.voucher_no, for_update=True)
stock_entry.calculate_rate_and_amount(reset_outgoing_rate=False, raise_error_if_no_rate=False)
stock_entry.db_update()
for d in stock_entry.items:

View File

@ -172,7 +172,7 @@ def get_bin(item_code, warehouse):
bin_obj.flags.ignore_permissions = 1
bin_obj.insert()
else:
bin_obj = frappe.get_cached_doc('Bin', bin)
bin_obj = frappe.get_doc('Bin', bin, for_update=True)
bin_obj.flags.ignore_permissions = True
return bin_obj