mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
chore: frappe.whitelist for doc methods (#25068)
* chore: frappe.whitelist for doc methods * fix: incorrect spelling * fix: sider issue Co-authored-by: Sagar Vora <sagar@resilient.tech>
This commit is contained in:
@@ -53,6 +53,7 @@ class Member(Document):
|
||||
|
||||
return subscription
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_customer_and_link(self):
|
||||
if self.customer:
|
||||
frappe.msgprint(_("A customer is already linked to this Member"))
|
||||
|
||||
@@ -74,6 +74,7 @@ class Membership(Document):
|
||||
self.generate_invoice(with_payment_entry=settings.automate_membership_payment_entries, save=True)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def generate_invoice(self, save=True, with_payment_entry=False):
|
||||
if not (self.paid or self.currency or self.amount):
|
||||
frappe.throw(_("The payment for this membership is not paid. To generate invoice fill the payment details"))
|
||||
@@ -130,6 +131,7 @@ class Membership(Document):
|
||||
pe.save()
|
||||
pe.submit()
|
||||
|
||||
@frappe.whitelist()
|
||||
def send_acknowlement(self):
|
||||
settings = frappe.get_doc("Non Profit Settings")
|
||||
if not settings.send_email:
|
||||
|
||||
@@ -9,6 +9,7 @@ from frappe.integrations.utils import get_payment_gateway_controller
|
||||
from frappe.model.document import Document
|
||||
|
||||
class NonProfitSettings(Document):
|
||||
@frappe.whitelist()
|
||||
def generate_webhook_secret(self, field="membership_webhook_secret"):
|
||||
key = frappe.generate_hash(length=20)
|
||||
self.set(field, key)
|
||||
@@ -21,6 +22,7 @@ class NonProfitSettings(Document):
|
||||
_("Webhook Secret")
|
||||
)
|
||||
|
||||
@frappe.whitelist()
|
||||
def revoke_key(self, key):
|
||||
self.set(key, None)
|
||||
self.save()
|
||||
|
||||
Reference in New Issue
Block a user