Merge pull request #44611 from ruthra-kumar/backport_v14_44495

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

View File

@@ -713,7 +713,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