enhancement`: Added Set Reserve Warehouse field in Purchase Order. (#19991)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-05-21 16:16:39",
|
"creation": "2013-05-21 16:16:39",
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
"ignore_pricing_rule",
|
"ignore_pricing_rule",
|
||||||
"sec_warehouse",
|
"sec_warehouse",
|
||||||
"set_warehouse",
|
"set_warehouse",
|
||||||
|
"set_reserve_warehouse",
|
||||||
"col_break_warehouse",
|
"col_break_warehouse",
|
||||||
"is_subcontracted",
|
"is_subcontracted",
|
||||||
"supplier_warehouse",
|
"supplier_warehouse",
|
||||||
@@ -1039,12 +1041,20 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Tax Category",
|
"label": "Tax Category",
|
||||||
"options": "Tax Category"
|
"options": "Tax Category"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "supplied_items",
|
||||||
|
"fieldname": "set_reserve_warehouse",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Set Reserve Warehouse",
|
||||||
|
"options": "Warehouse"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 105,
|
"idx": 105,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2019-07-11 18:25:49.509343",
|
"links": [],
|
||||||
|
"modified": "2019-12-18 13:13:22.852412",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Purchase Order",
|
"name": "Purchase Order",
|
||||||
|
|||||||
@@ -1775,14 +1775,28 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_reserve_warehouse: function() {
|
||||||
|
this.autofill_warehouse("reserve_warehouse");
|
||||||
|
},
|
||||||
|
|
||||||
set_warehouse: function() {
|
set_warehouse: function() {
|
||||||
|
this.autofill_warehouse("warehouse");
|
||||||
|
},
|
||||||
|
|
||||||
|
autofill_warehouse : function (warehouse_field) {
|
||||||
|
// set warehouse in all child table rows
|
||||||
var me = this;
|
var me = this;
|
||||||
if(this.frm.doc.set_warehouse) {
|
let warehouse = (warehouse_field === "warehouse") ? me.frm.doc.set_warehouse : me.frm.doc.set_reserve_warehouse;
|
||||||
$.each(this.frm.doc.items || [], function(i, item) {
|
let child_table = (warehouse_field === "warehouse") ? me.frm.doc.items : me.frm.doc.supplied_items;
|
||||||
frappe.model.set_value(me.frm.doctype + " Item", item.name, "warehouse", me.frm.doc.set_warehouse);
|
let doctype = (warehouse_field === "warehouse") ? (me.frm.doctype + " Item") : (me.frm.doctype + " Item Supplied");
|
||||||
|
|
||||||
|
if(warehouse) {
|
||||||
|
$.each(child_table || [], function(i, item) {
|
||||||
|
frappe.model.set_value(doctype, item.name, warehouse_field, warehouse);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
coupon_code: function() {
|
coupon_code: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
frappe.run_serially([
|
frappe.run_serially([
|
||||||
|
|||||||
Reference in New Issue
Block a user