Skip to content

Commit 3bdac5c

Browse files
authored
fix: batch/serial should use parent's posting datetime for naming (backport #54206) (#54209)
1 parent 7d8f59e commit 3bdac5c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

erpnext/accounts/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,10 @@ def parse_naming_series_variable(doc, variable):
16031603

16041604
else:
16051605
data = {"YY": "%y", "YYYY": "%Y", "MM": "%m", "DD": "%d", "JJJ": "%j"}
1606+
1607+
if doc and doc.doctype in ["Batch", "Serial No"] and doc.reference_doctype and doc.reference_name:
1608+
doc = frappe.get_doc(doc.reference_doctype, doc.reference_name)
1609+
16061610
date = (
16071611
(
16081612
getdate(doc.get("posting_date") or doc.get("transaction_date") or doc.get("posting_datetime"))

0 commit comments

Comments
 (0)