[minor] material request and newsletter list

This commit is contained in:
Rushabh Mehta 2015-03-23 14:18:01 +05:30
parent da5cfb1630
commit fea22de3e8
3 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,5 @@
frappe.listview_settings['Newsletter'] = {
add_fields: ["subject", "send_to_type", "email_sent"],
add_fields: ["subject", "email_sent"],
get_indicator: function(doc) {
if(doc.email_sent) {
return [__("Sent"), "green", "email_sent,=,Yes"];

View File

@ -75,7 +75,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-03-18 08:07:24.748431",
"modified": "2015-03-23 04:47:36.505462",
"modified_by": "Administrator",
"module": "CRM",
"name": "Newsletter List Subscriber",
@ -105,5 +105,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"title_field": "email"
}

View File

@ -5,6 +5,16 @@
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on("Material Request Item", {
"qty": function(frm, doctype, name) {
var d = locals[doctype][name];
if (flt(d.qty) < flt(d.min_order_qty)) {
alert(__("Warning: Material Requested Qty is less than Minimum Order Qty"));
}
}
}
);
erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({
onload: function(doc) {
this._super();
@ -53,7 +63,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
cur_frm.add_custom_button(__('Stop'),
cur_frm.cscript['Stop Material Request'], "icon-exclamation", "btn-default");
}
}
@ -163,12 +173,6 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
// for backward compatibility: combine new and previous states
$.extend(cur_frm.cscript, new erpnext.buying.MaterialRequestController({frm: cur_frm}));
cur_frm.cscript.qty = function(cdt, cdn) {
var d = locals[cdt][cdn];
if (flt(d.qty) < flt(d.min_order_qty))
alert(__("Warning: Material Requested Qty is less than Minimum Order Qty"));
};
cur_frm.cscript['Stop Material Request'] = function() {
var doc = cur_frm.doc;
var check = confirm(__("Do you really want to STOP this Material Request?"));