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>
|
<script>
|
||||||
frappe.ready(function() {
|
frappe.ready(function() {
|
||||||
$('[data-action="primary"]').click(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();
|
var amount = $('[data-field="amount"]').val();
|
||||||
if(amount > 0) {
|
if(amount > 0) {
|
||||||
url += '&amount=' + amount;
|
url += '&amount=' + amount;
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ class BountyBacker(Document):
|
|||||||
doc = frappe.get_doc('Bounty', self.bounty_name)
|
doc = frappe.get_doc('Bounty', self.bounty_name)
|
||||||
self.idx = len(doc.bounty_backer)
|
self.idx = len(doc.bounty_backer)
|
||||||
|
|
||||||
def on_payment_authorized(self, *args, **kwargs):
|
def on_payment_authorized(self, status_changed_to=None):
|
||||||
self.db_set('paid', 1)
|
if status_changed_to in ("Completed", "Authorized"):
|
||||||
# to trigger form events of Bounty doctype
|
self.db_set('paid', 1)
|
||||||
doc = frappe.get_doc('Bounty', self.bounty_name)
|
# to trigger form events of Bounty doctype
|
||||||
doc.save()
|
doc = frappe.get_doc('Bounty', self.bounty_name)
|
||||||
|
doc.save()
|
||||||
|
return '/' + doc.route
|
||||||
|
return '/bounties'
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"login_required": 1,
|
"login_required": 1,
|
||||||
"max_attachment_size": 0,
|
"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",
|
"modified_by": "faris@erpnext.com",
|
||||||
"module": "ERPNext Foundation",
|
"module": "ERPNext Foundation",
|
||||||
"name": "back-this-bounty",
|
"name": "back-this-bounty",
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"payment_button_label": "Pay now",
|
"payment_button_label": "Pay now",
|
||||||
"payment_gateway": "Razorpay",
|
"payment_gateway": "Razorpay",
|
||||||
"published": 1,
|
"published": 1,
|
||||||
"route": "bounty/back-this-bounty",
|
"route": "back-this-bounty",
|
||||||
"show_sidebar": 1,
|
"show_sidebar": 1,
|
||||||
"sidebar_items": [],
|
"sidebar_items": [],
|
||||||
"success_url": "/bounties",
|
"success_url": "/bounties",
|
||||||
|
|||||||
Reference in New Issue
Block a user