diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000000..7bf6b4dc441 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,18 @@ +include MANIFEST.in +include requirements.txt +include *.json +include *.md +include *.py +include *.txt +recursive-include erpnext *.css +recursive-include erpnext *.csv +recursive-include erpnext *.html +recursive-include erpnext *.ico +recursive-include erpnext *.js +recursive-include erpnext *.json +recursive-include erpnext *.md +recursive-include erpnext *.png +recursive-include erpnext *.py +recursive-include erpnext *.svg +recursive-include erpnext *.txt +recursive-exclude * *.pyc \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index c20b2976780..23a55d362c4 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -6,9 +6,9 @@ cur_frm.cscript.fname = "entries"; cur_frm.cscript.other_fname = "purchase_tax_details"; wn.provide("erpnext.accounts"); -wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ onload: function() { @@ -133,7 +133,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['entries'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) { return { - query:"controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters:{ 'is_purchase_item': 'Yes' } diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js index 84521eda09f..b589651f18f 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js @@ -4,7 +4,7 @@ // //--------- ONLOAD ------------- -wn.require("app/js/controllers/accounts.js"); +{% include "public/js/controllers/accounts.js" %} cur_frm.cscript.onload = function(doc, cdt, cdn) { @@ -139,7 +139,7 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) { cur_frm.set_query("account_head", "purchase_tax_details", function(doc) { return { - query: "controllers.queries.tax_account_query", + query: "erpnext.controllers.queries.tax_account_query", filters: { "account_type": ["Tax", "Chargeable", "Expense Account"], "debit_or_credit": "Debit", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 1940c6e1c3a..630dfe29bb6 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -9,10 +9,10 @@ cur_frm.cscript.sales_team_fname = "sales_team"; // print heading cur_frm.pformat.print_heading = 'Invoice'; -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %}; +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} wn.provide("erpnext.accounts"); erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.extend({ @@ -115,7 +115,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }; if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer; return { - query: "controllers.queries.get_delivery_notes_to_be_billed", + query: "erpnext.controllers.queries.get_delivery_notes_to_be_billed", filters: filters }; } @@ -324,7 +324,7 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { //-------------------------- cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { return{ - query: "controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project_name", filters: {'customer': doc.customer} } } diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js index e2e50470283..0cdead90302 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js @@ -3,7 +3,7 @@ //--------- ONLOAD ------------- -wn.require("app/js/controllers/accounts.js"); +{% include "public/js/controllers/accounts.js" %} cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.doctype === "Sales Taxes and Charges Master") @@ -129,7 +129,7 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) { cur_frm.fields_dict['other_charges'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) { return{ - query: "controllers.queries.tax_account_query", + query: "erpnext.controllers.queries.tax_account_query", filters: { "account_type": ["Tax", "Chargeable", "Income Account"], "debit_or_credit": "Credit", diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js index 7fe050762d3..4c7c6444c1d 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.js +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/account_tree_grid.js"); +wn.require("assets/erpnext/js/account_tree_grid.js"); wn.pages['financial-analytics'].onload = function(wrapper) { wn.ui.make_app_page({ diff --git a/erpnext/accounts/page/trial_balance/trial_balance.js b/erpnext/accounts/page/trial_balance/trial_balance.js index 83f56eb3cb6..34a06957d25 100644 --- a/erpnext/accounts/page/trial_balance/trial_balance.js +++ b/erpnext/accounts/page/trial_balance/trial_balance.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/account_tree_grid.js"); +wn.require("assets/erpnext/js/account_tree_grid.js"); wn.pages['trial-balance'].onload = function(wrapper) { wn.ui.make_app_page({ diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js index 183e16ab321..7ab4ffa8b49 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/purchase_trends_filters.js"); +wn.require("assets/erpnext/js/purchase_trends_filters.js"); wn.query_reports["Purchase Invoice Trends"] = { filters: get_filters() diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js index 3b004abc4f4..0ffb6e0f153 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Sales Invoice Trends"] = { filters: get_filters() diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 86b252d8d94..cc24925905b 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -7,8 +7,8 @@ // cur_frm.cscript.fname - Details fieldname wn.provide("erpnext.buying"); -wn.require("app/js/transaction.js"); -wn.require("app/js/controllers/accounts.js"); +wn.require("assets/erpnext/js/transaction.js"); +{% include "public/js/controllers/accounts.js" %} erpnext.buying.BuyingController = erpnext.TransactionController.extend({ onload: function() { @@ -37,18 +37,18 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ if(this.frm.fields_dict.supplier) { this.frm.set_query("supplier", function() { - return{ query:"controllers.queries.supplier_query" }}); + return{ query: "erpnext.controllers.queries.supplier_query" }}); } this.frm.set_query("item_code", this.frm.cscript.fname, function() { if(me.frm.doc.is_subcontracted == "Yes") { return{ - query:"controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters:{ 'is_sub_contracted_item': 'Yes' } } } else { return{ - query: "controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters: { 'is_purchase_item': 'Yes' } } } diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 7db00359e50..edf7c82555d 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -7,10 +7,10 @@ cur_frm.cscript.tname = "Purchase Order Item"; cur_frm.cscript.fname = "po_details"; cur_frm.cscript.other_fname = "purchase_tax_details"; -wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({ refresh: function(doc, cdt, cdn) { diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index aa8ea2a122b..e1780abee97 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; cur_frm.cscript.refresh = function(doc,dt,dn) { cur_frm.cscript.make_dashboard(doc); diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index 597ad8655a3..bc56abd9170 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -7,9 +7,9 @@ cur_frm.cscript.fname = "quotation_items"; cur_frm.cscript.other_fname = "purchase_tax_details"; // attach required files -wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({ refresh: function() { diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js index 2c7ffc0c769..d5371d36f4c 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/purchase_trends_filters.js"); +wn.require("assets/erpnext/js/purchase_trends_filters.js"); wn.query_reports["Purchase Order Trends"] = { filters: get_filters() diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt new file mode 100644 index 00000000000..4e6d4732fc2 --- /dev/null +++ b/erpnext/hooks.txt @@ -0,0 +1,10 @@ +app_name ERPNext + +app_include_js assets/js/erpnext.min.js +app_include_css assets/css/erpnext.css +get_desktop_icons erpnext.manage.get_desktop_icons +boot_session erpnext.startup.boot.boot_session + +standard_queries Warehouse erpnext.stock.utils.get_warehouse_list +standard_queries Customer erpnext.selling.utils.get_customer_list + diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index e3626b0f48a..29157d090a8 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -71,5 +71,5 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){ } cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query" } + return{ query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/attendance.js b/erpnext/hr/doctype/attendance/attendance.js index be2b39dc829..ff7d7dd9840 100644 --- a/erpnext/hr/doctype/attendance/attendance.js +++ b/erpnext/hr/doctype/attendance/attendance.js @@ -10,6 +10,6 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.employee_query" + query: "erpnext.controllers.queries.employee_query" } } diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js index 55be5260617..1df6175fae8 100644 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -7,7 +7,7 @@ erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({ this.frm.fields_dict.user_id.get_query = function(doc,cdt,cdn) { return { query:"core.doctype.profile.profile.profile_query"} } this.frm.fields_dict.reports_to.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query"} } + return{ query: "erpnext.controllers.queries.employee_query"} } }, onload: function() { diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index c65fe0a39f7..1a16ddeda4d 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -55,7 +55,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) { cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.employee_query" + query: "erpnext.controllers.queries.employee_query" } } var exp_approver = doc.exp_approver; diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.js b/erpnext/hr/doctype/leave_allocation/leave_allocation.js index 4bc3c49bd1b..1e376dacf59 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.js +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.js @@ -68,6 +68,6 @@ calculate_total_leaves_allocated = function(doc, dt, dn) { cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.employee_query" + query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index 3716953cd26..ceab14843ec 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -123,6 +123,6 @@ cur_frm.cscript.validate = function(doc, dt, dn) { cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.employee_query" + query: "erpnext.controllers.queries.employee_query" } } diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js index dd9ab970d5d..24da8a0503b 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -60,5 +60,5 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { } cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query" } + return{ query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.js b/erpnext/hr/doctype/upload_attendance/upload_attendance.js index aed3d7f76cd..ee58945dc27 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.js +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt -wn.require("public/app/js/utils.js"); +wn.require("assets/erpnext/js/utils.js"); wn.provide("erpnext.hr"); erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({ diff --git a/erpnext/manage.py b/erpnext/manage.py index 6f62673f41f..fe18d20e2e8 100644 --- a/erpnext/manage.py +++ b/erpnext/manage.py @@ -5,14 +5,6 @@ from __future__ import unicode_literals import webnotes -def get_hooks(): - return { - "app_include_js": ["assets/js/erpnext.min.js"], - "app_include_css": ["assets/css/erpnext.css"], - "desktop_icons": get_desktop_icons(), - "boot_session": ["erpnext.startup.boot.boot_session"] - } - def after_install(): import_defaults() import_country_and_currency() diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index a43e5dac6b6..c0dcdfc8f1a 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -167,7 +167,7 @@ var calculate_total = function(doc) { cur_frm.fields_dict['item'].get_query = function(doc) { return{ - query:"controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters:{ 'is_manufactured_item': 'Yes' } @@ -184,7 +184,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { cur_frm.fields_dict['bom_materials'].grid.get_field('item_code').get_query = function(doc) { return{ - query:"controllers.queries.item_query" + query: "erpnext.controllers.queries.item_query" } } diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js index 3bf31f93b64..e5415ade86f 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js @@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.set_query("current_bom", function(doc) { return{ - query:"controllers.queries.bom", + query: "erpnext.controllers.queries.bom", filters: {name: "!" + doc.new_bom} } }); @@ -16,7 +16,7 @@ cur_frm.set_query("current_bom", function(doc) { cur_frm.set_query("new_bom", function(doc) { return{ - query:"controllers.queries.bom", + query: "erpnext.controllers.queries.bom", filters: {name: "!" + doc.current_bom} } }); \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 075f8bd1a48..1ace97b66b9 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -102,7 +102,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { cur_frm.set_query("bom_no", function(doc) { if (doc.production_item) { return{ - query:"controllers.queries.bom", + query: "erpnext.controllers.queries.bom", filters: {item: cstr(doc.production_item)} } } else msgprint(wn._("Please enter Production Item first")); diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js index 870f01fd38f..f52fb8d6940 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js @@ -41,7 +41,7 @@ cur_frm.fields_dict['pp_details'].grid.get_field('bom_no').get_query = function( var d = locals[this.doctype][this.docname]; if (d.item_code) { return { - query:"controllers.queries.bom", + query: "erpnext.controllers.queries.bom", filters:{'item': cstr(d.item_code)} } } else msgprint(wn._("Please enter Item first")); @@ -49,7 +49,7 @@ cur_frm.fields_dict['pp_details'].grid.get_field('bom_no').get_query = function( cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.customer_query" + query: "erpnext.controllers.queries.customer_query" } } diff --git a/erpnext/patches.txt b/erpnext/patches.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js index 30873b5abe0..a77866ea0e0 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -17,6 +17,6 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.customer_query" + query: "erpnext.controllers.queries.customer_query" } } \ No newline at end of file diff --git a/erpnext/public/build.json b/erpnext/public/build.json index 3c681fce93b..dcad80c8f9a 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -12,5 +12,5 @@ "public/js/feature_setup.js", "public/js/utils.js", "public/js/queries.js" - ] + ], } diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js index 3c60a9149af..621e340ff7c 100644 --- a/erpnext/public/js/queries.js +++ b/erpnext/public/js/queries.js @@ -9,27 +9,27 @@ $.extend(erpnext.queries, { }, lead: function() { - return { query: "controllers.queries.lead_query" }; + return { query: "erpnext.controllers.queries.lead_query" }; }, customer: function() { - return { query: "controllers.queries.customer_query" }; + return { query: "erpnext.controllers.queries.customer_query" }; }, supplier: function() { - return { query: "controllers.queries.supplier_query" }; + return { query: "erpnext.controllers.queries.supplier_query" }; }, account: function() { - return { query: "controllers.queries.account_query" }; + return { query: "erpnext.controllers.queries.account_query" }; }, item: function() { - return { query: "controllers.queries.item_query" }; + return { query: "erpnext.controllers.queries.item_query" }; }, bom: function() { - return { query: "controllers.queries.bom" }; + return { query: "erpnext.controllers.queries.bom" }; }, task: function() { diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index 832cac5d6e9..ba41318ec1f 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/stock_grid_report.js"); +wn.require("assets/erpnext/js/stock_grid_report.js"); erpnext.StockAnalytics = erpnext.StockGridReport.extend({ init: function(wrapper, opts) { diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 96f10c7c576..5b48820c9c6 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt wn.provide("erpnext"); -wn.require("app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); erpnext.TransactionController = erpnext.stock.StockController.extend({ onload: function() { diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 8ec4a2bd373..e8130aec5ee 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; cur_frm.cscript.onload = function(doc,dt,dn){ cur_frm.cscript.load_defaults(doc, dt, dn); @@ -116,7 +116,7 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) { cur_frm.fields_dict.lead_name.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.lead_query" + query: "erpnext.controllers.queries.lead_query" } } diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js index d96b993d79b..223bd8d279d 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.js +++ b/erpnext/selling/doctype/installation_note/installation_note.js @@ -37,7 +37,7 @@ erpnext.selling.InstallationNote = wn.ui.form.Controller.extend({ this.frm.set_query("customer", function() { return { - query: "controllers.queries.customer_query" + query: "erpnext.controllers.queries.customer_query" } }); }, diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index cf972b602c6..4ab1067089e 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -1,14 +1,14 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; +{% include 'utilities/doctype/sms_control/sms_control.js' %} wn.provide("erpnext"); erpnext.LeadController = wn.ui.form.Controller.extend({ setup: function() { this.frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return { query:"controllers.queries.customer_query" } } + return { query: "erpnext.controllers.queries.customer_query" } } }, onload: function() { diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js index 5fc84fa9b05..396def8b0ef 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.js +++ b/erpnext/selling/doctype/opportunity/opportunity.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/utilities/doctype/sms_control/sms_control.js'); +{% include 'utilities/doctype/sms_control/sms_control.js' %}; wn.provide("erpnext.selling"); // TODO commonify this code @@ -60,7 +60,7 @@ erpnext.selling.Opportunity = wn.ui.form.Controller.extend({ this.frm.set_query("item_code", "enquiry_details", function() { return { - query: "controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters: me.frm.doc.enquiry_type === "Maintenance" ? {"is_service_item": "Yes"} : {"is_sales_item": "Yes"} }; diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 9f145ceb46d..bb2ce8ca6ae 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -8,10 +8,10 @@ cur_frm.cscript.fname = "quotation_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %} +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ onload: function(doc, dt, dn) { @@ -90,7 +90,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ cur_frm.script_manager.make(erpnext.selling.QuotationController); cur_frm.fields_dict.lead.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.lead_query" } } + return{ query: "erpnext.controllers.queries.lead_query" } } cur_frm.cscript.lead = function(doc, cdt, cdn) { if(doc.lead) { diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index a8ba5022e9b..f39394527e9 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -8,11 +8,10 @@ cur_frm.cscript.fname = "sales_order_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; - -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %} +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({ refresh: function(doc, dt, dn) { @@ -148,7 +147,7 @@ cur_frm.cscript.new_contact = function(){ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { return { - query: "controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project_name", filters: { 'customer': doc.customer } diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.js b/erpnext/selling/report/quotation_trends/quotation_trends.js index f26e873497f..59f8b469a29 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.js +++ b/erpnext/selling/report/quotation_trends/quotation_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Quotation Trends"] = { filters: get_filters() diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.js b/erpnext/selling/report/sales_order_trends/sales_order_trends.js index 62684009ecd..6ff31a21d66 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.js +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Sales Order Trends"] = { filters: get_filters() diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index c5eb38c3627..ae16413a196 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -5,12 +5,12 @@ // ------ // cur_frm.cscript.tname - Details table name // cur_frm.cscript.fname - Details fieldname -// cur_frm.cscript.other_fname - wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); fieldname +// cur_frm.cscript.other_fname - fieldname // cur_frm.cscript.sales_team_fname - Sales Team fieldname wn.provide("erpnext.selling"); -wn.require("app/js/transaction.js"); -wn.require("app/js/controllers/accounts.js"); +wn.require("assets/erpnext/js/transaction.js"); +{% include "public/js/controllers/accounts.js" %} erpnext.selling.SellingController = erpnext.TransactionController.extend({ onload: function() { @@ -59,7 +59,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ if(this.frm.fields_dict[this.fname].grid.get_field('item_code')) { this.frm.set_query("item_code", this.fname, function() { return { - query: "controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters: (me.frm.doc.order_type === "Maintenance" ? {'is_service_item': 'Yes'}: {'is_sales_item': 'Yes' }) diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js index cdf8ef0ec98..bd42618c536 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.js +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js @@ -100,7 +100,7 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){ else if(doc.based_on == 'Itemwise Discount') return { doctype: "Item", - query: "controllers.queries.item_query" + query: "erpnext.controllers.queries.item_query" } else return { @@ -111,4 +111,4 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){ } cur_frm.fields_dict.to_emp.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query" } } \ No newline at end of file + return{ query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js index 05768575bc9..57eca345a11 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.js +++ b/erpnext/setup/doctype/sales_partner/sales_partner.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; cur_frm.cscript.onload = function(doc,dt,dn){ diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js index 55d86846531..a25a3d186e7 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.js +++ b/erpnext/setup/doctype/sales_person/sales_person.js @@ -37,4 +37,4 @@ cur_frm.fields_dict['target_details'].grid.get_field("item_group").get_query = f } cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query" } } \ No newline at end of file + return{ query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index adb031cd613..3258db32bf2 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -165,8 +165,8 @@ def set_defaults(args): def create_feed_and_todo(): """update activty feed and create todo for creation of item, customer, vendor""" - import home - home.make_feed('Comment', 'ToDo', '', webnotes.session['user'], + from erpnext.home import make_feed + make_feed('Comment', 'ToDo', '', webnotes.session['user'], 'ERNext Setup Complete!', '#6B24B3') def create_email_digest(): diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index 48c2aa01618..7d518728b03 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -4,7 +4,8 @@ from __future__ import unicode_literals import webnotes -import home + +from erpnext.home import make_feed def on_login_post_session(login_manager): """ @@ -25,7 +26,7 @@ def on_login_post_session(login_manager): from webnotes.utils import nowtime from webnotes.profile import get_user_fullname webnotes.conn.begin() - home.make_feed('Login', 'Profile', login_manager.user, login_manager.user, + make_feed('Login', 'Profile', login_manager.user, login_manager.user, '%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()), login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D') webnotes.conn.commit() @@ -66,6 +67,6 @@ def check_if_expired(): def comment_added(doc): """add comment to feed""" - home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by, + make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by, '"' + doc.comment + '"', '#6B24B3') diff --git a/erpnext/startup/query_handlers.py b/erpnext/startup/query_handlers.py deleted file mode 100644 index 753d088de58..00000000000 --- a/erpnext/startup/query_handlers.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - -from __future__ import unicode_literals - -standard_queries = { - "Warehouse": "stock.utils.get_warehouse_list", - "Customer": "selling.utils.get_customer_list", -} \ No newline at end of file diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js index 51e747029c6..cc142ed5663 100644 --- a/erpnext/stock/doctype/batch/batch.js +++ b/erpnext/stock/doctype/batch/batch.js @@ -3,7 +3,7 @@ cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) { return { - query:"controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters:{ 'is_stock_item': 'Yes' } diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 796bf0f66b1..56329a11a04 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -7,10 +7,10 @@ cur_frm.cscript.fname = "delivery_note_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %}; +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} wn.provide("erpnext.stock"); erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({ @@ -106,7 +106,7 @@ cur_frm.cscript.new_contact = function(){ // ***************** Get project name ***************** cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { return { - query: "controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project_name", filters: { 'customer': doc.customer } diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index c9aa75e7b71..1ee5e049e44 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -151,11 +151,11 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.supplier_query" } } + return{ query: "erpnext.controllers.queries.supplier_query" } } cur_frm.cscript.copy_from_item_group = function(doc) { wn.model.with_doc("Item Group", doc.item_group, function() { diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js index 68f1bd07a71..86b34c03fea 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js @@ -3,7 +3,7 @@ wn.provide("erpnext.stock"); -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); erpnext.stock.LandedCostWizard = erpnext.stock.StockController.extend({ setup: function() { diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 7dca9352920..31a57530357 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -4,8 +4,8 @@ cur_frm.cscript.tname = "Material Request Item"; cur_frm.cscript.fname = "indent_details"; -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'utilities/doctype/sms_control/sms_control.js' %} erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({ refresh: function(doc) { diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 59a60632325..5151c0090b6 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -5,10 +5,10 @@ cur_frm.cscript.tname = "Purchase Receipt Item"; cur_frm.cscript.fname = "purchase_receipt_details"; cur_frm.cscript.other_fname = "purchase_tax_details"; -wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} wn.provide("erpnext.stock"); erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({ diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index d5c54b59433..abfd0e2f963 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -4,7 +4,7 @@ cur_frm.cscript.tname = "Stock Entry Detail"; cur_frm.cscript.fname = "mtn_details"; -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); wn.provide("erpnext.stock"); erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ @@ -386,9 +386,9 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) { - return{ query:"controllers.queries.customer_query" } + return{ query: "erpnext.controllers.queries.customer_query" } } cur_frm.fields_dict.supplier.get_query = function(doc, cdt, cdn) { - return{ query:"controllers.queries.supplier_query" } + return{ query: "erpnext.controllers.queries.supplier_query" } } diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js index bf08738641a..63f2032e868 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); wn.provide("erpnext.stock"); erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.js b/erpnext/stock/page/stock_ageing/stock_ageing.js index 6c626e22edd..33dbf542c79 100644 --- a/erpnext/stock/page/stock_ageing/stock_ageing.js +++ b/erpnext/stock/page/stock_ageing/stock_ageing.js @@ -16,7 +16,7 @@ wn.pages['stock-ageing'].onload = function(wrapper) { } -wn.require("app/js/stock_grid_report.js"); +wn.require("assets/erpnext/js/stock_grid_report.js"); erpnext.StockAgeing = erpnext.StockGridReport.extend({ init: function(wrapper) { diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js index 3fb4a85e6e4..ba2c55a2d1e 100644 --- a/erpnext/stock/page/stock_analytics/stock_analytics.js +++ b/erpnext/stock/page/stock_analytics/stock_analytics.js @@ -16,4 +16,4 @@ wn.pages['stock-analytics'].onload = function(wrapper) { } -wn.require("app/js/stock_analytics.js"); \ No newline at end of file +wn.require("assets/erpnext/js/stock_analytics.js"); \ No newline at end of file diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js index 604312fce9c..cc293a4c018 100644 --- a/erpnext/stock/page/stock_balance/stock_balance.js +++ b/erpnext/stock/page/stock_balance/stock_balance.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/stock_analytics.js"); +wn.require("assets/erpnext/js/stock_analytics.js"); wn.pages['stock-balance'].onload = function(wrapper) { wn.ui.make_app_page({ diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js index 08a455e1d34..a8a966fbc4e 100644 --- a/erpnext/stock/page/stock_ledger/stock_ledger.js +++ b/erpnext/stock/page/stock_ledger/stock_ledger.js @@ -12,7 +12,7 @@ wn.pages['stock-ledger'].onload = function(wrapper) { wrapper.appframe.add_module_icon("Stock") } -wn.require("app/js/stock_grid_report.js"); +wn.require("assets/erpnext/js/stock_grid_report.js"); erpnext.StockLedger = erpnext.StockGridReport.extend({ init: function(wrapper) { diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js index c50879160ea..8cef636f9b0 100644 --- a/erpnext/stock/page/stock_level/stock_level.js +++ b/erpnext/stock/page/stock_level/stock_level.js @@ -15,7 +15,7 @@ wn.pages['stock-level'].onload = function(wrapper) { ; } -wn.require("app/js/stock_grid_report.js"); +wn.require("assets/erpnext/js/stock_grid_report.js"); erpnext.StockLevel = erpnext.StockGridReport.extend({ init: function(wrapper) { diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js index ab0147b4966..568d982548c 100644 --- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Delivery Note Trends"] = { filters: get_filters() diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js index c3397f76f3f..f66fcfc9527 100644 --- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/purchase_trends_filters.js"); +wn.require("assets/erpnext/js/purchase_trends_filters.js"); wn.query_reports["Purchase Receipt Trends"] = { filters: get_filters() diff --git a/erpnext/support/doctype/customer_issue/customer_issue.js b/erpnext/support/doctype/customer_issue/customer_issue.js index 5d0ffb5fdc3..0ff3f17585a 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.js +++ b/erpnext/support/doctype/customer_issue/customer_issue.js @@ -103,4 +103,4 @@ cur_frm.add_fetch('item_code', 'description', 'description'); cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index f1b2ac8f044..75773e07ac4 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -108,4 +108,4 @@ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) { } cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js index 9b604b92496..f571b9aa9c2 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js @@ -104,5 +104,5 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return {query: "controllers.queries.customer_query" } + return {query: "erpnext.controllers.queries.customer_query" } } \ No newline at end of file diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js index b3728253b7c..b5224e7b66a 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.js +++ b/erpnext/support/doctype/support_ticket/support_ticket.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } wn.provide("erpnext.support"); // TODO commonify this code diff --git a/erpnext/utilities/doctype/address/address.js b/erpnext/utilities/doctype/address/address.js index aa608ba7bac..f56a709e703 100644 --- a/erpnext/utilities/doctype/address/address.js +++ b/erpnext/utilities/doctype/address/address.js @@ -1,4 +1,4 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/controllers/js/contact_address_common.js'); \ No newline at end of file +{% include 'controllers/js/contact_address_common.js' %}; \ No newline at end of file diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js index 81d35ddae02..3d3e55612c5 100644 --- a/erpnext/utilities/doctype/contact/contact.js +++ b/erpnext/utilities/doctype/contact/contact.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/controllers/js/contact_address_common.js'); +{% include 'controllers/js/contact_address_common.js' %}; cur_frm.cscript.refresh = function(doc) { cur_frm.communication_view = new wn.views.CommunicationList({