fix: Add missing set warehouse fields

This commit is contained in:
Deepesh Garg
2020-12-25 23:47:22 +05:30
parent dac19cbca5
commit a9f4508cd1
9 changed files with 74 additions and 57 deletions

View File

@@ -57,8 +57,8 @@
"set_warehouse",
"rejected_warehouse",
"col_break_warehouse",
"set_from_warehouse",
"is_subcontracted",
"supplier_warehouse",
"items_section",
"update_stock",
"scan_barcode",
@@ -515,6 +515,7 @@
},
{
"depends_on": "update_stock",
"description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Accepted Warehouse",
@@ -543,17 +544,6 @@
"options": "No\nYes",
"print_hide": 1
},
{
"depends_on": "eval:doc.is_subcontracted==\"Yes\"",
"fieldname": "supplier_warehouse",
"fieldtype": "Link",
"label": "Supplier Warehouse",
"no_copy": 1,
"options": "Warehouse",
"print_hide": 1,
"print_width": "50px",
"width": "50px"
},
{
"fieldname": "items_section",
"fieldtype": "Section Break",
@@ -1356,13 +1346,25 @@
"fieldtype": "Link",
"label": "Represents Company",
"options": "Company"
},
{
"depends_on": "eval:doc.update_stock && (doc.is_subcontracted==\"Yes\" || doc.is_internal_supplier)",
"description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
"no_copy": 1,
"options": "Warehouse",
"print_hide": 1,
"print_width": "50px",
"width": "50px"
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2020-12-11 12:46:12.796378",
"modified": "2020-12-25 23:44:48.551116",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -47,7 +47,6 @@
"column_break_25",
"base_net_rate",
"base_net_amount",
"outgoing_rate",
"valuation_rate",
"item_tax_amount",
"landed_cost_voucher_amount",
@@ -765,7 +764,7 @@
"fieldname": "from_warehouse",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Supplier Warehouse",
"label": "From Warehouse",
"options": "Warehouse"
},
{
@@ -783,12 +782,6 @@
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "outgoing_rate",
"fieldtype": "Currency",
"label": "Outgoing Rate",
"read_only": 1
},
{
"fieldname": "sales_invoice_item",
"fieldtype": "Data",
@@ -801,7 +794,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2020-12-24 12:09:53.611463",
"modified": "2020-12-25 23:43:57.272553",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -60,6 +60,8 @@
"ignore_pricing_rule",
"sec_warehouse",
"set_warehouse",
"column_break_55",
"set_target_warehouse",
"items_section",
"update_stock",
"scan_barcode",
@@ -1969,13 +1971,24 @@
"label": "Represents Company",
"options": "Company",
"read_only": 1
},
{
"fieldname": "column_break_55",
"fieldtype": "Column Break"
},
{
"depends_on": "eval: doc.is_internal_customer && doc.update_stock",
"fieldname": "set_target_warehouse",
"fieldtype": "Link",
"label": "Set Target Warehouse",
"options": "Warehouse"
}
],
"icon": "fa fa-file-text",
"idx": 181,
"is_submittable": 1,
"links": [],
"modified": "2020-12-11 12:48:31.769958",
"modified": "2020-12-25 22:57:32.555067",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -569,7 +569,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 1,
"label": "Customer Warehouse (Optional)",
"label": "Target Warehouse",
"no_copy": 1,
"options": "Warehouse",
"print_hide": 1
@@ -815,7 +815,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2020-09-23 19:59:04.879322",
"modified": "2020-12-25 22:46:26.778091",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -110,6 +110,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
}
erpnext.accounts.dimensions.copy_dimension_from_first_row(frm, cdt, cdn, 'items');
if(!item.target_warehouse && frm.doc.set_target_warehouse) {
item.target_warehouse = frm.doc.set_target_warehouse;
}
if(!item.from_warehouse && frm.doc.set_from_warehouse) {
item.from_warehouse = frm.doc.set_from_warehouse;
}
}
});
@@ -1960,6 +1968,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
this.autofill_warehouse(this.frm.doc.items, "warehouse", this.frm.doc.set_warehouse);
},
set_target_warehouse: function() {
this.autofill_warehouse(this.frm.doc.items, "target_warehouse", this.frm.doc.set_target_warehouse);
},
set_from_warehouse: function() {
this.autofill_warehouse(this.frm.doc.items, "from_warehouse", this.frm.doc.set_from_warehouse);
},
autofill_warehouse : function (child_table, warehouse_field, warehouse) {
if (warehouse && child_table && child_table.length) {
let doctype = child_table[0].doctype;

View File

@@ -297,15 +297,6 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
}
})
},
to_warehouse: function() {
let packed_items_table = this.frm.doc["packed_items"];
this.autofill_warehouse(this.frm.doc["items"], "target_warehouse", this.frm.doc.to_warehouse);
if (packed_items_table && packed_items_table.length) {
this.autofill_warehouse(packed_items_table, "target_warehouse", this.frm.doc.to_warehouse);
}
}
});
$.extend(cur_frm.cscript, new erpnext.stock.DeliveryNoteController({frm: cur_frm}));

View File

@@ -53,7 +53,7 @@
"sec_warehouse",
"set_warehouse",
"col_break_warehouse",
"to_warehouse",
"set_target_warehouse",
"items_section",
"scan_barcode",
"items",
@@ -502,18 +502,6 @@
"fieldname": "col_break_warehouse",
"fieldtype": "Column Break"
},
{
"description": "Required only for sample item.",
"fieldname": "to_warehouse",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "To Warehouse",
"no_copy": 1,
"oldfieldname": "to_warehouse",
"oldfieldtype": "Link",
"options": "Warehouse",
"print_hide": 1
},
{
"fieldname": "items_section",
"fieldtype": "Section Break",
@@ -1261,13 +1249,25 @@
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"depends_on": "eval: doc.is_internal_customer",
"fieldname": "set_target_warehouse",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Set Target Warehouse",
"no_copy": 1,
"oldfieldname": "to_warehouse",
"oldfieldtype": "Link",
"options": "Warehouse",
"print_hide": 1
}
],
"icon": "fa fa-truck",
"idx": 146,
"is_submittable": 1,
"links": [],
"modified": "2020-11-30 12:54:45.407289",
"modified": "2020-12-25 23:11:46.584226",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",

View File

@@ -47,6 +47,7 @@
"set_warehouse",
"rejected_warehouse",
"col_break_warehouse",
"set_from_warehouse",
"is_subcontracted",
"supplier_warehouse",
"items_section",
@@ -1114,13 +1115,21 @@
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"depends_on": "eval: doc.is_internal_supplier",
"description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
"options": "Warehouse"
}
],
"icon": "fa fa-truck",
"idx": 261,
"is_submittable": 1,
"links": [],
"modified": "2020-11-30 12:54:23.278500",
"modified": "2020-12-25 23:15:01.451518",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",

View File

@@ -56,7 +56,6 @@
"column_break_32",
"base_net_rate",
"base_net_amount",
"outgoing_rate",
"valuation_rate",
"item_tax_amount",
"rm_supp_cost",
@@ -864,12 +863,6 @@
"label": "Received Qty in Stock UOM",
"print_hide": 1
},
{
"fieldname": "outgoing_rate",
"fieldtype": "Currency",
"label": "Outgoing Rate",
"read_only": 1
},
{
"fieldname": "delivery_note_item",
"fieldtype": "Data",
@@ -882,7 +875,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2020-12-24 12:10:46.943722",
"modified": "2020-12-25 22:33:12.057271",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",