fix: Make Sales Invoice paid when it create from shopping cart (#20879)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
Vishal Dhayagude 2020-04-07 12:07:01 +05:30 committed by GitHub
parent f8e8333d77
commit 8ef0609fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,7 @@ class PaymentRequest(Document):
if (hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart"):
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
si = make_sales_invoice(self.reference_name, ignore_permissions=True)
si.allocate_advances_automatically = True
si = si.insert(ignore_permissions=True)
si.submit()