[fix] buttons for rfq and material request
This commit is contained in:
parent
dc8067eb33
commit
5f5f0bec2c
@ -21,7 +21,7 @@ frappe.ui.form.on("Request for Quotation",{
|
||||
{fieldname: 'schedule_date', columns: 2},
|
||||
{fieldname: 'warehouse', columns: 3},
|
||||
];
|
||||
|
||||
|
||||
frm.get_field('suppliers').grid.editable_fields = [
|
||||
{fieldname: 'supplier', columns: 4},
|
||||
{fieldname: 'contact', columns: 3},
|
||||
@ -39,8 +39,12 @@ frappe.ui.form.on("Request for Quotation",{
|
||||
|
||||
refresh: function(frm, cdt, cdn) {
|
||||
if (frm.doc.docstatus === 1) {
|
||||
frm.add_custom_button(__("Make Supplier Quotation"),
|
||||
function(){ frm.trigger("make_suppplier_quotation") });
|
||||
frm.add_custom_button(__("Make"),
|
||||
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() {
|
||||
frappe.call({
|
||||
|
@ -40,6 +40,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
var me = this;
|
||||
this._super();
|
||||
|
||||
if(doc.docstatus==0) {
|
||||
@ -75,6 +76,19 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
||||
cur_frm.add_custom_button(__("Production Order"),
|
||||
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"));
|
||||
|
||||
// stop
|
||||
|
@ -1,7 +1,34 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% block style %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user