From 464d838447fe4876df25d2ee328fa6d655ce4d6b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 7 May 2021 14:53:42 +0530 Subject: [PATCH] fix: Update bundle paths --- .../bank_reconciliation_tool.js | 2 +- .../bank_statement_import/bank_statement_import.js | 2 +- erpnext/hooks.py | 9 +++++---- erpnext/public/js/hub/hub_factory.js | 6 +----- erpnext/selling/page/point_of_sale/point_of_sale.js | 4 ++-- erpnext/stock/doctype/item/item.js | 2 +- erpnext/stock/page/stock_balance/stock_balance.js | 2 +- .../warehouse_capacity_summary.js | 4 ++-- erpnext/templates/generators/item/item.html | 10 ++++------ erpnext/templates/pages/cart.html | 8 +++----- 10 files changed, 21 insertions(+), 28 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js index 10f660a140..f2c3dea116 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js @@ -15,7 +15,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", { }, refresh: function (frm) { - frappe.require("assets/js/bank-reconciliation-tool.min.js", () => + frappe.require("bank-reconciliation-tool.bundle.js", () => frm.trigger("make_reconciliation_tool") ); frm.upload_statement_button = frm.page.set_secondary_action( diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js index ad4ff9ee60..2b6aeee1bc 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js @@ -319,7 +319,7 @@ frappe.ui.form.on("Bank Statement Import", { return; } - frappe.require("/assets/js/data_import_tools.min.js", () => { + frappe.require("data_import_tools.bundle.js", () => { frm.import_preview = new frappe.data_import.ImportPreview({ wrapper: frm.get_field("import_preview").$wrapper, doctype: frm.doc.reference_doctype, diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 4b3597afd7..3f145dc958 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -15,10 +15,11 @@ app_logo_url = "/assets/erpnext/images/erpnext-logo.svg" develop_version = '13.x.x-develop' -app_include_js = "/assets/js/erpnext.min.js" -app_include_css = "/assets/css/erpnext.css" -web_include_js = "/assets/js/erpnext-web.min.js" -web_include_css = "/assets/css/erpnext-web.css" +app_include_js = "erpnext.bundle.js" +app_include_css = "erpnext.bundle.css" +web_include_js = "erpnext-web.bundle.js" +web_include_css = "erpnext-web.bundle.css" +email_css = "email.bundle.css" doctype_js = { "Address": "public/js/address.js", diff --git a/erpnext/public/js/hub/hub_factory.js b/erpnext/public/js/hub/hub_factory.js index 8dab2d6251..9c67c1cf9f 100644 --- a/erpnext/public/js/hub/hub_factory.js +++ b/erpnext/public/js/hub/hub_factory.js @@ -19,11 +19,7 @@ frappe.views.MarketplaceFactory = class MarketplaceFactory extends frappe.views. } make(page_name) { - const assets = [ - '/assets/js/marketplace.min.js' - ]; - - frappe.require(assets, () => { + frappe.require('marketplace.bundle.js', () => { erpnext.hub.marketplace = new erpnext.hub.Marketplace({ parent: this.make_page(true, page_name) }); diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index e3405e0ce8..6db4150be9 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -7,7 +7,7 @@ frappe.pages['point-of-sale'].on_page_load = function(wrapper) { single_column: true }); - frappe.require('assets/js/point-of-sale.min.js', function() { + frappe.require('point-of-sale.bundle.js', function() { wrapper.pos = new erpnext.PointOfSale.Controller(wrapper); window.cur_pos = wrapper.pos; }); @@ -19,4 +19,4 @@ frappe.pages['point-of-sale'].refresh = function(wrapper) { wrapper.pos.wrapper.html(""); wrapper.pos.check_opening_entry(); } -}; \ No newline at end of file +}; diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 2079cf88dd..2aa42e66f8 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -379,7 +379,7 @@ $.extend(erpnext.item, { // Show Stock Levels only if is_stock_item if (frm.doc.is_stock_item) { - frappe.require('assets/js/item-dashboard.min.js', function() { + frappe.require('item-dashboard.bundle.js', function() { const section = frm.dashboard.add_section('', __("Stock Levels")); erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({ parent: section, diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js index bddffd465e..f00dd3e791 100644 --- a/erpnext/stock/page/stock_balance/stock_balance.js +++ b/erpnext/stock/page/stock_balance/stock_balance.js @@ -62,7 +62,7 @@ frappe.pages['stock-balance'].on_page_load = function(wrapper) { // page.sort_selector.wrapper.css({'margin-right': '15px', 'margin-top': '4px'}); - frappe.require('assets/js/item-dashboard.min.js', function() { + frappe.require('item-dashboard.bundle.js', function() { page.item_dashboard = new erpnext.stock.ItemDashboard({ parent: page.main, page_length: 20, diff --git a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js index b610e7dd58..c0ffdc9d51 100644 --- a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js +++ b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js @@ -79,7 +79,7 @@ frappe.pages['warehouse-capacity-summary'].on_page_load = function(wrapper) { } }); - frappe.require('assets/js/item-dashboard.min.js', function() { + frappe.require('item-dashboard.bundle.js', function() { $(frappe.render_template('warehouse_capacity_summary_header')).appendTo(page.main); page.capacity_dashboard = new erpnext.stock.ItemDashboard({ @@ -117,4 +117,4 @@ frappe.pages['warehouse-capacity-summary'].on_page_load = function(wrapper) { setup_click('Item'); setup_click('Warehouse'); }); -}; \ No newline at end of file +}; diff --git a/erpnext/templates/generators/item/item.html b/erpnext/templates/generators/item/item.html index 135982d709..17f6880293 100644 --- a/erpnext/templates/generators/item/item.html +++ b/erpnext/templates/generators/item/item.html @@ -28,9 +28,7 @@ {% block base_scripts %} - - - - - -{% endblock %} \ No newline at end of file +{{ include_script("frappe-web.bundle.js") }} +{{ include_script("controls.bundle.js") }} +{{ include_script("dialog.bundle.js") }} +{% endblock %} diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html index ea343713a1..c64c6343cc 100644 --- a/erpnext/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -139,9 +139,7 @@ {% block base_scripts %} - - - - - +{{ include_script("frappe-web.bundle.js") }} +{{ include_script("controls.bundle.js") }} +{{ include_script("dialog.bundle.js") }} {% endblock %}