fix: prevent set_payment_schedule on return documents

This commit is contained in:
ruthra kumar
2024-12-09 12:58:20 +05:30
parent 94a0725917
commit 2560beb695

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