Merge pull request #44610 from ruthra-kumar/backport_v15_44495

fix: prevent set_payment_schedule on return documents
This commit is contained in:
ruthra kumar
2024-12-09 13:34:07 +05:30
committed by GitHub

View File

@@ -1046,7 +1046,7 @@ def make_sales_invoice(source_name, target_doc=None, args=None):
automatically_fetch_payment_terms = cint(
frappe.db.get_single_value("Accounts Settings", "automatically_fetch_payment_terms")
)
if automatically_fetch_payment_terms:
if automatically_fetch_payment_terms and not doc.is_return:
doc.set_payment_schedule()
return doc