Merge branch 'develop' into manufacturing-work-order-closed

This commit is contained in:
Anupam Kumar 2021-11-17 10:07:35 +05:30 committed by GitHub
commit 98308ea089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -548,10 +548,14 @@ def make_payment_order(source_name, target_doc=None):
return doclist
def validate_payment(doc, method=""):
if not frappe.db.has_column(doc.reference_doctype, 'status'):
def validate_payment(doc, method=None):
if doc.reference_doctype != "Payment Request" or (
frappe.db.get_value(doc.reference_doctype, doc.reference_docname, 'status')
!= "Paid"
):
return
status = frappe.db.get_value(doc.reference_doctype, doc.reference_docname, 'status')
if status == 'Paid':
frappe.throw(_("The Payment Request {0} is already paid, cannot process payment twice").format(doc.reference_docname))
frappe.throw(
_("The Payment Request {0} is already paid, cannot process payment twice")
.format(doc.reference_docname)
)