mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 05:32:46 +01:00
fix: posting_time issue (#44870)
(cherry picked from commit 079b86044e)
# Conflicts:
# erpnext/stock/deprecated_serial_batch.py
This commit is contained in:
@@ -3,8 +3,12 @@ from collections import defaultdict
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.query_builder.functions import CombineDatetime, Sum
|
from frappe.query_builder.functions import CombineDatetime, Sum
|
||||||
|
<<<<<<< HEAD
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
from frappe.utils.deprecations import deprecated
|
from frappe.utils.deprecations import deprecated
|
||||||
|
=======
|
||||||
|
from frappe.utils import flt, nowtime
|
||||||
|
>>>>>>> 079b86044e (fix: posting_time issue (#44870))
|
||||||
from pypika import Order
|
from pypika import Order
|
||||||
|
|
||||||
|
|
||||||
@@ -112,7 +116,10 @@ class DeprecatedBatchNoValuation:
|
|||||||
sle = frappe.qb.DocType("Stock Ledger Entry")
|
sle = frappe.qb.DocType("Stock Ledger Entry")
|
||||||
|
|
||||||
timestamp_condition = None
|
timestamp_condition = None
|
||||||
if self.sle.posting_date and self.sle.posting_time:
|
if self.sle.posting_date:
|
||||||
|
if self.sle.posting_time is None:
|
||||||
|
self.sle.posting_time = nowtime()
|
||||||
|
|
||||||
posting_datetime = get_combine_datetime(self.sle.posting_date, self.sle.posting_time)
|
posting_datetime = get_combine_datetime(self.sle.posting_date, self.sle.posting_time)
|
||||||
if not self.sle.creation:
|
if not self.sle.creation:
|
||||||
posting_datetime = posting_datetime + datetime.timedelta(milliseconds=1)
|
posting_datetime = posting_datetime + datetime.timedelta(milliseconds=1)
|
||||||
|
|||||||
@@ -643,7 +643,10 @@ class BatchNoValuation(DeprecatedBatchNoValuation):
|
|||||||
child = frappe.qb.DocType("Serial and Batch Entry")
|
child = frappe.qb.DocType("Serial and Batch Entry")
|
||||||
|
|
||||||
timestamp_condition = ""
|
timestamp_condition = ""
|
||||||
if self.sle.posting_date and self.sle.posting_time:
|
if self.sle.posting_date:
|
||||||
|
if self.sle.posting_time is None:
|
||||||
|
self.sle.posting_time = nowtime()
|
||||||
|
|
||||||
timestamp_condition = CombineDatetime(parent.posting_date, parent.posting_time) < CombineDatetime(
|
timestamp_condition = CombineDatetime(parent.posting_date, parent.posting_time) < CombineDatetime(
|
||||||
self.sle.posting_date, self.sle.posting_time
|
self.sle.posting_date, self.sle.posting_time
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user