diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 2061fb198c4..c059702e953 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -73,12 +73,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }); if(!from_delivery_note) { - cur_frm.appframe.add_primary_action(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck") + cur_frm.page.add_menu_item(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck") } } if(doc.outstanding_amount!=0) { - cur_frm.appframe.add_primary_action(__('Make Payment Entry'), cur_frm.cscript.make_bank_voucher, "icon-money"); + cur_frm.page.add_menu_item(__('Make Payment Entry'), cur_frm.cscript.make_bank_voucher, "icon-money"); } } @@ -90,7 +90,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, sales_order_btn: function() { - this.$sales_order_btn = cur_frm.appframe.add_primary_action(__('From Sales Order'), + this.$sales_order_btn = cur_frm.page.add_menu_item(__('From Sales Order'), function() { frappe.model.map_current_doc({ method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", @@ -107,7 +107,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, delivery_note_btn: function() { - this.$delivery_note_btn = cur_frm.appframe.add_primary_action(__('From Delivery Note'), + this.$delivery_note_btn = cur_frm.page.add_menu_item(__('From Delivery Note'), function() { frappe.model.map_current_doc({ method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index dc0dd7a95e4..cfdc2b49543 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -41,16 +41,16 @@ pscript['onload_Accounts Browser'] = function(wrapper){ '
'+__('Please setup your chart of accounts before you start Accounting Entries')+'
').appendTo(main); if (frappe.boot.user.can_create.indexOf("Company") !== -1) { - wrapper.appframe.add_button(__('New Company'), function() { newdoc('Company'); }, + wrapper.page.add_button(__('New Company'), function() { newdoc('Company'); }, 'icon-plus'); } - wrapper.appframe.set_title_right(__('Refresh'), function() { + wrapper.page.set_primary_action(__('Refresh'), function() { wrapper.$company_select.change(); }); // company-select - wrapper.$company_select = wrapper.appframe.add_select("Company", []) + wrapper.$company_select = wrapper.page.add_select("Company", []) .change(function() { var ctype = frappe.get_route()[1] || 'Account'; erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), @@ -73,9 +73,9 @@ pscript['onload_Accounts Browser'] = function(wrapper){ pscript.set_title = function(wrapper, ctype, val) { if(val) { - wrapper.appframe.set_title('Chart of '+ctype+'s' + " - " + cstr(val)); + wrapper.page.set_title('Chart of '+ctype+'s' + " - " + cstr(val)); } else { - wrapper.appframe.set_title('Chart of '+ctype+'s'); + wrapper.page.set_title('Chart of '+ctype+'s'); } } diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js index e1d6294d6f8..2cc5b7a69e0 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js @@ -21,7 +21,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ title: __("Purchase Analytics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company", "Fiscal Year", "Purchase Invoice", "Purchase Invoice Item", "Purchase Order", "Purchase Order Item[Purchase Analytics]", diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js index 6115607adee..e9a7c767ce4 100644 --- a/erpnext/projects/doctype/time_log/time_log_list.js +++ b/erpnext/projects/doctype/time_log/time_log_list.js @@ -6,7 +6,7 @@ frappe.listview_settings['Time Log'] = { add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "time_log_for"], selectable: true, onload: function(me) { - me.appframe.add_primary_action(__("Make Time Log Batch"), function() { + me.page.add_menu_item(__("Make Time Log Batch"), function() { var selected = me.get_checked_items() || []; if(!selected.length) { diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js index 87fb7a986b9..4bc93ea50a5 100644 --- a/erpnext/public/js/account_tree_grid.js +++ b/erpnext/public/js/account_tree_grid.js @@ -20,7 +20,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ title: title, page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Company", "Fiscal Year", "Account", "GL Entry", "Cost Center"], tree_grid: { show: true, diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index 091836f95e3..d32afebeab2 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -9,7 +9,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ title: __("Stock Analytics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Fiscal Year", "Serial No"], tree_grid: { diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 5bbfae46412..ab1f7d22c9d 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -82,9 +82,9 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ this.$pos_btn && this.$pos_btn.remove(); - this.$pos_btn = this.frm.appframe.add_primary_action(btn_label, function() { + this.$pos_btn = this.frm.page.add_menu_item(btn_label, function() { me.toggle_pos(); - }, icon, "btn-default"); + }); } else { // hack: will avoid calling refresh from refresh setTimeout(function() { me.toggle_pos(false); }, 100); @@ -105,12 +105,12 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ // make pos if(!this.frm.pos) { - var wrapper = this.frm.appframe.add_view("pos", "