mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
[fix] buttons for rfq and material request
This commit is contained in:
@@ -39,8 +39,12 @@ frappe.ui.form.on("Request for Quotation",{
|
|||||||
|
|
||||||
refresh: function(frm, cdt, cdn) {
|
refresh: function(frm, cdt, cdn) {
|
||||||
if (frm.doc.docstatus === 1) {
|
if (frm.doc.docstatus === 1) {
|
||||||
frm.add_custom_button(__("Make Supplier Quotation"),
|
frm.add_custom_button(__("Make"),
|
||||||
function(){ frm.trigger("make_suppplier_quotation") });
|
function(){ frm.trigger("make_suppplier_quotation") }, __("Supplier Quotation"));
|
||||||
|
|
||||||
|
frm.add_custom_button(__("View"),
|
||||||
|
function(){ frappe.set_route('List', 'Supplier Quotation',
|
||||||
|
{'request_for_quotation': frm.doc.name}) }, __("Supplier Quotation"));
|
||||||
|
|
||||||
frm.add_custom_button(__("Send Supplier Emails"), function() {
|
frm.add_custom_button(__("Send Supplier Emails"), function() {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(doc) {
|
refresh: function(doc) {
|
||||||
|
var me = this;
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
if(doc.docstatus==0) {
|
if(doc.docstatus==0) {
|
||||||
@@ -75,6 +76,19 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
|||||||
cur_frm.add_custom_button(__("Production Order"),
|
cur_frm.add_custom_button(__("Production Order"),
|
||||||
this.raise_production_orders, __("Make"));
|
this.raise_production_orders, __("Make"));
|
||||||
|
|
||||||
|
// show
|
||||||
|
|
||||||
|
if(doc.material_request_type === "Purchase" && doc.docstatus==1) {
|
||||||
|
me.frm.add_custom_button(__("Request for Quotation"),
|
||||||
|
function() { frappe.set_route('List', 'Request for Quotation',
|
||||||
|
{'material_request': doc.name})}, __("Show"));
|
||||||
|
|
||||||
|
me.frm.add_custom_button(__("Supplier Quotation"),
|
||||||
|
function() { frappe.set_route('List', 'Supplier Quotation',
|
||||||
|
{'material_request': doc.name})}, __("Show"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||||
|
|
||||||
// stop
|
// stop
|
||||||
|
|||||||
@@ -1,7 +1,34 @@
|
|||||||
{% extends "templates/web.html" %}
|
{% extends "templates/web.html" %}
|
||||||
|
|
||||||
{% block script %}
|
{% block script %}
|
||||||
<script>{% include "templates/includes/start.js" %}</script>
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#login_btn").click(function() {
|
||||||
|
var me = this;
|
||||||
|
$(this).html("Logging In...").prop("disabled", true);
|
||||||
|
frappe.call({
|
||||||
|
"method": "login",
|
||||||
|
args: {
|
||||||
|
usr: "demo@erpnext.com",
|
||||||
|
pwd: "demo",
|
||||||
|
lead_email: $("#lead-email").val(),
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
$(me).prop("disabled", false);
|
||||||
|
if(r.exc) {
|
||||||
|
alert("Error, please contact support@erpnext.com");
|
||||||
|
} else {
|
||||||
|
console.log("Logged In");
|
||||||
|
window.location.href = "desk";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
.prop("disabled", false);
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block style %}
|
{% block style %}
|
||||||
|
|||||||
Reference in New Issue
Block a user