fix: Taxes and charges table not clear the existing rows if the template is changed
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 151be53..ffc5a1d 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -22,6 +22,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "customer_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -55,6 +56,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "{customer_name}",
+   "fetch_if_empty": 0,
    "fieldname": "title",
    "fieldtype": "Data",
    "hidden": 1,
@@ -88,6 +90,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "",
+   "fetch_if_empty": 0,
    "fieldname": "naming_series",
    "fieldtype": "Select",
    "hidden": 0,
@@ -122,6 +125,7 @@
    "bold": 1,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "customer",
    "fieldtype": "Link",
    "hidden": 0,
@@ -158,6 +162,7 @@
    "columns": 0,
    "depends_on": "customer",
    "fetch_from": "customer.customer_name",
+   "fetch_if_empty": 0,
    "fieldname": "customer_name",
    "fieldtype": "Data",
    "hidden": 0,
@@ -192,6 +197,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "tax_id",
    "fieldtype": "Data",
    "hidden": 0,
@@ -224,6 +230,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "project",
    "fieldtype": "Link",
    "hidden": 0,
@@ -258,6 +265,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "is_pos",
    "fieldtype": "Check",
    "hidden": 0,
@@ -292,6 +300,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "pos_profile",
    "fieldtype": "Link",
    "hidden": 0,
@@ -325,6 +334,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "offline_pos_name",
    "fieldtype": "Data",
    "hidden": 1,
@@ -358,6 +368,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "is_return",
    "fieldtype": "Check",
    "hidden": 0,
@@ -390,6 +401,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break1",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -421,6 +433,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "company",
    "fieldtype": "Link",
    "hidden": 0,
@@ -455,6 +468,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "cost_center",
    "fieldtype": "Link",
    "hidden": 0,
@@ -489,6 +503,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "Today",
+   "fetch_if_empty": 0,
    "fieldname": "posting_date",
    "fieldtype": "Date",
    "hidden": 0,
@@ -522,6 +537,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "posting_time",
    "fieldtype": "Time",
    "hidden": 0,
@@ -556,6 +572,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval:doc.docstatus==0",
+   "fetch_if_empty": 0,
    "fieldname": "set_posting_time",
    "fieldtype": "Check",
    "hidden": 0,
@@ -588,6 +605,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "due_date",
    "fieldtype": "Date",
    "hidden": 0,
@@ -621,6 +639,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "amended_from",
    "fieldtype": "Link",
    "hidden": 0,
@@ -656,6 +675,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "return_against",
+   "fetch_if_empty": 0,
    "fieldname": "returns",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -689,6 +709,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "return_against",
+   "fetch_if_empty": 0,
    "fieldname": "return_against",
    "fieldtype": "Link",
    "hidden": 0,
@@ -722,6 +743,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_21",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -754,6 +776,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval: doc.is_return && doc.return_against",
+   "fetch_if_empty": 0,
    "fieldname": "update_billed_amount_in_sales_order",
    "fieldtype": "Check",
    "hidden": 0,
@@ -787,6 +810,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "po_no",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "customer_po_details",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -819,6 +843,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "po_no",
    "fieldtype": "Data",
    "hidden": 0,
@@ -851,6 +876,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_23",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -882,6 +908,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "po_date",
    "fieldtype": "Date",
    "hidden": 0,
@@ -915,6 +942,7 @@
    "collapsible": 1,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "address_and_contact",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -947,6 +975,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "customer_address",
    "fieldtype": "Link",
    "hidden": 0,
@@ -979,6 +1008,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "address_display",
    "fieldtype": "Small Text",
    "hidden": 0,
@@ -1010,6 +1040,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "contact_person",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1042,6 +1073,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "contact_display",
    "fieldtype": "Small Text",
    "hidden": 0,
@@ -1073,6 +1105,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "contact_mobile",
    "fieldtype": "Small Text",
    "hidden": 1,
@@ -1104,6 +1137,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "contact_email",
    "fieldtype": "Data",
    "hidden": 1,
@@ -1136,6 +1170,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "territory",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1169,6 +1204,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "col_break4",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -1200,6 +1236,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "shipping_address_name",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1233,6 +1270,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "shipping_address",
    "fieldtype": "Small Text",
    "hidden": 0,
@@ -1265,6 +1303,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "company_address",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1298,6 +1337,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "company_address_display",
    "fieldtype": "Small Text",
    "hidden": 1,
@@ -1331,6 +1371,7 @@
    "collapsible": 1,
    "columns": 0,
    "depends_on": "customer",
+   "fetch_if_empty": 0,
    "fieldname": "currency_and_price_list",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1363,6 +1404,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "currency",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1398,6 +1440,7 @@
    "collapsible": 0,
    "columns": 0,
    "description": "Rate at which Customer Currency is converted to customer's base currency",
+   "fetch_if_empty": 0,
    "fieldname": "conversion_rate",
    "fieldtype": "Float",
    "hidden": 0,
@@ -1432,6 +1475,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break2",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -1463,6 +1507,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "selling_price_list",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1497,6 +1542,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "price_list_currency",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1530,6 +1576,7 @@
    "collapsible": 0,
    "columns": 0,
    "description": "Rate at which Price list currency is converted to customer's base currency",
+   "fetch_if_empty": 0,
    "fieldname": "plc_conversion_rate",
    "fieldtype": "Float",
    "hidden": 0,
@@ -1562,6 +1609,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "ignore_pricing_rule",
    "fieldtype": "Check",
    "hidden": 0,
@@ -1593,6 +1641,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "sec_warehouse",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1625,6 +1674,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "update_stock",
+   "fetch_if_empty": 0,
    "fieldname": "set_warehouse",
    "fieldtype": "Link",
    "hidden": 0,
@@ -1658,6 +1708,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "items_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1691,6 +1742,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "update_stock",
    "fieldtype": "Check",
    "hidden": 0,
@@ -1724,6 +1776,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "scan_barcode",
    "fieldtype": "Data",
    "hidden": 0,
@@ -1756,6 +1809,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "items",
    "fieldtype": "Table",
    "hidden": 0,
@@ -1790,6 +1844,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "pricing_rule_details",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1822,6 +1877,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "pricing_rules",
    "fieldtype": "Table",
    "hidden": 0,
@@ -1855,6 +1911,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "packing_list",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1887,6 +1944,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "packed_items",
    "fieldtype": "Table",
    "hidden": 0,
@@ -1919,6 +1977,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "product_bundle_help",
    "fieldtype": "HTML",
    "hidden": 0,
@@ -1952,6 +2011,7 @@
    "collapsible_depends_on": "eval:doc.total_billing_amount > 0",
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "time_sheet_list",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -1984,6 +2044,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "timesheets",
    "fieldtype": "Table",
    "hidden": 0,
@@ -2018,6 +2079,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "0",
+   "fetch_if_empty": 0,
    "fieldname": "total_billing_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2050,6 +2112,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break_30",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -2080,6 +2143,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total_qty",
    "fieldtype": "Float",
    "hidden": 0,
@@ -2112,6 +2176,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2145,6 +2210,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_net_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2179,6 +2245,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_32",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -2209,6 +2276,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2242,6 +2310,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "net_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2274,6 +2343,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total_net_weight",
    "fieldtype": "Float",
    "hidden": 0,
@@ -2306,6 +2376,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "taxes_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -2339,132 +2410,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
-   "fieldname": "tax_category",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Tax Category",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Tax Category",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0
-  },
-  {
-   "allow_bulk_edit": 0,
-   "allow_in_quick_entry": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break_38",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0
-  },
-  {
-   "allow_bulk_edit": 0,
-   "allow_in_quick_entry": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "shipping_rule",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Shipping Rule",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Button",
-   "options": "Shipping Rule",
-   "permlevel": 0,
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0
-  },
-  {
-   "allow_bulk_edit": 0,
-   "allow_in_quick_entry": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "section_break_40",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "translatable": 0,
-   "unique": 0
-  },
-  {
-   "allow_bulk_edit": 0,
-   "allow_in_quick_entry": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "taxes_and_charges",
    "fieldtype": "Link",
    "hidden": 0,
@@ -2499,6 +2445,137 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
+   "fieldname": "column_break_38",
+   "fieldtype": "Column Break",
+   "hidden": 0,
+   "ignore_user_permissions": 0,
+   "ignore_xss_filter": 0,
+   "in_filter": 0,
+   "in_global_search": 0,
+   "in_list_view": 0,
+   "in_standard_filter": 0,
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "translatable": 0,
+   "unique": 0
+  },
+  {
+   "allow_bulk_edit": 0,
+   "allow_in_quick_entry": 0,
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fetch_if_empty": 0,
+   "fieldname": "shipping_rule",
+   "fieldtype": "Link",
+   "hidden": 0,
+   "ignore_user_permissions": 0,
+   "ignore_xss_filter": 0,
+   "in_filter": 0,
+   "in_global_search": 0,
+   "in_list_view": 0,
+   "in_standard_filter": 0,
+   "label": "Shipping Rule",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldtype": "Button",
+   "options": "Shipping Rule",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "translatable": 0,
+   "unique": 0
+  },
+  {
+   "allow_bulk_edit": 0,
+   "allow_in_quick_entry": 0,
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fetch_if_empty": 0,
+   "fieldname": "tax_category",
+   "fieldtype": "Link",
+   "hidden": 0,
+   "ignore_user_permissions": 0,
+   "ignore_xss_filter": 0,
+   "in_filter": 0,
+   "in_global_search": 0,
+   "in_list_view": 0,
+   "in_standard_filter": 0,
+   "label": "Tax Category",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Tax Category",
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "translatable": 0,
+   "unique": 0
+  },
+  {
+   "allow_bulk_edit": 0,
+   "allow_in_quick_entry": 0,
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fetch_if_empty": 0,
+   "fieldname": "section_break_40",
+   "fieldtype": "Section Break",
+   "hidden": 0,
+   "ignore_user_permissions": 0,
+   "ignore_xss_filter": 0,
+   "in_filter": 0,
+   "in_global_search": 0,
+   "in_list_view": 0,
+   "in_standard_filter": 0,
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "translatable": 0,
+   "unique": 0
+  },
+  {
+   "allow_bulk_edit": 0,
+   "allow_in_quick_entry": 0,
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "taxes",
    "fieldtype": "Table",
    "hidden": 0,
@@ -2533,6 +2610,7 @@
    "bold": 0,
    "collapsible": 1,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "sec_tax_breakup",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -2565,6 +2643,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "other_charges_calculation",
    "fieldtype": "Text",
    "hidden": 0,
@@ -2597,6 +2676,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break_43",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -2627,6 +2707,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_total_taxes_and_charges",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2661,6 +2742,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_47",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -2692,6 +2774,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total_taxes_and_charges",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2726,6 +2809,7 @@
    "collapsible_depends_on": "",
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_points_redemption",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -2759,6 +2843,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "redeem_loyalty_points",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_points",
    "fieldtype": "Int",
    "hidden": 0,
@@ -2792,6 +2877,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "redeem_loyalty_points",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -2825,6 +2911,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "redeem_loyalty_points",
    "fieldtype": "Check",
    "hidden": 0,
@@ -2857,6 +2944,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_77",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -2890,6 +2978,7 @@
    "columns": 0,
    "depends_on": "",
    "fetch_from": "customer.loyalty_program",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_program",
    "fieldtype": "Link",
    "hidden": 0,
@@ -2924,6 +3013,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "redeem_loyalty_points",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_redemption_account",
    "fieldtype": "Link",
    "hidden": 0,
@@ -2958,6 +3048,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "redeem_loyalty_points",
+   "fetch_if_empty": 0,
    "fieldname": "loyalty_redemption_cost_center",
    "fieldtype": "Link",
    "hidden": 0,
@@ -2992,6 +3083,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "discount_amount",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break_49",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3025,6 +3117,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "Grand Total",
+   "fetch_if_empty": 0,
    "fieldname": "apply_discount_on",
    "fieldtype": "Select",
    "hidden": 0,
@@ -3058,6 +3151,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_discount_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3091,6 +3185,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_51",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -3121,6 +3216,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "additional_discount_percentage",
    "fieldtype": "Float",
    "hidden": 0,
@@ -3153,6 +3249,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "discount_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3185,6 +3282,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "totals",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3218,6 +3316,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_grand_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3252,6 +3351,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_rounding_adjustment",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3285,6 +3385,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_rounded_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3320,6 +3421,7 @@
    "collapsible": 0,
    "columns": 0,
    "description": "In Words will be visible once you save the Sales Invoice.",
+   "fetch_if_empty": 0,
    "fieldname": "base_in_words",
    "fieldtype": "Data",
    "hidden": 0,
@@ -3353,6 +3455,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break5",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -3385,6 +3488,7 @@
    "bold": 1,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "grand_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3419,6 +3523,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "rounding_adjustment",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3452,6 +3557,7 @@
    "bold": 1,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "rounded_total",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3486,6 +3592,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "in_words",
    "fieldtype": "Data",
    "hidden": 0,
@@ -3519,6 +3626,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total_advance",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3553,6 +3661,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "outstanding_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3588,6 +3697,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "advances",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "advances_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3621,7 +3731,8 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
-   "default": 1,
+   "default": "1",
+   "fetch_if_empty": 0,
    "fieldname": "allocate_advances_automatically",
    "fieldtype": "Check",
    "hidden": 0,
@@ -3655,6 +3766,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval:!doc.allocate_advances_automatically",
+   "fetch_if_empty": 0,
    "fieldname": "get_advances",
    "fieldtype": "Button",
    "hidden": 0,
@@ -3688,6 +3800,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "advances",
    "fieldtype": "Table",
    "hidden": 0,
@@ -3723,6 +3836,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "payment_schedule_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3756,6 +3870,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval:(!doc.is_pos && !doc.is_return)",
+   "fetch_if_empty": 0,
    "fieldname": "payment_terms_template",
    "fieldtype": "Link",
    "hidden": 0,
@@ -3790,6 +3905,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval:(!doc.is_pos && !doc.is_return)",
+   "fetch_if_empty": 0,
    "fieldname": "payment_schedule",
    "fieldtype": "Table",
    "hidden": 0,
@@ -3825,6 +3941,7 @@
    "collapsible_depends_on": "",
    "columns": 0,
    "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
+   "fetch_if_empty": 0,
    "fieldname": "payments_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3858,6 +3975,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "cash_bank_account",
    "fieldtype": "Link",
    "hidden": 1,
@@ -3893,6 +4011,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval:doc.is_pos===1",
+   "fetch_if_empty": 0,
    "fieldname": "payments",
    "fieldtype": "Table",
    "hidden": 0,
@@ -3926,6 +4045,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break_84",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -3957,6 +4077,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_paid_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -3990,6 +4111,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_86",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -4022,6 +4144,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval: doc.is_pos || doc.redeem_loyalty_points",
+   "fetch_if_empty": 0,
    "fieldname": "paid_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -4056,6 +4179,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break_88",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -4088,6 +4212,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "base_change_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -4121,6 +4246,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_90",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -4153,6 +4279,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "change_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -4187,6 +4314,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "account_for_change_amount",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4222,6 +4350,7 @@
    "collapsible_depends_on": "write_off_amount",
    "columns": 0,
    "depends_on": "grand_total",
+   "fetch_if_empty": 0,
    "fieldname": "column_break4",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -4255,6 +4384,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "write_off_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -4287,6 +4417,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "base_write_off_amount",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -4321,6 +4452,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "is_pos",
+   "fetch_if_empty": 0,
    "fieldname": "write_off_outstanding_amount_automatically",
    "fieldtype": "Check",
    "hidden": 0,
@@ -4353,6 +4485,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "column_break_74",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -4385,6 +4518,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "write_off_account",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4418,6 +4552,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "write_off_cost_center",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4451,6 +4586,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "terms",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "terms_section_break",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -4484,6 +4620,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "tc_name",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4518,6 +4655,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "terms",
    "fieldtype": "Text Editor",
    "hidden": 0,
@@ -4551,6 +4689,7 @@
    "bold": 0,
    "collapsible": 1,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "edit_printing_settings",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -4583,6 +4722,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "letter_head",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4617,6 +4757,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "group_same_items",
    "fieldtype": "Check",
    "hidden": 0,
@@ -4649,6 +4790,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "language",
    "fieldtype": "Data",
    "hidden": 0,
@@ -4681,6 +4823,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_84",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -4712,6 +4855,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "select_print_heading",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4747,6 +4891,7 @@
    "collapsible": 1,
    "columns": 0,
    "depends_on": "customer",
+   "fetch_if_empty": 0,
    "fieldname": "more_information",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -4779,6 +4924,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "inter_company_invoice_reference",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4813,6 +4959,7 @@
    "collapsible": 0,
    "columns": 0,
    "description": "",
+   "fetch_if_empty": 0,
    "fieldname": "customer_group",
    "fieldtype": "Link",
    "hidden": 1,
@@ -4846,6 +4993,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "",
+   "fetch_if_empty": 0,
    "fieldname": "campaign",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4880,6 +5028,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "col_break23",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -4912,6 +5061,7 @@
    "collapsible": 0,
    "columns": 0,
    "default": "Draft",
+   "fetch_if_empty": 0,
    "fieldname": "status",
    "fieldtype": "Select",
    "hidden": 0,
@@ -4945,6 +5095,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "source",
    "fieldtype": "Link",
    "hidden": 0,
@@ -4979,6 +5130,7 @@
    "bold": 0,
    "collapsible": 1,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "more_info",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -5013,6 +5165,7 @@
    "collapsible": 0,
    "columns": 0,
    "description": "",
+   "fetch_if_empty": 0,
    "fieldname": "debit_to",
    "fieldtype": "Link",
    "hidden": 0,
@@ -5047,6 +5200,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "party_account_currency",
    "fieldtype": "Link",
    "hidden": 1,
@@ -5082,6 +5236,7 @@
    "columns": 0,
    "default": "No",
    "description": "",
+   "fetch_if_empty": 0,
    "fieldname": "is_opening",
    "fieldtype": "Select",
    "hidden": 0,
@@ -5116,6 +5271,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "c_form_applicable",
    "fieldtype": "Select",
    "hidden": 0,
@@ -5148,6 +5304,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "c_form_no",
    "fieldtype": "Link",
    "hidden": 0,
@@ -5180,6 +5337,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break8",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -5211,6 +5369,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "remarks",
    "fieldtype": "Small Text",
    "hidden": 0,
@@ -5245,6 +5404,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "sales_partner",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "sales_team_section_break",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -5278,6 +5438,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "sales_partner",
    "fieldtype": "Link",
    "hidden": 0,
@@ -5312,6 +5473,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break10",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -5344,6 +5506,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "commission_rate",
    "fieldtype": "Float",
    "hidden": 0,
@@ -5377,6 +5540,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "total_commission",
    "fieldtype": "Currency",
    "hidden": 0,
@@ -5412,6 +5576,7 @@
    "collapsible": 1,
    "collapsible_depends_on": "sales_team",
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "section_break2",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -5443,6 +5608,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "sales_team",
    "fieldtype": "Table",
    "hidden": 0,
@@ -5477,6 +5643,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "subscription_section",
    "fieldtype": "Section Break",
    "hidden": 0,
@@ -5511,6 +5678,7 @@
    "columns": 0,
    "depends_on": "",
    "description": "",
+   "fetch_if_empty": 0,
    "fieldname": "from_date",
    "fieldtype": "Date",
    "hidden": 0,
@@ -5544,6 +5712,7 @@
    "columns": 0,
    "depends_on": "",
    "description": "",
+   "fetch_if_empty": 0,
    "fieldname": "to_date",
    "fieldtype": "Date",
    "hidden": 0,
@@ -5575,6 +5744,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "column_break_140",
    "fieldtype": "Column Break",
    "hidden": 0,
@@ -5606,6 +5776,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "auto_repeat",
    "fieldtype": "Link",
    "hidden": 0,
@@ -5640,6 +5811,7 @@
    "collapsible": 0,
    "columns": 0,
    "depends_on": "eval: doc.auto_repeat",
+   "fetch_if_empty": 0,
    "fieldname": "update_auto_repeat_reference",
    "fieldtype": "Button",
    "hidden": 0,
@@ -5672,6 +5844,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "against_income_account",
    "fieldtype": "Small Text",
    "hidden": 1,
@@ -5705,6 +5878,7 @@
    "bold": 0,
    "collapsible": 0,
    "columns": 0,
+   "fetch_if_empty": 0,
    "fieldname": "pos_total_qty",
    "fieldtype": "Float",
    "hidden": 1,
@@ -5732,18 +5906,16 @@
   }
  ],
  "has_web_view": 0,
- "hide_heading": 0,
  "hide_toolbar": 0,
  "icon": "fa fa-file-text",
  "idx": 181,
- "image_view": 0,
  "in_create": 0,
  "is_submittable": 1,
  "issingle": 0,
  "istable": 0,
  "max_attachments": 0,
  "menu_index": 0,
- "modified": "2019-03-18 18:56:51.265257",
+ "modified": "2019-04-11 17:08:11.629845",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Sales Invoice",
@@ -5829,7 +6001,6 @@
  ],
  "quick_entry": 1,
  "read_only": 0,
- "read_only_onload": 1,
  "search_fields": "posting_date, due_date, customer, base_grand_total, outstanding_amount",
  "show_name_in_global_search": 1,
  "sort_field": "modified",
@@ -5839,4 +6010,4 @@
  "track_changes": 1,
  "track_seen": 1,
  "track_views": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 1bfcd6f..5291d4f 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -1389,14 +1389,17 @@
 				args: {
 					"master_doctype": frappe.meta.get_docfield(this.frm.doc.doctype, "taxes_and_charges",
 						this.frm.doc.name).options,
-					"master_name": this.frm.doc.taxes_and_charges,
+					"master_name": this.frm.doc.taxes_and_charges
 				},
 				callback: function(r) {
 					if(!r.exc) {
-						for (let tax of r.message) {
-							me.frm.add_child("taxes", tax);
+						me.frm.set_value("taxes", r.message);
+
+						if(me.frm.doc.shipping_rule) {
+							me.frm.script_manager.trigger("shipping_rule");
+						} else {
+							me.calculate_taxes_and_totals();
 						}
-						me.calculate_taxes_and_totals();
 					}
 				}
 			});