mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Fix success url
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<script>
|
||||
frappe.ready(function() {
|
||||
$('[data-action="primary"]').click(function() {
|
||||
var url = "/bounty/back-this-bounty?bounty_name={{doc.name}}&user=" + frappe.session.user;
|
||||
var url = "/back-this-bounty?bounty_name={{doc.name}}&user=" + frappe.session.user;
|
||||
var amount = $('[data-field="amount"]').val();
|
||||
if(amount > 0) {
|
||||
url += '&amount=' + amount;
|
||||
|
||||
@@ -15,9 +15,12 @@ class BountyBacker(Document):
|
||||
doc = frappe.get_doc('Bounty', self.bounty_name)
|
||||
self.idx = len(doc.bounty_backer)
|
||||
|
||||
def on_payment_authorized(self, *args, **kwargs):
|
||||
self.db_set('paid', 1)
|
||||
# to trigger form events of Bounty doctype
|
||||
doc = frappe.get_doc('Bounty', self.bounty_name)
|
||||
doc.save()
|
||||
def on_payment_authorized(self, status_changed_to=None):
|
||||
if status_changed_to in ("Completed", "Authorized"):
|
||||
self.db_set('paid', 1)
|
||||
# to trigger form events of Bounty doctype
|
||||
doc = frappe.get_doc('Bounty', self.bounty_name)
|
||||
doc.save()
|
||||
return '/' + doc.route
|
||||
return '/bounties'
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2017-08-23 18:05:50.695856",
|
||||
"modified": "2017-08-23 18:21:28.733120",
|
||||
"modified_by": "faris@erpnext.com",
|
||||
"module": "ERPNext Foundation",
|
||||
"name": "back-this-bounty",
|
||||
@@ -27,7 +27,7 @@
|
||||
"payment_button_label": "Pay now",
|
||||
"payment_gateway": "Razorpay",
|
||||
"published": 1,
|
||||
"route": "bounty/back-this-bounty",
|
||||
"route": "back-this-bounty",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/bounties",
|
||||
|
||||
Reference in New Issue
Block a user