Skip to content

Commit

Permalink
Merge pull request #34671 from frappe/mergify/bp/version-14-hotfix/pr…
Browse files Browse the repository at this point in the history
…-34636

fix: posting time issue (backport #34636)
  • Loading branch information
rohitwaghchaure authored Mar 30, 2023
2 parents 27a3f2c + bb5eeb6 commit 9ce281d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions erpnext/stock/doctype/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from frappe import _
from frappe.model.document import Document
from frappe.model.naming import make_autoname, revert_series_if_last
from frappe.utils import cint, flt, get_link_to_form
from frappe.utils import cint, flt, get_link_to_form, nowtime
from frappe.utils.data import add_days
from frappe.utils.jinja import render_template

Expand Down Expand Up @@ -179,7 +179,11 @@ def get_batch_qty(
out = 0
if batch_no and warehouse:
cond = ""
if posting_date and posting_time:

if posting_date:
if posting_time is None:
posting_time = nowtime()

cond = " and timestamp(posting_date, posting_time) <= timestamp('{0}', '{1}')".format(
posting_date, posting_time
)
Expand Down

0 comments on commit 9ce281d

Please sign in to comment.