fix: Display Packed/Bundle Items table only if it exists
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 7185bb9..43a4490 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -930,6 +930,7 @@
"read_only": 1
},
{
+ "depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Bundle Items",
@@ -939,6 +940,7 @@
{
"collapsible": 1,
"collapsible_depends_on": "packed_items",
+ "depends_on": "packed_items",
"fieldname": "bundle_items_section",
"fieldtype": "Section Break",
"label": "Bundle Items",
@@ -951,7 +953,7 @@
"is_submittable": 1,
"links": [],
"max_attachments": 1,
- "modified": "2021-08-27 20:04:26.357378",
+ "modified": "2021-08-27 20:10:07.864951",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 6c4a403..212bbde 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1019,6 +1019,7 @@
{
"collapsible": 1,
"collapsible_depends_on": "packed_items",
+ "depends_on": "packed_items",
"fieldname": "packing_list",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1029,6 +1030,7 @@
"print_hide": 1
},
{
+ "depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"hide_days": 1,
@@ -1511,7 +1513,7 @@
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2021-08-27 02:45:54.968867",
+ "modified": "2021-08-27 20:11:57.748736",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 2de57c8..e440f33 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -90,10 +90,7 @@
this.frm.toggle_display("customer_name",
(this.frm.doc.customer_name && this.frm.doc.customer_name!==this.frm.doc.customer));
- if(this.frm.fields_dict.packed_items) {
- var packing_list_exists = (this.frm.doc.packed_items || []).length;
- this.frm.toggle_display("packing_list", packing_list_exists ? true : false);
- }
+
this.toggle_editable_price_list_rate();
}