Merge pull request #1744 from rmehta/develop

added multiple item select and allow non purchase items in Material Requ...
This commit is contained in:
Anand Doshi 2014-06-04 17:47:58 +05:30
commit ffc28faa51
6 changed files with 20 additions and 2 deletions

View File

@ -9,6 +9,10 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
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);

View File

@ -94,8 +94,9 @@ class PurchaseCommon(BuyingController):
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,

View File

@ -41,6 +41,9 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
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() {

View File

@ -13,6 +13,10 @@ cur_frm.cscript.sales_team_fname = "sales_team";
{% 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 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
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);

View File

@ -21,6 +21,10 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
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;

View File

@ -56,6 +56,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
},
onload_post_render: function() {
cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
this.set_default_account();
},