fix(cart): Don't use window.open as it can be blocked

window.open calls are interpreted as popups by some browsers and are
blocked.

Also, route to Quotation web view instead of printview.
This commit is contained in:
Faris Ansari 2019-05-01 14:32:15 +05:30
parent 6687c5a9fc
commit 5f1eebec16

View File

@ -162,8 +162,7 @@ $.extend(shopping_cart, {
.html(msg || frappe._("Something went wrong!"))
.toggle(true);
} else {
window.open('/orders/' + encodeURIComponent(r.message), '_blank');
window.location.reload();
window.location.href = '/orders/' + encodeURIComponent(r.message);
}
}
});
@ -186,8 +185,7 @@ $.extend(shopping_cart, {
.html(msg || frappe._("Something went wrong!"))
.toggle(true);
} else {
window.open('/printview?doctype=Quotation&name=' + r.message, '_blank');
window.location.reload();
window.location.href = '/quotations/' + encodeURIComponent(r.message);
}
}
});