[DN][usability] copy cost center in each row
This commit is contained in:
parent
205f7ce620
commit
04c1f94b4e
@ -47,7 +47,7 @@ class BuyingController(StockController):
|
||||
items = [d.item_code for d in self.doclist.get({"parentfield": self.fname})]
|
||||
if self.stock_items and len(items) > len(self.stock_items):
|
||||
nonstock_items = list(set(items) - set(self.stock_items))
|
||||
webnotes.msgprint(_("Stock and non-stock items can not be entered at the same ") +
|
||||
webnotes.msgprint(_("Stock and non-stock items can not be entered in the same ") +
|
||||
self.doc.doctype + _(""". You should make separate documents for them.
|
||||
Stock Items: """) + ", ".join(self.stock_items) + _("""
|
||||
Non-stock Items: """) + ", ".join(nonstock_items), raise_exception=1)
|
||||
|
@ -326,6 +326,17 @@ if (sys_defaults.auto_inventory_accounting) {
|
||||
}
|
||||
|
||||
// cost center
|
||||
cur_frm.cscript.cost_center = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.cost_center) {
|
||||
var cl = getchildren('Delivery Note Item', doc.name, cur_frm.cscript.fname, doc.doctype);
|
||||
for(var i = 0; i < cl.length; i++){
|
||||
if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
|
||||
}
|
||||
}
|
||||
refresh_field(cur_frm.cscript.fname);
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.delivery_note_details.grid.get_field("cost_center").get_query = function(doc) {
|
||||
return {
|
||||
query: "accounts.utils.get_cost_center_list",
|
||||
|
Loading…
Reference in New Issue
Block a user