fix: FY in naming series variable for orders

(cherry picked from commit 7a7d32db81)
This commit is contained in:
Deepesh Garg
2023-07-21 16:03:17 +05:30
committed by Mergify
parent ae494b8ee8
commit 6a6a3ae3c3

View File

@@ -1108,7 +1108,8 @@ def get_autoname_with_number(number_value, doc_title, company):
def parse_naming_series_variable(doc, variable):
if variable == "FY":
return get_fiscal_year(date=doc.get("posting_date"), company=doc.get("company"))[0]
date = doc.get("posting_date") or doc.get("transaction_date") or getdate()
return get_fiscal_year(date=date, company=doc.get("company"))[0]
@frappe.whitelist()