mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-26 01:58:31 +00:00
fix: wrong quantity after transaction for parallel stock transactions
When two transactions are inserted parallelly then previous SLE could be incorrect for some of them. Locking SLE table would prevent reading from it till transaction is complete.
This commit is contained in:
@@ -232,7 +232,8 @@ class update_entries_after(object):
|
||||
and is_cancelled = 0
|
||||
and timestamp(posting_date, time_format(posting_time, %(time_format)s)) < timestamp(%(posting_date)s, time_format(%(posting_time)s, %(time_format)s))
|
||||
order by timestamp(posting_date, posting_time) desc, creation desc
|
||||
limit 1""", args, as_dict=1)
|
||||
limit 1
|
||||
for update""", args, as_dict=1)
|
||||
|
||||
return sle[0] if sle else frappe._dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user