fix: Display Packed/Bundle Items table only if it exists

This commit is contained in:
GangaManoj 2021-08-27 20:16:13 +05:30
parent a2b394b195
commit e44567754d
7 changed files with 22 additions and 19 deletions

View File

@ -622,6 +622,7 @@
"read_only": 1
},
{
"depends_on": "packed_items",
"fieldname": "packing_list",
"fieldtype": "Section Break",
"label": "Packing List",
@ -629,6 +630,7 @@
"print_hide": 1
},
{
"depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Packed Items",
@ -1564,7 +1566,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2021-08-24 18:19:20.728433",
"modified": "2021-08-27 20:12:57.306772",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@ -247,7 +247,7 @@
"depends_on": "customer",
"fetch_from": "customer.customer_name",
"fieldname": "customer_name",
"fieldtype": "Small Text",
"fieldtype": "Data",
"hide_days": 1,
"hide_seconds": 1,
"in_global_search": 1,
@ -695,7 +695,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Scan Barcode",
"length": 1,
"options": "Barcode"
},
{
@ -727,6 +726,7 @@
"read_only": 1
},
{
"depends_on": "packed_items",
"fieldname": "packing_list",
"fieldtype": "Section Break",
"hide_days": 1,
@ -736,6 +736,7 @@
"print_hide": 1
},
{
"depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"hide_days": 1,
@ -1060,7 +1061,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Apply Additional Discount On",
"length": 15,
"options": "\nGrand Total\nNet Total",
"print_hide": 1
},
@ -1147,7 +1147,7 @@
{
"description": "In Words will be visible once you save the Sales Invoice.",
"fieldname": "base_in_words",
"fieldtype": "Small Text",
"fieldtype": "Data",
"hide_days": 1,
"hide_seconds": 1,
"label": "In Words (Company Currency)",
@ -1207,7 +1207,7 @@
},
{
"fieldname": "in_words",
"fieldtype": "Small Text",
"fieldtype": "Data",
"hide_days": 1,
"hide_seconds": 1,
"label": "In Words",
@ -1560,7 +1560,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Print Language",
"length": 6,
"print_hide": 1,
"read_only": 1
},
@ -1648,7 +1647,6 @@
"hide_seconds": 1,
"in_standard_filter": 1,
"label": "Status",
"length": 30,
"no_copy": 1,
"options": "\nDraft\nReturn\nCredit Note Issued\nSubmitted\nPaid\nUnpaid\nUnpaid and Discounted\nOverdue and Discounted\nOverdue\nCancelled\nInternal Transfer",
"print_hide": 1,
@ -1708,7 +1706,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Is Opening Entry",
"length": 4,
"oldfieldname": "is_opening",
"oldfieldtype": "Select",
"options": "No\nYes",
@ -1720,7 +1717,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "C-Form Applicable",
"length": 4,
"no_copy": 1,
"options": "No\nYes",
"print_hide": 1
@ -2021,7 +2017,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2021-08-25 14:46:05.279588",
"modified": "2021-08-27 20:13:40.456462",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@ -1141,6 +1141,7 @@
"options": "Tax Withholding Category"
},
{
"depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Bundle Items",
@ -1150,6 +1151,7 @@
{
"collapsible": 1,
"collapsible_depends_on": "packed_items",
"depends_on": "packed_items",
"fieldname": "bundle_items_section",
"fieldtype": "Section Break",
"label": "Bundle Items",
@ -1161,7 +1163,7 @@
"idx": 105,
"is_submittable": 1,
"links": [],
"modified": "2021-08-27 20:05:54.869308",
"modified": "2021-08-27 20:11:23.509147",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",

View File

@ -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",

View File

@ -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",

View File

@ -90,10 +90,7 @@ erpnext.selling.SellingController = class SellingController extends erpnext.Tran
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();
}

View File

@ -543,6 +543,7 @@
{
"collapsible": 1,
"collapsible_depends_on": "packed_items",
"depends_on": "packed_items",
"fieldname": "packing_list",
"fieldtype": "Section Break",
"label": "Packing List",
@ -551,6 +552,7 @@
"print_hide": 1
},
{
"depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Packed Items",
@ -1306,7 +1308,7 @@
"idx": 146,
"is_submittable": 1,
"links": [],
"modified": "2021-08-17 20:15:50.574966",
"modified": "2021-08-27 20:14:40.215231",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",