Merge pull request #17635 from nabinhait/add-multiple-items-dev

feat: Added 'Add Multiple' options in all sales / purchase transactions
This commit is contained in:
Rushabh Mehta 2019-05-16 14:57:03 +05:30 committed by GitHub
commit a02ab2d3d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 12 deletions

View File

@ -21,6 +21,17 @@ frappe.ui.form.on("Opportunity", {
frm.trigger('set_contact_link');
},
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
party_name: function(frm) {
if (frm.doc.opportunity_from == "Customer") {
frm.trigger('set_contact_link');
erpnext.utils.get_party_details(frm);
}
},
with_items: function(frm) {
frm.trigger('toggle_mandatory');
},
@ -180,4 +191,3 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) {
frm: cur_frm
});
}

View File

@ -31,5 +31,9 @@ frappe.ui.form.on('Blanket Order', {
});
}).addClass("btn-primary");
}
},
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
}
});

View File

@ -267,6 +267,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
}
if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) {
this.setup_item_selector();
this.frm.get_field("items").grid.set_multiple_add("item_code", "qty");
}
},

View File

@ -79,10 +79,6 @@ frappe.ui.form.on("Sales Order", {
if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date;
});
refresh_field("items");
},
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
}
});

View File

@ -38,6 +38,10 @@ frappe.ui.form.on('Material Request', {
};
},
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
refresh: function(frm) {
frm.events.make_custom_buttons(frm);
frm.toggle_reqd('customer', frm.doc.material_request_type=="Customer Provided");

View File

@ -26,10 +26,6 @@ frappe.ui.form.on("Purchase Receipt", {
});
},
onload_post_render: function(frm) {
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
refresh: function(frm) {
if(frm.doc.company) {
frm.trigger("toggle_display_account_head");

View File

@ -639,9 +639,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
}
});
// if(!this.item_selector && false) {
// this.item_selector = new erpnext.ItemSelector({frm: this.frm});
// }
this.frm.get_field("items").grid.set_multiple_add("item_code", "qty");
},
refresh: function() {