added multiple item select and allow non purchase items in Material Request of type transfer
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index bc0108e..ccd5ace 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -9,6 +9,10 @@
this.setup_queries();
},
+ onload_post_render: function() {
+ cur_frm.get_field("entries").grid.set_multiple_add("account");
+ },
+
load_defaults: function() {
if(this.frm.doc.__islocal && this.frm.doc.company) {
frappe.model.set_default_values(this.frm.doc);
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index 94e8ea3..68a6e93 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -94,8 +94,9 @@
frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
# validate purchase item
- if item[0][1] != 'Yes' and item[0][2] != 'Yes':
- frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
+ if not (obj.doctype=="Material Request" and getattr(obj, "material_request_type", None)=="Transfer"):
+ if item[0][1] != 'Yes' and item[0][2] != 'Yes':
+ frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
# list criteria that should not repeat if item is stock item
e = [getattr(d, "schedule_date", None), d.item_code, d.description, d.warehouse, d.uom,
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 6d30ef0..c086aed 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -41,6 +41,9 @@
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.is_pos) {
this.calculate_taxes_and_totals();
}
+ if(frappe.meta.get_docfield(this.tname, "item_code")) {
+ cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
+ }
},
refresh: function() {
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index ee14092..fa63975 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -13,6 +13,10 @@
{% include 'utilities/doctype/sms_control/sms_control.js' %}
{% include 'accounts/doctype/sales_invoice/pos.js' %}
+frappe.ui.form.on("Quotation", "onload_post_render", function(frm) {
+ frm.get_field("quotation_details").grid.set_multiple_add("item_code");
+});
+
erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
onload: function(doc, dt, dn) {
var me = this;
@@ -21,6 +25,7 @@
doc.quotation_to = "Customer";
else if(doc.lead && !doc.quotation_to)
doc.quotation_to = "Lead";
+
},
refresh: function(doc, dt, dn) {
this._super(doc, dt, dn);
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 260fbe5..1cc643e 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -21,6 +21,10 @@
this.toggle_editable_price_list_rate();
},
+ onload_post_render: function() {
+ cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
+ },
+
setup_queries: function() {
var me = this;
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 840c55d..553b25c 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -56,6 +56,7 @@
},
onload_post_render: function() {
+ cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
this.set_default_account();
},