diff --git a/.gitignore b/.gitignore index 2b5e3d6b99e..a23a9a7492f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ conf.py locale latest_updates.json .wnf-lang-status +*.egg-info +dist/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..ee64b6d176c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +anguage: python + +python: + - "2.7" + +services: + - mysql + +install: + - pip install https://github.com/webnotes/wnframework/archive/4.0.0-wip.tar.gz && + - pip install --editable . + +script: + cd ./test_sites/ && + webnotes --reinstall -v test_site && + webnotes --install_app erpnext -v test_site && + webnotes --run_tests -v test_site --app erpnext + +branches: + except: + - develop + - master + - 3.x.x + - slow + - webshop_refactor + +before_script: + - mysql -e 'create database travis' && + - echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis') WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root + 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/accounts/doctype/sales_invoice/templates/pages/invoices.html b/accounts/doctype/sales_invoice/templates/pages/invoices.html deleted file mode 100644 index f108683cb93..00000000000 --- a/accounts/doctype/sales_invoice/templates/pages/invoices.html +++ /dev/null @@ -1 +0,0 @@ -{% extends "app/portal/templates/sales_transactions.html" %} \ No newline at end of file diff --git a/config.json b/config.json deleted file mode 100644 index 55c776ad0a4..00000000000 --- a/config.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "app_name": "ERPNext", - "app_version": "3.3.7", - "base_template": "app/portal/templates/base.html", - "modules": { - "Accounts": { - "color": "#3498db", - "icon": "icon-money", - "link": "accounts-home", - "type": "module" - }, - "Activity": { - "color": "#e67e22", - "icon": "icon-play", - "label": "Activity", - "link": "activity", - "type": "page" - }, - "Buying": { - "color": "#c0392b", - "icon": "icon-shopping-cart", - "link": "buying-home", - "type": "module" - }, - "HR": { - "color": "#2ecc71", - "icon": "icon-group", - "label": "Human Resources", - "link": "hr-home", - "type": "module" - }, - "Manufacturing": { - "color": "#7f8c8d", - "icon": "icon-cogs", - "link": "manufacturing-home", - "type": "module" - }, - "Notes": { - "color": "#95a5a6", - "doctype": "Note", - "icon": "icon-file-alt", - "label": "Notes", - "link": "List/Note", - "type": "list" - }, - "Projects": { - "color": "#8e44ad", - "icon": "icon-puzzle-piece", - "link": "projects-home", - "type": "module" - }, - "Selling": { - "color": "#1abc9c", - "icon": "icon-tag", - "link": "selling-home", - "type": "module" - }, - "Setup": { - "color": "#bdc3c7", - "icon": "icon-wrench", - "link": "Setup", - "type": "setup" - }, - "Stock": { - "color": "#f39c12", - "icon": "icon-truck", - "link": "stock-home", - "type": "module" - }, - "Support": { - "color": "#2c3e50", - "icon": "icon-phone", - "link": "support-home", - "type": "module" - } - }, - "requires_framework_version": "==3.3.2" -} \ No newline at end of file diff --git a/accounts/__init__.py b/erpnext/__init__.py similarity index 100% rename from accounts/__init__.py rename to erpnext/__init__.py diff --git a/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt similarity index 100% rename from accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt rename to erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt diff --git a/accounts/Print Format/POS Invoice/POS Invoice.txt b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt similarity index 100% rename from accounts/Print Format/POS Invoice/POS Invoice.txt rename to erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt diff --git a/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt similarity index 100% rename from accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt rename to erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt diff --git a/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt similarity index 100% rename from accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt rename to erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt diff --git a/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt similarity index 100% rename from accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt rename to erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt diff --git a/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt similarity index 100% rename from accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt rename to erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt diff --git a/accounts/Print Format/SalesInvoice/SalesInvoice.html b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html similarity index 100% rename from accounts/Print Format/SalesInvoice/SalesInvoice.html rename to erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html diff --git a/accounts/Print Format/SalesInvoice/SalesInvoice.txt b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt similarity index 100% rename from accounts/Print Format/SalesInvoice/SalesInvoice.txt rename to erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt diff --git a/accounts/README.md b/erpnext/accounts/README.md similarity index 100% rename from accounts/README.md rename to erpnext/accounts/README.md diff --git a/accounts/doctype/accounts_settings/__init__.py b/erpnext/accounts/__init__.py similarity index 100% rename from accounts/doctype/accounts_settings/__init__.py rename to erpnext/accounts/__init__.py diff --git a/accounts/doctype/__init__.py b/erpnext/accounts/doctype/__init__.py similarity index 100% rename from accounts/doctype/__init__.py rename to erpnext/accounts/doctype/__init__.py diff --git a/accounts/doctype/account/README.md b/erpnext/accounts/doctype/account/README.md similarity index 100% rename from accounts/doctype/account/README.md rename to erpnext/accounts/doctype/account/README.md diff --git a/accounts/doctype/account/__init__.py b/erpnext/accounts/doctype/account/__init__.py similarity index 100% rename from accounts/doctype/account/__init__.py rename to erpnext/accounts/doctype/account/__init__.py diff --git a/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js similarity index 100% rename from accounts/doctype/account/account.js rename to erpnext/accounts/doctype/account/account.js diff --git a/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py similarity index 99% rename from accounts/doctype/account/account.py rename to erpnext/accounts/doctype/account/account.py index 0640ad97839..99d4f24f639 100644 --- a/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -206,7 +206,7 @@ class DocType: def before_rename(self, old, new, merge=False): # Add company abbr if not provided - from setup.doctype.company.company import get_name_with_abbr + from erpnext.setup.doctype.company.company import get_name_with_abbr new_account = get_name_with_abbr(new, self.doc.company) # Validate properties before merging diff --git a/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt similarity index 100% rename from accounts/doctype/account/account.txt rename to erpnext/accounts/doctype/account/account.txt diff --git a/accounts/doctype/account/test_account.py b/erpnext/accounts/doctype/account/test_account.py similarity index 100% rename from accounts/doctype/account/test_account.py rename to erpnext/accounts/doctype/account/test_account.py diff --git a/accounts/doctype/sales_invoice/templates/__init__.py b/erpnext/accounts/doctype/accounts_settings/__init__.py similarity index 100% rename from accounts/doctype/sales_invoice/templates/__init__.py rename to erpnext/accounts/doctype/accounts_settings/__init__.py diff --git a/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py similarity index 53% rename from accounts/doctype/accounts_settings/accounts_settings.py rename to erpnext/accounts/doctype/accounts_settings/accounts_settings.py index d55b022d2f1..a6e993863d6 100644 --- a/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -5,8 +5,7 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, cstr -from webnotes import msgprint, _ +from webnotes import _ class DocType: def __init__(self, d, dl): @@ -16,6 +15,11 @@ class DocType: webnotes.conn.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock) if self.doc.auto_accounting_for_stock: - for wh in webnotes.conn.sql("select name from `tabWarehouse`"): - wh_bean = webnotes.bean("Warehouse", wh[0]) + warehouse_list = webnotes.conn.sql("select name, company from tabWarehouse", as_dict=1) + warehouse_with_no_company = [d.name for d in warehouse_list if not d.company] + if warehouse_with_no_company: + webnotes.throw(_("Company is missing in following warehouses") + ": \n" + + "\n".join(warehouse_with_no_company)) + for wh in warehouse_list: + wh_bean = webnotes.bean("Warehouse", wh.name) wh_bean.save() \ No newline at end of file diff --git a/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt similarity index 100% rename from accounts/doctype/accounts_settings/accounts_settings.txt rename to erpnext/accounts/doctype/accounts_settings/accounts_settings.txt diff --git a/accounts/doctype/bank_reconciliation/README.md b/erpnext/accounts/doctype/bank_reconciliation/README.md similarity index 100% rename from accounts/doctype/bank_reconciliation/README.md rename to erpnext/accounts/doctype/bank_reconciliation/README.md diff --git a/accounts/doctype/bank_reconciliation/__init__.py b/erpnext/accounts/doctype/bank_reconciliation/__init__.py similarity index 100% rename from accounts/doctype/bank_reconciliation/__init__.py rename to erpnext/accounts/doctype/bank_reconciliation/__init__.py diff --git a/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js similarity index 100% rename from accounts/doctype/bank_reconciliation/bank_reconciliation.js rename to erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js diff --git a/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py similarity index 100% rename from accounts/doctype/bank_reconciliation/bank_reconciliation.py rename to erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py diff --git a/accounts/doctype/bank_reconciliation/bank_reconciliation.txt b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt similarity index 100% rename from accounts/doctype/bank_reconciliation/bank_reconciliation.txt rename to erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt diff --git a/accounts/doctype/bank_reconciliation_detail/README.md b/erpnext/accounts/doctype/bank_reconciliation_detail/README.md similarity index 100% rename from accounts/doctype/bank_reconciliation_detail/README.md rename to erpnext/accounts/doctype/bank_reconciliation_detail/README.md diff --git a/accounts/doctype/bank_reconciliation_detail/__init__.py b/erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py similarity index 100% rename from accounts/doctype/bank_reconciliation_detail/__init__.py rename to erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py diff --git a/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py similarity index 100% rename from accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py rename to erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py diff --git a/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt similarity index 100% rename from accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt rename to erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt diff --git a/accounts/doctype/budget_detail/README.md b/erpnext/accounts/doctype/budget_detail/README.md similarity index 100% rename from accounts/doctype/budget_detail/README.md rename to erpnext/accounts/doctype/budget_detail/README.md diff --git a/accounts/doctype/budget_detail/__init__.py b/erpnext/accounts/doctype/budget_detail/__init__.py similarity index 100% rename from accounts/doctype/budget_detail/__init__.py rename to erpnext/accounts/doctype/budget_detail/__init__.py diff --git a/accounts/doctype/budget_detail/budget_detail.py b/erpnext/accounts/doctype/budget_detail/budget_detail.py similarity index 100% rename from accounts/doctype/budget_detail/budget_detail.py rename to erpnext/accounts/doctype/budget_detail/budget_detail.py diff --git a/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.txt similarity index 100% rename from accounts/doctype/budget_detail/budget_detail.txt rename to erpnext/accounts/doctype/budget_detail/budget_detail.txt diff --git a/accounts/doctype/budget_distribution/README.md b/erpnext/accounts/doctype/budget_distribution/README.md similarity index 100% rename from accounts/doctype/budget_distribution/README.md rename to erpnext/accounts/doctype/budget_distribution/README.md diff --git a/accounts/doctype/budget_distribution/__init__.py b/erpnext/accounts/doctype/budget_distribution/__init__.py similarity index 100% rename from accounts/doctype/budget_distribution/__init__.py rename to erpnext/accounts/doctype/budget_distribution/__init__.py diff --git a/accounts/doctype/budget_distribution/budget_distribution.js b/erpnext/accounts/doctype/budget_distribution/budget_distribution.js similarity index 100% rename from accounts/doctype/budget_distribution/budget_distribution.js rename to erpnext/accounts/doctype/budget_distribution/budget_distribution.js diff --git a/accounts/doctype/budget_distribution/budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py similarity index 100% rename from accounts/doctype/budget_distribution/budget_distribution.py rename to erpnext/accounts/doctype/budget_distribution/budget_distribution.py diff --git a/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt similarity index 100% rename from accounts/doctype/budget_distribution/budget_distribution.txt rename to erpnext/accounts/doctype/budget_distribution/budget_distribution.txt diff --git a/accounts/doctype/budget_distribution/test_budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py similarity index 100% rename from accounts/doctype/budget_distribution/test_budget_distribution.py rename to erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py diff --git a/accounts/doctype/budget_distribution_detail/README.md b/erpnext/accounts/doctype/budget_distribution_detail/README.md similarity index 100% rename from accounts/doctype/budget_distribution_detail/README.md rename to erpnext/accounts/doctype/budget_distribution_detail/README.md diff --git a/accounts/doctype/budget_distribution_detail/__init__.py b/erpnext/accounts/doctype/budget_distribution_detail/__init__.py similarity index 100% rename from accounts/doctype/budget_distribution_detail/__init__.py rename to erpnext/accounts/doctype/budget_distribution_detail/__init__.py diff --git a/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py similarity index 100% rename from accounts/doctype/budget_distribution_detail/budget_distribution_detail.py rename to erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py diff --git a/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt similarity index 100% rename from accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt rename to erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt diff --git a/accounts/doctype/c_form/README.md b/erpnext/accounts/doctype/c_form/README.md similarity index 100% rename from accounts/doctype/c_form/README.md rename to erpnext/accounts/doctype/c_form/README.md diff --git a/accounts/doctype/c_form/__init__.py b/erpnext/accounts/doctype/c_form/__init__.py similarity index 100% rename from accounts/doctype/c_form/__init__.py rename to erpnext/accounts/doctype/c_form/__init__.py diff --git a/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js similarity index 100% rename from accounts/doctype/c_form/c_form.js rename to erpnext/accounts/doctype/c_form/c_form.js diff --git a/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py similarity index 98% rename from accounts/doctype/c_form/c_form.py rename to erpnext/accounts/doctype/c_form/c_form.py index 81d5a150a3a..80a9f44b3cd 100644 --- a/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -76,7 +76,7 @@ class DocType: } def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters): - from utilities import build_filter_conditions + from erpnext.utilities import build_filter_conditions conditions, filter_values = build_filter_conditions(filters) return webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus = 1 diff --git a/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt similarity index 100% rename from accounts/doctype/c_form/c_form.txt rename to erpnext/accounts/doctype/c_form/c_form.txt diff --git a/accounts/doctype/c_form_invoice_detail/README.md b/erpnext/accounts/doctype/c_form_invoice_detail/README.md similarity index 100% rename from accounts/doctype/c_form_invoice_detail/README.md rename to erpnext/accounts/doctype/c_form_invoice_detail/README.md diff --git a/accounts/doctype/c_form_invoice_detail/__init__.py b/erpnext/accounts/doctype/c_form_invoice_detail/__init__.py similarity index 100% rename from accounts/doctype/c_form_invoice_detail/__init__.py rename to erpnext/accounts/doctype/c_form_invoice_detail/__init__.py diff --git a/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py similarity index 100% rename from accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py rename to erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py diff --git a/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt similarity index 100% rename from accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt rename to erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt diff --git a/accounts/doctype/cost_center/README.md b/erpnext/accounts/doctype/cost_center/README.md similarity index 100% rename from accounts/doctype/cost_center/README.md rename to erpnext/accounts/doctype/cost_center/README.md diff --git a/accounts/doctype/cost_center/__init__.py b/erpnext/accounts/doctype/cost_center/__init__.py similarity index 100% rename from accounts/doctype/cost_center/__init__.py rename to erpnext/accounts/doctype/cost_center/__init__.py diff --git a/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js similarity index 100% rename from accounts/doctype/cost_center/cost_center.js rename to erpnext/accounts/doctype/cost_center/cost_center.js diff --git a/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py similarity index 98% rename from accounts/doctype/cost_center/cost_center.py rename to erpnext/accounts/doctype/cost_center/cost_center.py index 692d47e5aed..0d38cc820c8 100644 --- a/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -75,7 +75,7 @@ class DocType(DocTypeNestedSet): def before_rename(self, olddn, newdn, merge=False): # Add company abbr if not provided - from setup.doctype.company.company import get_name_with_abbr + from erpnext.setup.doctype.company.company import get_name_with_abbr new_cost_center = get_name_with_abbr(newdn, self.doc.company) # Validate properties before merging diff --git a/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt similarity index 100% rename from accounts/doctype/cost_center/cost_center.txt rename to erpnext/accounts/doctype/cost_center/cost_center.txt diff --git a/accounts/doctype/cost_center/test_cost_center.py b/erpnext/accounts/doctype/cost_center/test_cost_center.py similarity index 100% rename from accounts/doctype/cost_center/test_cost_center.py rename to erpnext/accounts/doctype/cost_center/test_cost_center.py diff --git a/accounts/doctype/fiscal_year/README.md b/erpnext/accounts/doctype/fiscal_year/README.md similarity index 100% rename from accounts/doctype/fiscal_year/README.md rename to erpnext/accounts/doctype/fiscal_year/README.md diff --git a/accounts/doctype/fiscal_year/__init__.py b/erpnext/accounts/doctype/fiscal_year/__init__.py similarity index 100% rename from accounts/doctype/fiscal_year/__init__.py rename to erpnext/accounts/doctype/fiscal_year/__init__.py diff --git a/accounts/doctype/fiscal_year/fiscal_year.js b/erpnext/accounts/doctype/fiscal_year/fiscal_year.js similarity index 100% rename from accounts/doctype/fiscal_year/fiscal_year.js rename to erpnext/accounts/doctype/fiscal_year/fiscal_year.js diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py similarity index 95% rename from accounts/doctype/fiscal_year/fiscal_year.py rename to erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 55e414cb27d..a09e9731bc2 100644 --- a/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -26,8 +26,7 @@ class DocType: if year_start_end_dates: if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]: - webnotes.throw(_("Cannot change Year Start Date and Year End Date \ - once the Fiscal Year is saved.")) + webnotes.throw(_("Cannot change Year Start Date and Year End Date once the Fiscal Year is saved.")) def on_update(self): # validate year start date and year end date @@ -43,5 +42,4 @@ class DocType: for fiscal_year, ysd, yed in year_start_end_dates: if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \ and (not webnotes.flags.in_test): - webnotes.throw(_("Year Start Date and Year End Date are already \ - set in Fiscal Year: ") + fiscal_year) \ No newline at end of file + webnotes.throw(_("Year Start Date and Year End Date are already set in Fiscal Year: ") + fiscal_year) \ No newline at end of file diff --git a/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt similarity index 100% rename from accounts/doctype/fiscal_year/fiscal_year.txt rename to erpnext/accounts/doctype/fiscal_year/fiscal_year.txt diff --git a/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py similarity index 100% rename from accounts/doctype/fiscal_year/test_fiscal_year.py rename to erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py diff --git a/accounts/doctype/gl_entry/README.md b/erpnext/accounts/doctype/gl_entry/README.md similarity index 100% rename from accounts/doctype/gl_entry/README.md rename to erpnext/accounts/doctype/gl_entry/README.md diff --git a/accounts/doctype/gl_entry/__init__.py b/erpnext/accounts/doctype/gl_entry/__init__.py similarity index 100% rename from accounts/doctype/gl_entry/__init__.py rename to erpnext/accounts/doctype/gl_entry/__init__.py diff --git a/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py similarity index 94% rename from accounts/doctype/gl_entry/gl_entry.py rename to erpnext/accounts/doctype/gl_entry/gl_entry.py index d3c63177878..ff44d555ff8 100644 --- a/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -50,7 +50,7 @@ class DocType: self.doc.cost_center = None def validate_posting_date(self): - from accounts.utils import validate_fiscal_year + from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") def check_pl_account(self): @@ -152,10 +152,7 @@ def validate_frozen_account(account, adv_adj): frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None, 'frozen_accounts_modifier') if not frozen_accounts_modifier: - webnotes.throw(account + _(" is a frozen account. \ - Either make the account active or assign role in Accounts Settings \ - who can create / modify entries against this account")) + webnotes.throw(account + _(" is a frozen account. Either make the account active or assign role in Accounts Settings who can create / modify entries against this account")) elif frozen_accounts_modifier not in webnotes.user.get_roles(): - webnotes.throw(account + _(" is a frozen account. ") + - _("To create / edit transactions against this account, you need role") + ": " + - frozen_accounts_modifier) \ No newline at end of file + webnotes.throw(account + _(" is a frozen account. To create / edit transactions against this account, you need role") \ + + ": " + frozen_accounts_modifier) diff --git a/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.txt similarity index 100% rename from accounts/doctype/gl_entry/gl_entry.txt rename to erpnext/accounts/doctype/gl_entry/gl_entry.txt diff --git a/accounts/doctype/journal_voucher/README.md b/erpnext/accounts/doctype/journal_voucher/README.md similarity index 100% rename from accounts/doctype/journal_voucher/README.md rename to erpnext/accounts/doctype/journal_voucher/README.md diff --git a/accounts/doctype/journal_voucher/__init__.py b/erpnext/accounts/doctype/journal_voucher/__init__.py similarity index 100% rename from accounts/doctype/journal_voucher/__init__.py rename to erpnext/accounts/doctype/journal_voucher/__init__.py diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js similarity index 96% rename from accounts/doctype/journal_voucher/journal_voucher.js rename to erpnext/accounts/doctype/journal_voucher/journal_voucher.js index 6b94ba170ad..1eb8b1d7304 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js @@ -166,7 +166,7 @@ cur_frm.cscript.account = function(doc,dt,dn) { var d = locals[dt][dn]; if(d.account) { return wn.call({ - method: "accounts.utils.get_balance_on", + method: "erpnext.accounts.utils.get_balance_on", args: {account: d.account, date: doc.posting_date}, callback: function(r) { d.balance = r.message; @@ -209,7 +209,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) { return wn.call({ type: "GET", - method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account", + method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account", args: { "voucher_type": doc.voucher_type, "company": doc.company @@ -223,7 +223,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { } else if(doc.voucher_type=="Opening Entry") { return wn.call({ type:"GET", - method: "accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts", + method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts", args: { "company": doc.company }, diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py similarity index 97% rename from accounts/doctype/journal_voucher/journal_voucher.py rename to erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 00cbc036511..4d00dfd4726 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -8,9 +8,9 @@ from webnotes.utils import cint, cstr, flt, fmt_money, formatdate, getdate from webnotes.model.doc import addchild from webnotes.model.bean import getlist from webnotes import msgprint, _ -from setup.utils import get_company_currency +from erpnext.setup.utils import get_company_currency -from controllers.accounts_controller import AccountsController +from erpnext.controllers.accounts_controller import AccountsController class DocType(AccountsController): def __init__(self,d,dl): @@ -47,7 +47,7 @@ class DocType(AccountsController): self.check_credit_limit() def on_cancel(self): - from accounts.utils import remove_against_link_from_jv + from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_jv") self.make_gl_entries(1) @@ -236,11 +236,10 @@ class DocType(AccountsController): if d.against_voucher and webnotes.conn.get_value("Purchase Invoice", d.against_voucher, "credit_to") != d.account: - webnotes.throw(_("Debited account (Supplier) is not matching with \ - Purchase Invoice")) + webnotes.throw(_("Debited account (Supplier) is not matching with Purchase Invoice")) def make_gl_entries(self, cancel=0, adv_adj=0): - from accounts.general_ledger import make_gl_entries + from erpnext.accounts.general_ledger import make_gl_entries gl_map = [] for d in self.doclist.get({"parentfield": "entries"}): if d.debit or d.credit: @@ -334,7 +333,7 @@ class DocType(AccountsController): @webnotes.whitelist() def get_default_bank_cash_account(company, voucher_type): - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on account = webnotes.conn.get_value("Company", company, voucher_type=="Bank Voucher" and "default_bank_account" or "default_cash_account") if account: @@ -345,7 +344,7 @@ def get_default_bank_cash_account(company, voucher_type): @webnotes.whitelist() def get_payment_entry_from_sales_invoice(sales_invoice): - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on si = webnotes.bean("Sales Invoice", sales_invoice) jv = get_payment_entry(si.doc) jv.doc.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.doc.fields @@ -363,7 +362,7 @@ def get_payment_entry_from_sales_invoice(sales_invoice): @webnotes.whitelist() def get_payment_entry_from_purchase_invoice(purchase_invoice): - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on pi = webnotes.bean("Purchase Invoice", purchase_invoice) jv = get_payment_entry(pi.doc) jv.doc.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.doc.fields @@ -407,7 +406,7 @@ def get_payment_entry(doc): @webnotes.whitelist() def get_opening_accounts(company): """get all balance sheet accounts for opening entry""" - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on accounts = webnotes.conn.sql_list("""select name from tabAccount where group_or_ledger='Ledger' and is_pl_account='No' and company=%s""", company) diff --git a/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt similarity index 100% rename from accounts/doctype/journal_voucher/journal_voucher.txt rename to erpnext/accounts/doctype/journal_voucher/journal_voucher.txt diff --git a/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py similarity index 95% rename from accounts/doctype/journal_voucher/test_journal_voucher.py rename to erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 70fb4e220e6..587445f2ef4 100644 --- a/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -34,14 +34,14 @@ class TestJournalVoucher(unittest.TestCase): where against_jv=%s""", jv_invoice.doc.name)) def test_jv_against_stock_account(self): - from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory set_perpetual_inventory() jv = webnotes.bean(copy=test_records[0]) jv.doclist[1].account = "_Test Warehouse - _TC" jv.insert() - from accounts.general_ledger import StockAccountInvalidTransaction + from erpnext.accounts.general_ledger import StockAccountInvalidTransaction self.assertRaises(StockAccountInvalidTransaction, jv.submit) set_perpetual_inventory(0) @@ -61,7 +61,7 @@ class TestJournalVoucher(unittest.TestCase): {"voucher_type": "Journal Voucher", "voucher_no": jv.doc.name})) def test_monthly_budget_crossed_stop(self): - from accounts.utils import BudgetError + from erpnext.accounts.utils import BudgetError webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() @@ -77,7 +77,7 @@ class TestJournalVoucher(unittest.TestCase): webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") def test_yearly_budget_crossed_stop(self): - from accounts.utils import BudgetError + from erpnext.accounts.utils import BudgetError self.clear_account_balance() self.test_monthly_budget_crossed_ignore() @@ -96,7 +96,7 @@ class TestJournalVoucher(unittest.TestCase): webnotes.conn.set_value("Company", "_Test Company", "yearly_bgt_flag", "Ignore") def test_monthly_budget_on_cancellation(self): - from accounts.utils import BudgetError + from erpnext.accounts.utils import BudgetError webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() diff --git a/accounts/doctype/journal_voucher_detail/README.md b/erpnext/accounts/doctype/journal_voucher_detail/README.md similarity index 100% rename from accounts/doctype/journal_voucher_detail/README.md rename to erpnext/accounts/doctype/journal_voucher_detail/README.md diff --git a/accounts/doctype/journal_voucher_detail/__init__.py b/erpnext/accounts/doctype/journal_voucher_detail/__init__.py similarity index 100% rename from accounts/doctype/journal_voucher_detail/__init__.py rename to erpnext/accounts/doctype/journal_voucher_detail/__init__.py diff --git a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py similarity index 100% rename from accounts/doctype/journal_voucher_detail/journal_voucher_detail.py rename to erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py diff --git a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt similarity index 100% rename from accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt rename to erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt diff --git a/accounts/doctype/mis_control/README.md b/erpnext/accounts/doctype/mis_control/README.md similarity index 100% rename from accounts/doctype/mis_control/README.md rename to erpnext/accounts/doctype/mis_control/README.md diff --git a/accounts/doctype/mis_control/__init__.py b/erpnext/accounts/doctype/mis_control/__init__.py similarity index 100% rename from accounts/doctype/mis_control/__init__.py rename to erpnext/accounts/doctype/mis_control/__init__.py diff --git a/accounts/doctype/mis_control/mis_control.py b/erpnext/accounts/doctype/mis_control/mis_control.py similarity index 97% rename from accounts/doctype/mis_control/mis_control.py rename to erpnext/accounts/doctype/mis_control/mis_control.py index 3a0483f0565..d2c09613a9e 100644 --- a/accounts/doctype/mis_control/mis_control.py +++ b/erpnext/accounts/doctype/mis_control/mis_control.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import flt, get_first_day, get_last_day, has_common import webnotes.defaults -from accounts.utils import get_balance_on +from erpnext.accounts.utils import get_balance_on class DocType: def __init__(self, doc, doclist): @@ -29,7 +29,7 @@ class DocType: ret['period'] = ['Annual','Half Yearly','Quarterly','Monthly'] - from accounts.page.accounts_browser.accounts_browser import get_companies + from erpnext.accounts.page.accounts_browser.accounts_browser import get_companies ret['company'] = get_companies() #--- to get fiscal year and start_date of that fiscal year ----- diff --git a/accounts/doctype/mis_control/mis_control.txt b/erpnext/accounts/doctype/mis_control/mis_control.txt similarity index 100% rename from accounts/doctype/mis_control/mis_control.txt rename to erpnext/accounts/doctype/mis_control/mis_control.txt diff --git a/accounts/doctype/mode_of_payment/README.md b/erpnext/accounts/doctype/mode_of_payment/README.md similarity index 100% rename from accounts/doctype/mode_of_payment/README.md rename to erpnext/accounts/doctype/mode_of_payment/README.md diff --git a/accounts/doctype/mode_of_payment/__init__.py b/erpnext/accounts/doctype/mode_of_payment/__init__.py similarity index 100% rename from accounts/doctype/mode_of_payment/__init__.py rename to erpnext/accounts/doctype/mode_of_payment/__init__.py diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.js b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js similarity index 100% rename from accounts/doctype/mode_of_payment/mode_of_payment.js rename to erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py similarity index 100% rename from accounts/doctype/mode_of_payment/mode_of_payment.py rename to erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt similarity index 100% rename from accounts/doctype/mode_of_payment/mode_of_payment.txt rename to erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt diff --git a/accounts/doctype/payment_to_invoice_matching_tool/README.md b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/README.md similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool/README.md rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/README.md diff --git a/accounts/doctype/payment_to_invoice_matching_tool/__init__.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/__init__.py similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool/__init__.py rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/__init__.py diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py similarity index 98% rename from accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index dea5fb59c97..0c6cdb6a78f 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -121,14 +121,14 @@ class DocType: lst.append(args) if lst: - from accounts.utils import reconcile_against_document + from erpnext.accounts.utils import reconcile_against_document reconcile_against_document(lst) msgprint("Successfully allocated.") else: msgprint("No amount allocated.", raise_exception=1) def gl_entry_details(doctype, txt, searchfield, start, page_len, filters): - from controllers.queries import get_match_cond + from erpnext.controllers.queries import get_match_cond return webnotes.conn.sql("""select gle.voucher_no, gle.posting_date, gle.%(account_type)s from `tabGL Entry` gle diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt diff --git a/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py diff --git a/accounts/doctype/payment_to_invoice_matching_tool_detail/README.md b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/README.md similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool_detail/README.md rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/README.md diff --git a/accounts/doctype/payment_to_invoice_matching_tool_detail/__init__.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/__init__.py similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool_detail/__init__.py rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/__init__.py diff --git a/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py diff --git a/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt similarity index 100% rename from accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt diff --git a/accounts/doctype/period_closing_voucher/README.md b/erpnext/accounts/doctype/period_closing_voucher/README.md similarity index 100% rename from accounts/doctype/period_closing_voucher/README.md rename to erpnext/accounts/doctype/period_closing_voucher/README.md diff --git a/accounts/doctype/period_closing_voucher/__init__.py b/erpnext/accounts/doctype/period_closing_voucher/__init__.py similarity index 100% rename from accounts/doctype/period_closing_voucher/__init__.py rename to erpnext/accounts/doctype/period_closing_voucher/__init__.py diff --git a/accounts/doctype/period_closing_voucher/period_closing_voucher.js b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js similarity index 100% rename from accounts/doctype/period_closing_voucher/period_closing_voucher.js rename to erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js diff --git a/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py similarity index 94% rename from accounts/doctype/period_closing_voucher/period_closing_voucher.py rename to erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 5d7fc1e8672..5a37d84cdce 100644 --- a/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, flt, getdate from webnotes import msgprint, _ -from controllers.accounts_controller import AccountsController +from erpnext.controllers.accounts_controller import AccountsController class DocType(AccountsController): def __init__(self,d,dl): @@ -33,7 +33,7 @@ class DocType(AccountsController): _("must be a Liability account")) def validate_posting_date(self): - from accounts.utils import get_fiscal_year + from erpnext.accounts.utils import get_fiscal_year self.year_start_date = get_fiscal_year(self.doc.posting_date, self.doc.fiscal_year)[1] pce = webnotes.conn.sql("""select name from `tabPeriod Closing Voucher` @@ -64,8 +64,7 @@ class DocType(AccountsController): expense_bal = expense_bal and expense_bal[0][0] or 0 if not income_bal and not expense_bal: - webnotes.throw(_("Both Income and Expense balances are zero. \ - No Need to make Period Closing Entry.")) + webnotes.throw(_("Both Income and Expense balances are zero. No Need to make Period Closing Entry.")) def get_pl_balances(self): """Get balance for pl accounts""" @@ -99,5 +98,5 @@ class DocType(AccountsController): "credit": abs(net_pl_balance) if net_pl_balance < 0 else 0 })) - from accounts.general_ledger import make_gl_entries + from erpnext.accounts.general_ledger import make_gl_entries make_gl_entries(gl_entries) diff --git a/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt similarity index 100% rename from accounts/doctype/period_closing_voucher/period_closing_voucher.txt rename to erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt diff --git a/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py similarity index 94% rename from accounts/doctype/period_closing_voucher/test_period_closing_voucher.py rename to erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 97e49ae8602..c779d9be86d 100644 --- a/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -11,7 +11,7 @@ class TestPeriodClosingVoucher(unittest.TestCase): # clear GL Entries webnotes.conn.sql("""delete from `tabGL Entry`""") - from accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records + from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records jv = webnotes.bean(copy=jv_records[2]) jv.insert() jv.submit() diff --git a/accounts/doctype/pos_setting/README.md b/erpnext/accounts/doctype/pos_setting/README.md similarity index 100% rename from accounts/doctype/pos_setting/README.md rename to erpnext/accounts/doctype/pos_setting/README.md diff --git a/accounts/doctype/pos_setting/__init__.py b/erpnext/accounts/doctype/pos_setting/__init__.py similarity index 100% rename from accounts/doctype/pos_setting/__init__.py rename to erpnext/accounts/doctype/pos_setting/__init__.py diff --git a/accounts/doctype/pos_setting/pos_setting.js b/erpnext/accounts/doctype/pos_setting/pos_setting.js similarity index 100% rename from accounts/doctype/pos_setting/pos_setting.js rename to erpnext/accounts/doctype/pos_setting/pos_setting.js diff --git a/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py similarity index 100% rename from accounts/doctype/pos_setting/pos_setting.py rename to erpnext/accounts/doctype/pos_setting/pos_setting.py diff --git a/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt similarity index 100% rename from accounts/doctype/pos_setting/pos_setting.txt rename to erpnext/accounts/doctype/pos_setting/pos_setting.txt diff --git a/accounts/doctype/pos_setting/test_pos_setting.py b/erpnext/accounts/doctype/pos_setting/test_pos_setting.py similarity index 100% rename from accounts/doctype/pos_setting/test_pos_setting.py rename to erpnext/accounts/doctype/pos_setting/test_pos_setting.py diff --git a/accounts/doctype/purchase_invoice/README.md b/erpnext/accounts/doctype/purchase_invoice/README.md similarity index 100% rename from accounts/doctype/purchase_invoice/README.md rename to erpnext/accounts/doctype/purchase_invoice/README.md diff --git a/accounts/doctype/purchase_invoice/__init__.py b/erpnext/accounts/doctype/purchase_invoice/__init__.py similarity index 100% rename from accounts/doctype/purchase_invoice/__init__.py rename to erpnext/accounts/doctype/purchase_invoice/__init__.py diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js similarity index 90% rename from accounts/doctype/purchase_invoice/purchase_invoice.js rename to erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 0bdc70e13de..aa3b45f899a 100644 --- a/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() { @@ -45,7 +45,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ cur_frm.add_custom_button(wn._('From Purchase Order'), function() { wn.model.map_current_doc({ - method: "buying.doctype.purchase_order.purchase_order.make_purchase_invoice", + method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice", source_doctype: "Purchase Order", get_query_filters: { supplier: cur_frm.doc.supplier || undefined, @@ -60,7 +60,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ cur_frm.add_custom_button(wn._('From Purchase Receipt'), function() { wn.model.map_current_doc({ - method: "stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice", + method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice", source_doctype: "Purchase Receipt", get_query_filters: { supplier: cur_frm.doc.supplier || undefined, @@ -108,7 +108,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) { cur_frm.cscript.make_bank_voucher = function() { return wn.call({ - method: "accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_purchase_invoice", + method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_purchase_invoice", args: { "purchase_invoice": cur_frm.doc.name, }, @@ -134,7 +134,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/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py similarity index 97% rename from accounts/doctype/purchase_invoice/purchase_invoice.py rename to erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 404627af259..f6b6ef4035a 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -8,12 +8,12 @@ from webnotes.utils import add_days, cint, cstr, flt, formatdate from webnotes.model.bean import getlist from webnotes.model.code import get_obj from webnotes import msgprint, _ -from setup.utils import get_company_currency +from erpnext.setup.utils import get_company_currency import webnotes.defaults -from controllers.buying_controller import BuyingController +from erpnext.controllers.buying_controller import BuyingController class DocType(BuyingController): def __init__(self,d,dl): self.doc, self.doclist = d, dl @@ -289,7 +289,7 @@ class DocType(BuyingController): lst.append(args) if lst: - from accounts.utils import reconcile_against_document + from erpnext.accounts.utils import reconcile_against_document reconcile_against_document(lst) def on_submit(self): @@ -424,11 +424,11 @@ class DocType(BuyingController): ) if gl_entries: - from accounts.general_ledger import make_gl_entries + from erpnext.accounts.general_ledger import make_gl_entries make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2)) def on_cancel(self): - from accounts.utils import remove_against_link_from_jv + from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_voucher") self.update_prevdoc_status() @@ -454,7 +454,7 @@ class DocType(BuyingController): @webnotes.whitelist() def get_expense_account(doctype, txt, searchfield, start, page_len, filters): - from controllers.queries import get_match_cond + from erpnext.controllers.queries import get_match_cond # expense account can be any Debit account, # but can also be a Liability account with account_type='Expense Account' in special circumstances. diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt similarity index 100% rename from accounts/doctype/purchase_invoice/purchase_invoice.txt rename to erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt diff --git a/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js similarity index 100% rename from accounts/doctype/purchase_invoice/purchase_invoice_list.js rename to erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js diff --git a/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py similarity index 98% rename from accounts/doctype/purchase_invoice/test_purchase_invoice.py rename to erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 9d82ca78e96..8a8b4a7b6e3 100644 --- a/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -9,7 +9,7 @@ import webnotes.model import json from webnotes.utils import cint import webnotes.defaults -from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory test_dependencies = ["Item", "Cost Center"] test_ignore = ["Serial No"] @@ -171,7 +171,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(tax.total, expected_values[i][2]) def test_purchase_invoice_with_advance(self): - from accounts.doctype.journal_voucher.test_journal_voucher \ + from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records jv = webnotes.bean(copy=jv_test_records[1]) diff --git a/accounts/doctype/purchase_invoice_advance/README.md b/erpnext/accounts/doctype/purchase_invoice_advance/README.md similarity index 100% rename from accounts/doctype/purchase_invoice_advance/README.md rename to erpnext/accounts/doctype/purchase_invoice_advance/README.md diff --git a/accounts/doctype/purchase_invoice_advance/__init__.py b/erpnext/accounts/doctype/purchase_invoice_advance/__init__.py similarity index 100% rename from accounts/doctype/purchase_invoice_advance/__init__.py rename to erpnext/accounts/doctype/purchase_invoice_advance/__init__.py diff --git a/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py similarity index 100% rename from accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py rename to erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py diff --git a/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt similarity index 100% rename from accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt rename to erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt diff --git a/accounts/doctype/purchase_invoice_item/README.md b/erpnext/accounts/doctype/purchase_invoice_item/README.md similarity index 100% rename from accounts/doctype/purchase_invoice_item/README.md rename to erpnext/accounts/doctype/purchase_invoice_item/README.md diff --git a/accounts/doctype/purchase_invoice_item/__init__.py b/erpnext/accounts/doctype/purchase_invoice_item/__init__.py similarity index 100% rename from accounts/doctype/purchase_invoice_item/__init__.py rename to erpnext/accounts/doctype/purchase_invoice_item/__init__.py diff --git a/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py similarity index 100% rename from accounts/doctype/purchase_invoice_item/purchase_invoice_item.py rename to erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py diff --git a/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt similarity index 100% rename from accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt rename to erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt diff --git a/accounts/doctype/purchase_taxes_and_charges/README.md b/erpnext/accounts/doctype/purchase_taxes_and_charges/README.md similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges/README.md rename to erpnext/accounts/doctype/purchase_taxes_and_charges/README.md diff --git a/accounts/doctype/purchase_taxes_and_charges/__init__.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/__init__.py similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges/__init__.py rename to erpnext/accounts/doctype/purchase_taxes_and_charges/__init__.py diff --git a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py rename to erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py diff --git a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt rename to erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt diff --git a/accounts/doctype/purchase_taxes_and_charges_master/README.md b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/README.md similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges_master/README.md rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/README.md diff --git a/accounts/doctype/purchase_taxes_and_charges_master/__init__.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/__init__.py similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges_master/__init__.py rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/__init__.py diff --git a/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 similarity index 98% rename from accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js index 84521eda09f..b589651f18f 100644 --- a/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/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py diff --git a/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt similarity index 100% rename from accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt diff --git a/accounts/doctype/sales_invoice/README.md b/erpnext/accounts/doctype/sales_invoice/README.md similarity index 100% rename from accounts/doctype/sales_invoice/README.md rename to erpnext/accounts/doctype/sales_invoice/README.md diff --git a/accounts/doctype/sales_invoice/__init__.py b/erpnext/accounts/doctype/sales_invoice/__init__.py similarity index 100% rename from accounts/doctype/sales_invoice/__init__.py rename to erpnext/accounts/doctype/sales_invoice/__init__.py diff --git a/accounts/doctype/sales_invoice/pos.js b/erpnext/accounts/doctype/sales_invoice/pos.js similarity index 98% rename from accounts/doctype/sales_invoice/pos.js rename to erpnext/accounts/doctype/sales_invoice/pos.js index adbdca1b633..c432765981a 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/erpnext/accounts/doctype/sales_invoice/pos.js @@ -199,7 +199,7 @@ erpnext.POS = Class.extend({ var me = this; me.item_timeout = null; wn.call({ - method: 'accounts.doctype.sales_invoice.pos.get_items', + method: 'erpnext.accounts.doctype.sales_invoice.pos.get_items', args: { sales_or_purchase: this.sales_or_purchase, price_list: this.price_list, @@ -450,7 +450,7 @@ erpnext.POS = Class.extend({ var me = this; me.barcode_timeout = null; wn.call({ - method: 'accounts.doctype.sales_invoice.pos.get_item_code', + method: 'erpnext.accounts.doctype.sales_invoice.pos.get_item_code', args: {barcode_serial_no: this.barcode.$input.val()}, callback: function(r) { if (r.message) { @@ -503,7 +503,7 @@ erpnext.POS = Class.extend({ msgprint(wn._("Payment cannot be made for empty cart")); else { wn.call({ - method: 'accounts.doctype.sales_invoice.pos.get_mode_of_payment', + method: 'erpnext.accounts.doctype.sales_invoice.pos.get_mode_of_payment', callback: function(r) { for (x=0; x<=r.message.length - 1; x++) { mode_of_payment.push(r.message[x].name); diff --git a/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py similarity index 100% rename from accounts/doctype/sales_invoice/pos.py rename to erpnext/accounts/doctype/sales_invoice/pos.py diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js similarity index 94% rename from accounts/doctype/sales_invoice/sales_invoice.js rename to erpnext/accounts/doctype/sales_invoice/sales_invoice.js index a390fb4ed76..9c6a9b223d3 100644 --- a/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({ @@ -91,7 +91,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte this.$sales_order_btn = cur_frm.appframe.add_primary_action(wn._('From Sales Order'), function() { wn.model.map_current_doc({ - method: "selling.doctype.sales_order.sales_order.make_sales_invoice", + method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", source_doctype: "Sales Order", get_query_filters: { docstatus: 1, @@ -108,7 +108,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte this.$delivery_note_btn = cur_frm.appframe.add_primary_action(wn._('From Delivery Note'), function() { wn.model.map_current_doc({ - method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice", + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", source_doctype: "Delivery Note", get_query: function() { var filters = { @@ -116,7 +116,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 }; } @@ -259,14 +259,14 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) { cur_frm.cscript['Make Delivery Note'] = function() { wn.model.open_mapped_doc({ - method: "accounts.doctype.sales_invoice.sales_invoice.make_delivery_note", + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note", source_name: cur_frm.doc.name }) } cur_frm.cscript.make_bank_voucher = function() { return wn.call({ - method: "accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_sales_invoice", + method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_sales_invoice", args: { "sales_invoice": cur_frm.doc.name }, @@ -325,7 +325,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/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py similarity index 98% rename from accounts/doctype/sales_invoice/sales_invoice.py rename to erpnext/accounts/doctype/sales_invoice/sales_invoice.py index bfba30fa1bd..f77abfe72a2 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -17,7 +17,7 @@ from webnotes import _, msgprint month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} -from controllers.selling_controller import SellingController +from erpnext.controllers.selling_controller import SellingController class DocType(SellingController): def __init__(self,d,dl): @@ -109,7 +109,7 @@ class DocType(SellingController): self.check_stop_sales_order("sales_order") - from accounts.utils import remove_against_link_from_jv + from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_invoice") self.update_status_updater_args() @@ -184,7 +184,7 @@ class DocType(SellingController): if cint(self.doc.is_pos) != 1: return - from selling.utils import get_pos_settings, apply_pos_settings + from erpnext.selling.utils import get_pos_settings, apply_pos_settings pos = get_pos_settings(self.doc.company) if pos: @@ -285,7 +285,7 @@ class DocType(SellingController): lst.append(args) if lst: - from accounts.utils import reconcile_against_document + from erpnext.accounts.utils import reconcile_against_document reconcile_against_document(lst) def validate_customer_account(self): @@ -465,7 +465,7 @@ class DocType(SellingController): if not d.warehouse: d.warehouse = cstr(w) - from stock.doctype.packed_item.packed_item import make_packing_list + from erpnext.stock.doctype.packed_item.packed_item import make_packing_list make_packing_list(self, 'entries') else: self.doclist = self.doc.clear_table(self.doclist, 'packing_details') @@ -512,7 +512,7 @@ class DocType(SellingController): gl_entries = self.get_gl_entries() if gl_entries: - from accounts.general_ledger import make_gl_entries + from erpnext.accounts.general_ledger import make_gl_entries update_outstanding = cint(self.doc.is_pos) and self.doc.write_off_account \ and 'No' or 'Yes' @@ -524,7 +524,7 @@ class DocType(SellingController): self.update_gl_entries_after() def get_gl_entries(self, warehouse_account=None): - from accounts.general_ledger import merge_similar_entries + from erpnext.accounts.general_ledger import merge_similar_entries gl_entries = [] @@ -739,7 +739,7 @@ def manage_recurring_invoices(next_date=None, commit=True): notify_errors(ref_invoice, ref_wrapper.doc.owner) webnotes.conn.commit() - exception_list.append(webnotes.getTraceback()) + exception_list.append(webnotes.get_traceback()) finally: if commit: webnotes.conn.begin() @@ -750,7 +750,7 @@ def manage_recurring_invoices(next_date=None, commit=True): def make_new_invoice(ref_wrapper, posting_date): from webnotes.model.bean import clone - from accounts.utils import get_fiscal_year + from erpnext.accounts.utils import get_fiscal_year new_invoice = clone(ref_wrapper) mcount = month_map[ref_wrapper.doc.recurring_type] @@ -904,7 +904,7 @@ def get_bank_cash_account(mode_of_payment): @webnotes.whitelist() def get_income_account(doctype, txt, searchfield, start, page_len, filters): - from controllers.queries import get_match_cond + from erpnext.controllers.queries import get_match_cond # income account can be any Credit account, # but can also be a Asset account with account_type='Income Account' in special circumstances. diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt similarity index 100% rename from accounts/doctype/sales_invoice/sales_invoice.txt rename to erpnext/accounts/doctype/sales_invoice/sales_invoice.txt diff --git a/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js similarity index 100% rename from accounts/doctype/sales_invoice/sales_invoice_list.js rename to erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js diff --git a/accounts/doctype/sales_invoice/sales_invoice_map.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_map.js similarity index 100% rename from accounts/doctype/sales_invoice/sales_invoice_map.js rename to erpnext/accounts/doctype/sales_invoice/sales_invoice_map.js diff --git a/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py similarity index 96% rename from accounts/doctype/sales_invoice/test_sales_invoice.py rename to erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 9b740d1061b..478ed3c4faa 100644 --- a/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -5,8 +5,8 @@ import webnotes import unittest, json from webnotes.utils import flt from webnotes.model.bean import DocstatusTransitionError, TimestampMismatchError -from accounts.utils import get_stock_and_account_difference -from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory +from erpnext.accounts.utils import get_stock_and_account_difference +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory class TestSalesInvoice(unittest.TestCase): def make(self): @@ -262,7 +262,7 @@ class TestSalesInvoice(unittest.TestCase): webnotes.conn.sql("""delete from `tabGL Entry`""") w = self.make() - from accounts.doctype.journal_voucher.test_journal_voucher \ + from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records jv = webnotes.bean(webnotes.copy_doclist(jv_test_records[0])) @@ -399,7 +399,7 @@ class TestSalesInvoice(unittest.TestCase): webnotes.delete_doc("Account", "_Test Warehouse No Account - _TC") # insert purchase receipt - from stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records pr = webnotes.bean(copy=pr_test_records[0]) pr.doc.naming_series = "_T-Purchase Receipt-" @@ -505,7 +505,7 @@ class TestSalesInvoice(unittest.TestCase): set_perpetual_inventory(0) def _insert_purchase_receipt(self): - from stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records pr = webnotes.bean(copy=pr_test_records[0]) pr.doc.naming_series = "_T-Purchase Receipt-" @@ -514,7 +514,7 @@ class TestSalesInvoice(unittest.TestCase): pr.submit() def _insert_delivery_note(self): - from stock.doctype.delivery_note.test_delivery_note import test_records \ + from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ as dn_test_records dn = webnotes.bean(copy=dn_test_records[0]) dn.doc.naming_series = "_T-Delivery Note-" @@ -523,7 +523,7 @@ class TestSalesInvoice(unittest.TestCase): return dn def _insert_pos_settings(self): - from accounts.doctype.pos_setting.test_pos_setting \ + from erpnext.accounts.doctype.pos_setting.test_pos_setting \ import test_records as pos_setting_test_records webnotes.conn.sql("""delete from `tabPOS Setting`""") @@ -531,7 +531,7 @@ class TestSalesInvoice(unittest.TestCase): ps.insert() def test_sales_invoice_with_advance(self): - from accounts.doctype.journal_voucher.test_journal_voucher \ + from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records jv = webnotes.bean(copy=jv_test_records[0]) @@ -654,7 +654,7 @@ class TestSalesInvoice(unittest.TestCase): def _test_recurring_invoice(self, base_si, first_and_last_day): from webnotes.utils import add_months, get_last_day - from accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices + from erpnext.accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type] @@ -706,8 +706,8 @@ class TestSalesInvoice(unittest.TestCase): webnotes.conn.sql("delete from `tabGL Entry`") def test_serialized(self): - from stock.doctype.stock_entry.test_stock_entry import make_serialized_item - from stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) @@ -728,7 +728,7 @@ class TestSalesInvoice(unittest.TestCase): return si def test_serialized_cancel(self): - from stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos si = self.test_serialized() si.cancel() @@ -740,8 +740,8 @@ class TestSalesInvoice(unittest.TestCase): "delivery_document_no")) def test_serialize_status(self): - from stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos - from stock.doctype.stock_entry.test_stock_entry import make_serialized_item + from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) diff --git a/accounts/doctype/sales_invoice_advance/README.md b/erpnext/accounts/doctype/sales_invoice_advance/README.md similarity index 100% rename from accounts/doctype/sales_invoice_advance/README.md rename to erpnext/accounts/doctype/sales_invoice_advance/README.md diff --git a/accounts/doctype/sales_invoice_advance/__init__.py b/erpnext/accounts/doctype/sales_invoice_advance/__init__.py similarity index 100% rename from accounts/doctype/sales_invoice_advance/__init__.py rename to erpnext/accounts/doctype/sales_invoice_advance/__init__.py diff --git a/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py similarity index 100% rename from accounts/doctype/sales_invoice_advance/sales_invoice_advance.py rename to erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py diff --git a/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt similarity index 100% rename from accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt rename to erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt diff --git a/accounts/doctype/sales_invoice_item/README.md b/erpnext/accounts/doctype/sales_invoice_item/README.md similarity index 100% rename from accounts/doctype/sales_invoice_item/README.md rename to erpnext/accounts/doctype/sales_invoice_item/README.md diff --git a/accounts/doctype/sales_invoice_item/__init__.py b/erpnext/accounts/doctype/sales_invoice_item/__init__.py similarity index 100% rename from accounts/doctype/sales_invoice_item/__init__.py rename to erpnext/accounts/doctype/sales_invoice_item/__init__.py diff --git a/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py similarity index 100% rename from accounts/doctype/sales_invoice_item/sales_invoice_item.py rename to erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py diff --git a/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt similarity index 100% rename from accounts/doctype/sales_invoice_item/sales_invoice_item.txt rename to erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt diff --git a/accounts/doctype/sales_taxes_and_charges/README.md b/erpnext/accounts/doctype/sales_taxes_and_charges/README.md similarity index 100% rename from accounts/doctype/sales_taxes_and_charges/README.md rename to erpnext/accounts/doctype/sales_taxes_and_charges/README.md diff --git a/accounts/doctype/sales_taxes_and_charges/__init__.py b/erpnext/accounts/doctype/sales_taxes_and_charges/__init__.py similarity index 100% rename from accounts/doctype/sales_taxes_and_charges/__init__.py rename to erpnext/accounts/doctype/sales_taxes_and_charges/__init__.py diff --git a/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py similarity index 100% rename from accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py rename to erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py diff --git a/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt similarity index 100% rename from accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt rename to erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt diff --git a/accounts/doctype/sales_taxes_and_charges_master/README.md b/erpnext/accounts/doctype/sales_taxes_and_charges_master/README.md similarity index 100% rename from accounts/doctype/sales_taxes_and_charges_master/README.md rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/README.md diff --git a/accounts/doctype/sales_taxes_and_charges_master/__init__.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/__init__.py similarity index 100% rename from accounts/doctype/sales_taxes_and_charges_master/__init__.py rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/__init__.py diff --git a/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 similarity index 97% rename from accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js index e2e50470283..0cdead90302 100644 --- a/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/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py similarity index 100% rename from accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt similarity index 100% rename from accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt diff --git a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py similarity index 100% rename from accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py diff --git a/accounts/doctype/sales_invoice/templates/pages/__init__.py b/erpnext/accounts/doctype/shipping_rule/__init__.py similarity index 100% rename from accounts/doctype/sales_invoice/templates/pages/__init__.py rename to erpnext/accounts/doctype/shipping_rule/__init__.py diff --git a/accounts/doctype/shipping_rule/shipping_rule.js b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js similarity index 100% rename from accounts/doctype/shipping_rule/shipping_rule.js rename to erpnext/accounts/doctype/shipping_rule/shipping_rule.js diff --git a/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py similarity index 98% rename from accounts/doctype/shipping_rule/shipping_rule.py rename to erpnext/accounts/doctype/shipping_rule/shipping_rule.py index dd4db5fb759..5c084f3c60d 100644 --- a/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -8,7 +8,7 @@ import webnotes from webnotes import _, msgprint from webnotes.utils import flt, fmt_money from webnotes.model.controller import DocListController -from setup.utils import get_company_currency +from erpnext.setup.utils import get_company_currency class OverlappingConditionError(webnotes.ValidationError): pass class FromGreaterThanToError(webnotes.ValidationError): pass diff --git a/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt similarity index 100% rename from accounts/doctype/shipping_rule/shipping_rule.txt rename to erpnext/accounts/doctype/shipping_rule/shipping_rule.txt diff --git a/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py similarity index 93% rename from accounts/doctype/shipping_rule/test_shipping_rule.py rename to erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index 8bac02be97e..6bf6bd386e3 100644 --- a/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -3,7 +3,7 @@ import webnotes import unittest -from accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError +from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): diff --git a/accounts/doctype/shipping_rule/__init__.py b/erpnext/accounts/doctype/shipping_rule_condition/__init__.py similarity index 100% rename from accounts/doctype/shipping_rule/__init__.py rename to erpnext/accounts/doctype/shipping_rule_condition/__init__.py diff --git a/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py similarity index 100% rename from accounts/doctype/shipping_rule_condition/shipping_rule_condition.py rename to erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py diff --git a/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt similarity index 100% rename from accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt rename to erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt diff --git a/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py similarity index 96% rename from accounts/general_ledger.py rename to erpnext/accounts/general_ledger.py index 575a2b02c6c..5451642ff51 100644 --- a/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import flt, cstr from webnotes import _ -from accounts.utils import validate_expense_against_budget +from erpnext.accounts.utils import validate_expense_against_budget class StockAccountInvalidTransaction(webnotes.ValidationError): pass @@ -103,7 +103,7 @@ def validate_account_for_auto_accounting_for_stock(gl_map): def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None, adv_adj=False, update_outstanding="Yes"): - from accounts.doctype.gl_entry.gl_entry import check_negative_balance, \ + from erpnext.accounts.doctype.gl_entry.gl_entry import check_negative_balance, \ check_freezing_date, update_outstanding_amt, validate_frozen_account if not gl_entries: diff --git a/accounts/page/__init__.py b/erpnext/accounts/page/__init__.py similarity index 100% rename from accounts/page/__init__.py rename to erpnext/accounts/page/__init__.py diff --git a/accounts/page/accounts_browser/README.md b/erpnext/accounts/page/accounts_browser/README.md similarity index 100% rename from accounts/page/accounts_browser/README.md rename to erpnext/accounts/page/accounts_browser/README.md diff --git a/accounts/page/accounts_browser/__init__.py b/erpnext/accounts/page/accounts_browser/__init__.py similarity index 100% rename from accounts/page/accounts_browser/__init__.py rename to erpnext/accounts/page/accounts_browser/__init__.py diff --git a/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js similarity index 97% rename from accounts/page/accounts_browser/accounts_browser.js rename to erpnext/accounts/page/accounts_browser/accounts_browser.js index 66a40b160e8..c4213325717 100644 --- a/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -62,7 +62,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){ // load up companies return wn.call({ - method:'accounts.page.accounts_browser.accounts_browser.get_companies', + method: 'erpnext.accounts.page.accounts_browser.accounts_browser.get_companies', callback: function(r) { wrapper.$company_select.empty(); $.each(r.message, function(i, v) { @@ -107,7 +107,7 @@ erpnext.AccountsChart = Class.extend({ parent: $(wrapper), label: ctype==="Account" ? "Accounts" : "Cost Centers", args: {ctype: ctype, comp: company}, - method: 'accounts.page.accounts_browser.accounts_browser.get_children', + method: 'erpnext.accounts.page.accounts_browser.accounts_browser.get_children', click: function(link) { if(me.cur_toolbar) $(me.cur_toolbar).toggle(false); @@ -261,7 +261,7 @@ erpnext.AccountsChart = Class.extend({ return wn.call({ args: v, - method:'accounts.utils.add_ac', + method: 'erpnext.accounts.utils.add_ac', callback: function(r) { $(btn).done_working(); d.hide(); @@ -308,7 +308,7 @@ erpnext.AccountsChart = Class.extend({ return wn.call({ args: v, - method:'accounts.utils.add_cc', + method: 'erpnext.accounts.utils.add_cc', callback: function(r) { $(btn).done_working(); d.hide(); diff --git a/accounts/page/accounts_browser/accounts_browser.py b/erpnext/accounts/page/accounts_browser/accounts_browser.py similarity index 96% rename from accounts/page/accounts_browser/accounts_browser.py rename to erpnext/accounts/page/accounts_browser/accounts_browser.py index 68a53b2923a..6dfbf4afe3c 100644 --- a/accounts/page/accounts_browser/accounts_browser.py +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes import webnotes.defaults from webnotes.utils import flt -from accounts.utils import get_balance_on +from erpnext.accounts.utils import get_balance_on @webnotes.whitelist() def get_companies(): diff --git a/accounts/page/accounts_browser/accounts_browser.txt b/erpnext/accounts/page/accounts_browser/accounts_browser.txt similarity index 100% rename from accounts/page/accounts_browser/accounts_browser.txt rename to erpnext/accounts/page/accounts_browser/accounts_browser.txt diff --git a/accounts/page/accounts_home/__init__.py b/erpnext/accounts/page/accounts_home/__init__.py similarity index 100% rename from accounts/page/accounts_home/__init__.py rename to erpnext/accounts/page/accounts_home/__init__.py diff --git a/accounts/page/accounts_home/accounts_home.js b/erpnext/accounts/page/accounts_home/accounts_home.js similarity index 100% rename from accounts/page/accounts_home/accounts_home.js rename to erpnext/accounts/page/accounts_home/accounts_home.js diff --git a/accounts/page/accounts_home/accounts_home.txt b/erpnext/accounts/page/accounts_home/accounts_home.txt similarity index 100% rename from accounts/page/accounts_home/accounts_home.txt rename to erpnext/accounts/page/accounts_home/accounts_home.txt diff --git a/accounts/page/financial_analytics/README.md b/erpnext/accounts/page/financial_analytics/README.md similarity index 100% rename from accounts/page/financial_analytics/README.md rename to erpnext/accounts/page/financial_analytics/README.md diff --git a/accounts/page/financial_analytics/__init__.py b/erpnext/accounts/page/financial_analytics/__init__.py similarity index 100% rename from accounts/page/financial_analytics/__init__.py rename to erpnext/accounts/page/financial_analytics/__init__.py diff --git a/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js similarity index 99% rename from accounts/page/financial_analytics/financial_analytics.js rename to erpnext/accounts/page/financial_analytics/financial_analytics.js index 7fe050762d3..4c7c6444c1d 100644 --- a/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/accounts/page/financial_analytics/financial_analytics.txt b/erpnext/accounts/page/financial_analytics/financial_analytics.txt similarity index 100% rename from accounts/page/financial_analytics/financial_analytics.txt rename to erpnext/accounts/page/financial_analytics/financial_analytics.txt diff --git a/accounts/page/financial_statements/README.md b/erpnext/accounts/page/financial_statements/README.md similarity index 100% rename from accounts/page/financial_statements/README.md rename to erpnext/accounts/page/financial_statements/README.md diff --git a/accounts/page/financial_statements/__init__.py b/erpnext/accounts/page/financial_statements/__init__.py similarity index 100% rename from accounts/page/financial_statements/__init__.py rename to erpnext/accounts/page/financial_statements/__init__.py diff --git a/accounts/page/financial_statements/financial_statements.js b/erpnext/accounts/page/financial_statements/financial_statements.js similarity index 100% rename from accounts/page/financial_statements/financial_statements.js rename to erpnext/accounts/page/financial_statements/financial_statements.js diff --git a/accounts/page/financial_statements/financial_statements.txt b/erpnext/accounts/page/financial_statements/financial_statements.txt similarity index 100% rename from accounts/page/financial_statements/financial_statements.txt rename to erpnext/accounts/page/financial_statements/financial_statements.txt diff --git a/accounts/page/trial_balance/README.md b/erpnext/accounts/page/trial_balance/README.md similarity index 100% rename from accounts/page/trial_balance/README.md rename to erpnext/accounts/page/trial_balance/README.md diff --git a/accounts/page/trial_balance/__init__.py b/erpnext/accounts/page/trial_balance/__init__.py similarity index 100% rename from accounts/page/trial_balance/__init__.py rename to erpnext/accounts/page/trial_balance/__init__.py diff --git a/accounts/page/trial_balance/trial_balance.js b/erpnext/accounts/page/trial_balance/trial_balance.js similarity index 96% rename from accounts/page/trial_balance/trial_balance.js rename to erpnext/accounts/page/trial_balance/trial_balance.js index 83f56eb3cb6..34a06957d25 100644 --- a/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/accounts/page/trial_balance/trial_balance.txt b/erpnext/accounts/page/trial_balance/trial_balance.txt similarity index 100% rename from accounts/page/trial_balance/trial_balance.txt rename to erpnext/accounts/page/trial_balance/trial_balance.txt diff --git a/accounts/doctype/shipping_rule_condition/__init__.py b/erpnext/accounts/report/__init__.py similarity index 100% rename from accounts/doctype/shipping_rule_condition/__init__.py rename to erpnext/accounts/report/__init__.py diff --git a/accounts/report/__init__.py b/erpnext/accounts/report/accounts_payable/__init__.py similarity index 100% rename from accounts/report/__init__.py rename to erpnext/accounts/report/accounts_payable/__init__.py diff --git a/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js similarity index 100% rename from accounts/report/accounts_payable/accounts_payable.js rename to erpnext/accounts/report/accounts_payable/accounts_payable.js diff --git a/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py similarity index 96% rename from accounts/report/accounts_payable/accounts_payable.py rename to erpnext/accounts/report/accounts_payable/accounts_payable.py index e5489d100f8..070148bc16a 100644 --- a/accounts/report/accounts_payable/accounts_payable.py +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import getdate, nowdate, flt, cstr from webnotes import msgprint, _ -from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data +from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data def execute(filters=None): if not filters: filters = {} @@ -93,8 +93,7 @@ def get_conditions(filters, before_report_date=True): if supplier_accounts: conditions += " and account in (%s)" % (", ".join(['%s']*len(supplier_accounts))) else: - msgprint(_("No Supplier Accounts found. Supplier Accounts are identified based on \ - 'Master Type' value in account record."), raise_exception=1) + msgprint(_("No Supplier Accounts found. Supplier Accounts are identified based on 'Master Type' value in account record."), raise_exception=1) if filters.get("report_date"): if before_report_date: diff --git a/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.txt similarity index 100% rename from accounts/report/accounts_payable/accounts_payable.txt rename to erpnext/accounts/report/accounts_payable/accounts_payable.txt diff --git a/accounts/report/accounts_payable/__init__.py b/erpnext/accounts/report/accounts_payable/general_ledger/__init__.py similarity index 100% rename from accounts/report/accounts_payable/__init__.py rename to erpnext/accounts/report/accounts_payable/general_ledger/__init__.py diff --git a/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.js similarity index 100% rename from accounts/report/general_ledger/general_ledger.js rename to erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.js diff --git a/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py similarity index 90% rename from accounts/report/general_ledger/general_ledger.py rename to erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py index e76c0c4bf91..575ccda9fa9 100644 --- a/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py @@ -5,12 +5,13 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import flt, add_days from webnotes import _ -from accounts.utils import get_balance_on +from erpnext.accounts.utils import get_balance_on def execute(filters=None): account_details = webnotes.conn.get_value("Account", filters["account"], - ["debit_or_credit", "group_or_ledger"], as_dict=True) - validate_filters(filters, account_details.group_or_ledger) + ["debit_or_credit", "group_or_ledger"], as_dict=True) if filters.get("account") else None + validate_filters(filters, account_details) + columns = get_columns() data = [] if filters.get("group_by"): @@ -20,14 +21,15 @@ def execute(filters=None): if data: data.append(get_total_row(data)) - if filters.get("account"): + if account_details: data = [get_opening_balance_row(filters, account_details.debit_or_credit)] + data + \ [get_closing_balance_row(filters, account_details.debit_or_credit)] return columns, data -def validate_filters(filters, group_or_ledger): - if group_or_ledger == "Ledger" and filters.get("group_by") == "Group by Account": +def validate_filters(filters, account_details): + if account_details and account_details.group_or_ledger == "Ledger" \ + and filters.get("group_by") == "Group by Account": webnotes.throw(_("Can not filter based on Account, if grouped by Account")) if filters.get("voucher_no") and filters.get("group_by") == "Group by Voucher": diff --git a/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.txt similarity index 100% rename from accounts/report/general_ledger/general_ledger.txt rename to erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.txt diff --git a/accounts/report/accounts_receivable/__init__.py b/erpnext/accounts/report/accounts_receivable/__init__.py similarity index 100% rename from accounts/report/accounts_receivable/__init__.py rename to erpnext/accounts/report/accounts_receivable/__init__.py diff --git a/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js similarity index 100% rename from accounts/report/accounts_receivable/accounts_receivable.js rename to erpnext/accounts/report/accounts_receivable/accounts_receivable.js diff --git a/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py similarity index 100% rename from accounts/report/accounts_receivable/accounts_receivable.py rename to erpnext/accounts/report/accounts_receivable/accounts_receivable.py diff --git a/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt similarity index 100% rename from accounts/report/accounts_receivable/accounts_receivable.txt rename to erpnext/accounts/report/accounts_receivable/accounts_receivable.txt diff --git a/accounts/report/bank_clearance_summary/__init__.py b/erpnext/accounts/report/bank_clearance_summary/__init__.py similarity index 100% rename from accounts/report/bank_clearance_summary/__init__.py rename to erpnext/accounts/report/bank_clearance_summary/__init__.py diff --git a/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js similarity index 100% rename from accounts/report/bank_clearance_summary/bank_clearance_summary.js rename to erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js diff --git a/accounts/report/bank_clearance_summary/bank_clearance_summary.py b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py similarity index 100% rename from accounts/report/bank_clearance_summary/bank_clearance_summary.py rename to erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py diff --git a/accounts/report/bank_clearance_summary/bank_clearance_summary.txt b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt similarity index 100% rename from accounts/report/bank_clearance_summary/bank_clearance_summary.txt rename to erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt diff --git a/accounts/report/bank_reconciliation_statement/__init__.py b/erpnext/accounts/report/bank_reconciliation_statement/__init__.py similarity index 100% rename from accounts/report/bank_reconciliation_statement/__init__.py rename to erpnext/accounts/report/bank_reconciliation_statement/__init__.py diff --git a/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js similarity index 100% rename from accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js rename to erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js diff --git a/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py similarity index 97% rename from accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py rename to erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index 431a6496d2c..f2a1edda52e 100644 --- a/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -12,7 +12,7 @@ def execute(filters=None): columns = get_columns() data = get_entries(filters) - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on balance_as_per_company = get_balance_on(filters["account"], filters["report_date"]) total_debit, total_credit = 0,0 diff --git a/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt similarity index 100% rename from accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt rename to erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt diff --git a/accounts/report/budget_variance_report/__init__.py b/erpnext/accounts/report/budget_variance_report/__init__.py similarity index 100% rename from accounts/report/budget_variance_report/__init__.py rename to erpnext/accounts/report/budget_variance_report/__init__.py diff --git a/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js similarity index 100% rename from accounts/report/budget_variance_report/budget_variance_report.js rename to erpnext/accounts/report/budget_variance_report/budget_variance_report.js diff --git a/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py similarity index 97% rename from accounts/report/budget_variance_report/budget_variance_report.py rename to erpnext/accounts/report/budget_variance_report/budget_variance_report.py index a5860c83bd3..8d164f8c64a 100644 --- a/accounts/report/budget_variance_report/budget_variance_report.py +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py @@ -6,8 +6,8 @@ import webnotes from webnotes import _, msgprint from webnotes.utils import flt import time -from accounts.utils import get_fiscal_year -from controllers.trends import get_period_date_ranges, get_period_month_ranges +from erpnext.accounts.utils import get_fiscal_year +from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges def execute(filters=None): if not filters: filters = {} diff --git a/accounts/report/budget_variance_report/budget_variance_report.txt b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt similarity index 100% rename from accounts/report/budget_variance_report/budget_variance_report.txt rename to erpnext/accounts/report/budget_variance_report/budget_variance_report.txt diff --git a/accounts/report/customer_account_head/__init__.py b/erpnext/accounts/report/customer_account_head/__init__.py similarity index 100% rename from accounts/report/customer_account_head/__init__.py rename to erpnext/accounts/report/customer_account_head/__init__.py diff --git a/accounts/report/customer_account_head/customer_account_head.py b/erpnext/accounts/report/customer_account_head/customer_account_head.py similarity index 100% rename from accounts/report/customer_account_head/customer_account_head.py rename to erpnext/accounts/report/customer_account_head/customer_account_head.py diff --git a/accounts/report/customer_account_head/customer_account_head.txt b/erpnext/accounts/report/customer_account_head/customer_account_head.txt similarity index 100% rename from accounts/report/customer_account_head/customer_account_head.txt rename to erpnext/accounts/report/customer_account_head/customer_account_head.txt diff --git a/accounts/report/delivered_items_to_be_billed/__init__.py b/erpnext/accounts/report/delivered_items_to_be_billed/__init__.py similarity index 100% rename from accounts/report/delivered_items_to_be_billed/__init__.py rename to erpnext/accounts/report/delivered_items_to_be_billed/__init__.py diff --git a/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt similarity index 100% rename from accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt rename to erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt diff --git a/accounts/report/general_ledger/__init__.py b/erpnext/accounts/report/gross_profit/__init__.py similarity index 100% rename from accounts/report/general_ledger/__init__.py rename to erpnext/accounts/report/gross_profit/__init__.py diff --git a/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js similarity index 100% rename from accounts/report/gross_profit/gross_profit.js rename to erpnext/accounts/report/gross_profit/gross_profit.js diff --git a/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py similarity index 98% rename from accounts/report/gross_profit/gross_profit.py rename to erpnext/accounts/report/gross_profit/gross_profit.py index 8e730620495..4f7a1e4c6fc 100644 --- a/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import flt -from stock.utils import get_buying_amount, get_sales_bom_buying_amount +from erpnext.stock.utils import get_buying_amount, get_sales_bom_buying_amount def execute(filters=None): if not filters: filters = {} diff --git a/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.txt similarity index 100% rename from accounts/report/gross_profit/gross_profit.txt rename to erpnext/accounts/report/gross_profit/gross_profit.txt diff --git a/accounts/report/gross_profit/__init__.py b/erpnext/accounts/report/item_wise_purchase_register/__init__.py similarity index 100% rename from accounts/report/gross_profit/__init__.py rename to erpnext/accounts/report/item_wise_purchase_register/__init__.py diff --git a/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js similarity index 100% rename from accounts/report/item_wise_purchase_register/item_wise_purchase_register.js rename to erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js diff --git a/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py similarity index 100% rename from accounts/report/item_wise_purchase_register/item_wise_purchase_register.py rename to erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py diff --git a/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt similarity index 100% rename from accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt rename to erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt diff --git a/accounts/report/item_wise_purchase_register/__init__.py b/erpnext/accounts/report/item_wise_sales_register/__init__.py similarity index 100% rename from accounts/report/item_wise_purchase_register/__init__.py rename to erpnext/accounts/report/item_wise_sales_register/__init__.py diff --git a/accounts/report/item_wise_sales_register/item_wise_sales_register.js b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js similarity index 100% rename from accounts/report/item_wise_sales_register/item_wise_sales_register.js rename to erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js diff --git a/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py similarity index 100% rename from accounts/report/item_wise_sales_register/item_wise_sales_register.py rename to erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py diff --git a/accounts/report/item_wise_sales_register/item_wise_sales_register.txt b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt similarity index 100% rename from accounts/report/item_wise_sales_register/item_wise_sales_register.txt rename to erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt diff --git a/accounts/report/item_wise_sales_register/__init__.py b/erpnext/accounts/report/ordered_items_to_be_billed/__init__.py similarity index 100% rename from accounts/report/item_wise_sales_register/__init__.py rename to erpnext/accounts/report/ordered_items_to_be_billed/__init__.py diff --git a/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt similarity index 100% rename from accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt rename to erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt diff --git a/accounts/report/ordered_items_to_be_billed/__init__.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/__init__.py similarity index 100% rename from accounts/report/ordered_items_to_be_billed/__init__.py rename to erpnext/accounts/report/payment_period_based_on_invoice_date/__init__.py diff --git a/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js similarity index 100% rename from accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js rename to erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js diff --git a/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py similarity index 97% rename from accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py rename to erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py index 127336005a9..4662462a4e3 100644 --- a/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ -from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data +from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data def execute(filters=None): if not filters: filters = {} diff --git a/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt similarity index 100% rename from accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt rename to erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt diff --git a/accounts/report/payment_period_based_on_invoice_date/__init__.py b/erpnext/accounts/report/purchase_invoice_trends/__init__.py similarity index 100% rename from accounts/report/payment_period_based_on_invoice_date/__init__.py rename to erpnext/accounts/report/purchase_invoice_trends/__init__.py diff --git a/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js similarity index 77% rename from accounts/report/purchase_invoice_trends/purchase_invoice_trends.js rename to erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js index 183e16ab321..7ab4ffa8b49 100644 --- a/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/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py similarity index 86% rename from accounts/report/purchase_invoice_trends/purchase_invoice_trends.py rename to erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py index 4c38bed863b..458761884e5 100644 --- a/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from controllers.trends import get_columns,get_data +from erpnext.controllers.trends import get_columns,get_data def execute(filters=None): if not filters: filters ={} diff --git a/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt similarity index 100% rename from accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt rename to erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt diff --git a/accounts/report/purchase_invoice_trends/__init__.py b/erpnext/accounts/report/purchase_order_items_to_be_billed/__init__.py similarity index 100% rename from accounts/report/purchase_invoice_trends/__init__.py rename to erpnext/accounts/report/purchase_order_items_to_be_billed/__init__.py diff --git a/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt similarity index 100% rename from accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt rename to erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt diff --git a/accounts/report/purchase_order_items_to_be_billed/__init__.py b/erpnext/accounts/report/purchase_register/__init__.py similarity index 100% rename from accounts/report/purchase_order_items_to_be_billed/__init__.py rename to erpnext/accounts/report/purchase_register/__init__.py diff --git a/accounts/report/purchase_register/purchase_register.js b/erpnext/accounts/report/purchase_register/purchase_register.js similarity index 100% rename from accounts/report/purchase_register/purchase_register.js rename to erpnext/accounts/report/purchase_register/purchase_register.js diff --git a/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py similarity index 100% rename from accounts/report/purchase_register/purchase_register.py rename to erpnext/accounts/report/purchase_register/purchase_register.py diff --git a/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.txt similarity index 100% rename from accounts/report/purchase_register/purchase_register.txt rename to erpnext/accounts/report/purchase_register/purchase_register.txt diff --git a/accounts/report/purchase_register/__init__.py b/erpnext/accounts/report/received_items_to_be_billed/__init__.py similarity index 100% rename from accounts/report/purchase_register/__init__.py rename to erpnext/accounts/report/received_items_to_be_billed/__init__.py diff --git a/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt similarity index 100% rename from accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt rename to erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt diff --git a/accounts/report/received_items_to_be_billed/__init__.py b/erpnext/accounts/report/sales_invoice_trends/__init__.py similarity index 100% rename from accounts/report/received_items_to_be_billed/__init__.py rename to erpnext/accounts/report/sales_invoice_trends/__init__.py diff --git a/accounts/report/sales_invoice_trends/sales_invoice_trends.js b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js similarity index 78% rename from accounts/report/sales_invoice_trends/sales_invoice_trends.js rename to erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js index 3b004abc4f4..0ffb6e0f153 100644 --- a/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/accounts/report/sales_invoice_trends/sales_invoice_trends.py b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py similarity index 86% rename from accounts/report/sales_invoice_trends/sales_invoice_trends.py rename to erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py index 70c61d7206a..da7062319a9 100644 --- a/accounts/report/sales_invoice_trends/sales_invoice_trends.py +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from controllers.trends import get_columns,get_data +from erpnext.controllers.trends import get_columns,get_data def execute(filters=None): if not filters: filters ={} diff --git a/accounts/report/sales_invoice_trends/sales_invoice_trends.txt b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt similarity index 100% rename from accounts/report/sales_invoice_trends/sales_invoice_trends.txt rename to erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt diff --git a/accounts/report/sales_invoice_trends/__init__.py b/erpnext/accounts/report/sales_partners_commission/__init__.py similarity index 100% rename from accounts/report/sales_invoice_trends/__init__.py rename to erpnext/accounts/report/sales_partners_commission/__init__.py diff --git a/accounts/report/sales_partners_commission/sales_partners_commission.txt b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt similarity index 100% rename from accounts/report/sales_partners_commission/sales_partners_commission.txt rename to erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt diff --git a/accounts/report/sales_partners_commission/__init__.py b/erpnext/accounts/report/sales_register/__init__.py similarity index 100% rename from accounts/report/sales_partners_commission/__init__.py rename to erpnext/accounts/report/sales_register/__init__.py diff --git a/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js similarity index 100% rename from accounts/report/sales_register/sales_register.js rename to erpnext/accounts/report/sales_register/sales_register.js diff --git a/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py similarity index 100% rename from accounts/report/sales_register/sales_register.py rename to erpnext/accounts/report/sales_register/sales_register.py diff --git a/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.txt similarity index 100% rename from accounts/report/sales_register/sales_register.txt rename to erpnext/accounts/report/sales_register/sales_register.txt diff --git a/accounts/report/sales_register/__init__.py b/erpnext/accounts/report/supplier_account_head/__init__.py similarity index 100% rename from accounts/report/sales_register/__init__.py rename to erpnext/accounts/report/supplier_account_head/__init__.py diff --git a/accounts/report/supplier_account_head/supplier_account_head.py b/erpnext/accounts/report/supplier_account_head/supplier_account_head.py similarity index 100% rename from accounts/report/supplier_account_head/supplier_account_head.py rename to erpnext/accounts/report/supplier_account_head/supplier_account_head.py diff --git a/accounts/report/supplier_account_head/supplier_account_head.txt b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt similarity index 100% rename from accounts/report/supplier_account_head/supplier_account_head.txt rename to erpnext/accounts/report/supplier_account_head/supplier_account_head.txt diff --git a/accounts/utils.py b/erpnext/accounts/utils.py similarity index 99% rename from accounts/utils.py rename to erpnext/accounts/utils.py index 8971c80f998..6d74abd591c 100644 --- a/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -8,7 +8,7 @@ from webnotes.utils import nowdate, nowtime, cstr, flt, now, getdate, add_months from webnotes.model.doc import addchild from webnotes import msgprint, _ from webnotes.utils import formatdate -from utilities import build_filter_conditions +from erpnext.utilities import build_filter_conditions class FiscalYearError(webnotes.ValidationError): pass @@ -260,7 +260,7 @@ def fix_total_debit_credit(): (d.diff, d.voucher_type, d.voucher_no)) def get_stock_and_account_difference(account_list=None, posting_date=None): - from stock.utils import get_stock_balance_on + from erpnext.stock.utils import get_stock_balance_on if not posting_date: posting_date = nowdate() diff --git a/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt similarity index 100% rename from buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt rename to erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt diff --git a/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt similarity index 100% rename from buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt rename to erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt diff --git a/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt similarity index 100% rename from buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt rename to erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt diff --git a/buying/README.md b/erpnext/buying/README.md similarity index 100% rename from buying/README.md rename to erpnext/buying/README.md diff --git a/accounts/report/supplier_account_head/__init__.py b/erpnext/buying/__init__.py similarity index 100% rename from accounts/report/supplier_account_head/__init__.py rename to erpnext/buying/__init__.py diff --git a/buying/doctype/__init__.py b/erpnext/buying/doctype/__init__.py similarity index 100% rename from buying/doctype/__init__.py rename to erpnext/buying/doctype/__init__.py diff --git a/buying/__init__.py b/erpnext/buying/doctype/buying_settings/__init__.py similarity index 100% rename from buying/__init__.py rename to erpnext/buying/doctype/buying_settings/__init__.py diff --git a/buying/doctype/buying_settings/buying_settings.py b/erpnext/buying/doctype/buying_settings/buying_settings.py similarity index 88% rename from buying/doctype/buying_settings/buying_settings.py rename to erpnext/buying/doctype/buying_settings/buying_settings.py index 53e44795784..25d0f7238da 100644 --- a/buying/doctype/buying_settings/buying_settings.py +++ b/erpnext/buying/doctype/buying_settings/buying_settings.py @@ -14,6 +14,6 @@ class DocType: for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]: webnotes.conn.set_default(key, self.doc.fields.get(key, "")) - from setup.doctype.naming_series.naming_series import set_by_naming_series + from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Supplier", "supplier_name", self.doc.get("supp_master_name")=="Naming Series", hide_name_field=False) diff --git a/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.txt similarity index 100% rename from buying/doctype/buying_settings/buying_settings.txt rename to erpnext/buying/doctype/buying_settings/buying_settings.txt diff --git a/buying/doctype/purchase_common/README.md b/erpnext/buying/doctype/purchase_common/README.md similarity index 100% rename from buying/doctype/purchase_common/README.md rename to erpnext/buying/doctype/purchase_common/README.md diff --git a/buying/doctype/purchase_common/__init__.py b/erpnext/buying/doctype/purchase_common/__init__.py similarity index 100% rename from buying/doctype/purchase_common/__init__.py rename to erpnext/buying/doctype/purchase_common/__init__.py diff --git a/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js similarity index 97% rename from buying/doctype/purchase_common/purchase_common.js rename to erpnext/buying/doctype/purchase_common/purchase_common.js index 9661f6edafe..cc24925905b 100644 --- a/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' } } } @@ -112,7 +112,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove(); } else { return this.frm.call({ - method: "buying.utils.get_item_details", + method: "erpnext.buying.utils.get_item_details", child: item, args: { args: { @@ -178,7 +178,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ var item = wn.model.get_doc(cdt, cdn); if(item.item_code && item.uom) { return this.frm.call({ - method: "buying.utils.get_conversion_factor", + method: "erpnext.buying.utils.get_conversion_factor", child: item, args: { item_code: item.item_code, @@ -211,7 +211,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ var item = wn.model.get_doc(cdt, cdn); if(item.item_code && item.warehouse) { return this.frm.call({ - method: "buying.utils.get_projected_qty", + method: "erpnext.buying.utils.get_projected_qty", child: item, args: { item_code: item.item_code, diff --git a/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py similarity index 97% rename from buying/doctype/purchase_common/purchase_common.py rename to erpnext/buying/doctype/purchase_common/purchase_common.py index 8c4fbffe5bc..d967b2450de 100644 --- a/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -7,8 +7,9 @@ import webnotes from webnotes.utils import cstr, flt from webnotes.model.utils import getlist from webnotes import msgprint, _ -from buying.utils import get_last_purchase_details -from controllers.buying_controller import BuyingController + +from erpnext.buying.utils import get_last_purchase_details +from erpnext.controllers.buying_controller import BuyingController class DocType(BuyingController): def __init__(self, doc, doclist=None): @@ -92,7 +93,7 @@ class DocType(BuyingController): if not item: webnotes.throw("Item %s does not exist in Item Master." % cstr(d.item_code)) - from stock.utils import validate_end_of_life + from erpnext.stock.utils import validate_end_of_life validate_end_of_life(d.item_code, item[0][3]) # validate stock item diff --git a/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.txt similarity index 100% rename from buying/doctype/purchase_common/purchase_common.txt rename to erpnext/buying/doctype/purchase_common/purchase_common.txt diff --git a/buying/doctype/purchase_order/README.md b/erpnext/buying/doctype/purchase_order/README.md similarity index 100% rename from buying/doctype/purchase_order/README.md rename to erpnext/buying/doctype/purchase_order/README.md diff --git a/buying/doctype/purchase_order/__init__.py b/erpnext/buying/doctype/purchase_order/__init__.py similarity index 100% rename from buying/doctype/purchase_order/__init__.py rename to erpnext/buying/doctype/purchase_order/__init__.py diff --git a/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js similarity index 88% rename from buying/doctype/purchase_order/purchase_order.js rename to erpnext/buying/doctype/purchase_order/purchase_order.js index dad2864ab24..edf7c82555d 100644 --- a/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) { @@ -42,14 +42,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( make_purchase_receipt: function() { wn.model.open_mapped_doc({ - method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt", + method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt", source_name: cur_frm.doc.name }) }, make_purchase_invoice: function() { wn.model.open_mapped_doc({ - method: "buying.doctype.purchase_order.purchase_order.make_purchase_invoice", + method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice", source_name: cur_frm.doc.name }) }, @@ -58,7 +58,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( cur_frm.add_custom_button(wn._('From Material Request'), function() { wn.model.map_current_doc({ - method: "stock.doctype.material_request.material_request.make_purchase_order", + method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order", source_doctype: "Material Request", get_query_filters: { material_request_type: "Purchase", @@ -74,7 +74,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( cur_frm.add_custom_button(wn._('From Supplier Quotation'), function() { wn.model.map_current_doc({ - method: "buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order", + method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order", source_doctype: "Supplier Quotation", get_query_filters: { docstatus: 1, @@ -88,7 +88,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( cur_frm.add_custom_button(wn._('For Supplier'), function() { wn.model.map_current_doc({ - method: "stock.doctype.material_request.material_request.make_purchase_order_based_on_supplier", + method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order_based_on_supplier", source_doctype: "Supplier", get_query_filters: { docstatus: ["!=", 2], diff --git a/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py similarity index 97% rename from buying/doctype/purchase_order/purchase_order.py rename to erpnext/buying/doctype/purchase_order/purchase_order.py index 33d8b482348..ebfda853660 100644 --- a/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -10,7 +10,7 @@ from webnotes.model.code import get_obj from webnotes import msgprint -from controllers.buying_controller import BuyingController +from erpnext.controllers.buying_controller import BuyingController class DocType(BuyingController): def __init__(self, doc, doclist=[]): self.doc = doc @@ -35,8 +35,8 @@ class DocType(BuyingController): if not self.doc.status: self.doc.status = "Draft" - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) pc_obj = get_obj(dt='Purchase Common') @@ -83,7 +83,7 @@ class DocType(BuyingController): def update_bin(self, is_submit, is_stopped = 0): - from stock.utils import update_bin + from erpnext.stock.utils import update_bin pc_obj = get_obj('Purchase Common') for d in getlist(self.doclist, 'po_details'): #1. Check if is_stock_item == 'Yes' diff --git a/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt similarity index 100% rename from buying/doctype/purchase_order/purchase_order.txt rename to erpnext/buying/doctype/purchase_order/purchase_order.txt diff --git a/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py similarity index 91% rename from buying/doctype/purchase_order/test_purchase_order.py rename to erpnext/buying/doctype/purchase_order/test_purchase_order.py index f6c435c6fb0..3659f6ddeee 100644 --- a/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -10,7 +10,7 @@ from webnotes.utils import flt class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_receipt(self): - from buying.doctype.purchase_order.purchase_order import make_purchase_receipt + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt po = webnotes.bean(copy=test_records[0]).insert() @@ -33,7 +33,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_ordered_qty(self): webnotes.conn.sql("delete from tabBin") - from buying.doctype.purchase_order.purchase_order import make_purchase_receipt + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt po = webnotes.bean(copy=test_records[0]).insert() @@ -75,7 +75,7 @@ class TestPurchaseOrder(unittest.TestCase): "warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 0.0) def test_make_purchase_invocie(self): - from buying.doctype.purchase_order.purchase_order import make_purchase_invoice + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice po = webnotes.bean(copy=test_records[0]).insert() @@ -98,14 +98,14 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2) def test_warehouse_company_validation(self): - from stock.utils import InvalidWarehouseCompany + from erpnext.stock.utils import InvalidWarehouseCompany po = webnotes.bean(copy=test_records[0]) po.doc.company = "_Test Company 1" po.doc.conversion_rate = 0.0167 self.assertRaises(InvalidWarehouseCompany, po.insert) def test_uom_integer_validation(self): - from utilities.transaction_base import UOMMustBeIntegerError + from erpnext.utilities.transaction_base import UOMMustBeIntegerError po = webnotes.bean(copy=test_records[0]) po.doclist[1].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) diff --git a/buying/doctype/purchase_order_item/README.md b/erpnext/buying/doctype/purchase_order_item/README.md similarity index 100% rename from buying/doctype/purchase_order_item/README.md rename to erpnext/buying/doctype/purchase_order_item/README.md diff --git a/buying/doctype/purchase_order_item/__init__.py b/erpnext/buying/doctype/purchase_order_item/__init__.py similarity index 100% rename from buying/doctype/purchase_order_item/__init__.py rename to erpnext/buying/doctype/purchase_order_item/__init__.py diff --git a/buying/doctype/purchase_order_item/purchase_order_item.py b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py similarity index 100% rename from buying/doctype/purchase_order_item/purchase_order_item.py rename to erpnext/buying/doctype/purchase_order_item/purchase_order_item.py diff --git a/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt similarity index 100% rename from buying/doctype/purchase_order_item/purchase_order_item.txt rename to erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt diff --git a/buying/doctype/purchase_order_item_supplied/README.md b/erpnext/buying/doctype/purchase_order_item_supplied/README.md similarity index 100% rename from buying/doctype/purchase_order_item_supplied/README.md rename to erpnext/buying/doctype/purchase_order_item_supplied/README.md diff --git a/buying/doctype/purchase_order_item_supplied/__init__.py b/erpnext/buying/doctype/purchase_order_item_supplied/__init__.py similarity index 100% rename from buying/doctype/purchase_order_item_supplied/__init__.py rename to erpnext/buying/doctype/purchase_order_item_supplied/__init__.py diff --git a/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py similarity index 100% rename from buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py rename to erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py diff --git a/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt similarity index 100% rename from buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt rename to erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt diff --git a/buying/doctype/purchase_receipt_item_supplied/README.md b/erpnext/buying/doctype/purchase_receipt_item_supplied/README.md similarity index 100% rename from buying/doctype/purchase_receipt_item_supplied/README.md rename to erpnext/buying/doctype/purchase_receipt_item_supplied/README.md diff --git a/buying/doctype/purchase_receipt_item_supplied/__init__.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/__init__.py similarity index 100% rename from buying/doctype/purchase_receipt_item_supplied/__init__.py rename to erpnext/buying/doctype/purchase_receipt_item_supplied/__init__.py diff --git a/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py similarity index 100% rename from buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py rename to erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py diff --git a/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt similarity index 100% rename from buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt rename to erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt diff --git a/buying/doctype/quality_inspection/README.md b/erpnext/buying/doctype/quality_inspection/README.md similarity index 100% rename from buying/doctype/quality_inspection/README.md rename to erpnext/buying/doctype/quality_inspection/README.md diff --git a/buying/doctype/quality_inspection/__init__.py b/erpnext/buying/doctype/quality_inspection/__init__.py similarity index 100% rename from buying/doctype/quality_inspection/__init__.py rename to erpnext/buying/doctype/quality_inspection/__init__.py diff --git a/buying/doctype/quality_inspection/quality_inspection.js b/erpnext/buying/doctype/quality_inspection/quality_inspection.js similarity index 100% rename from buying/doctype/quality_inspection/quality_inspection.js rename to erpnext/buying/doctype/quality_inspection/quality_inspection.js diff --git a/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py similarity index 100% rename from buying/doctype/quality_inspection/quality_inspection.py rename to erpnext/buying/doctype/quality_inspection/quality_inspection.py diff --git a/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt similarity index 100% rename from buying/doctype/quality_inspection/quality_inspection.txt rename to erpnext/buying/doctype/quality_inspection/quality_inspection.txt diff --git a/buying/doctype/quality_inspection_reading/README.md b/erpnext/buying/doctype/quality_inspection_reading/README.md similarity index 100% rename from buying/doctype/quality_inspection_reading/README.md rename to erpnext/buying/doctype/quality_inspection_reading/README.md diff --git a/buying/doctype/quality_inspection_reading/__init__.py b/erpnext/buying/doctype/quality_inspection_reading/__init__.py similarity index 100% rename from buying/doctype/quality_inspection_reading/__init__.py rename to erpnext/buying/doctype/quality_inspection_reading/__init__.py diff --git a/buying/doctype/quality_inspection_reading/quality_inspection_reading.py b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py similarity index 100% rename from buying/doctype/quality_inspection_reading/quality_inspection_reading.py rename to erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py diff --git a/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt similarity index 100% rename from buying/doctype/quality_inspection_reading/quality_inspection_reading.txt rename to erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt diff --git a/buying/doctype/supplier/README.md b/erpnext/buying/doctype/supplier/README.md similarity index 100% rename from buying/doctype/supplier/README.md rename to erpnext/buying/doctype/supplier/README.md diff --git a/buying/doctype/supplier/__init__.py b/erpnext/buying/doctype/supplier/__init__.py similarity index 100% rename from buying/doctype/supplier/__init__.py rename to erpnext/buying/doctype/supplier/__init__.py diff --git a/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js similarity index 96% rename from buying/doctype/supplier/supplier.js rename to erpnext/buying/doctype/supplier/supplier.js index 061861643d9..e1780abee97 100644 --- a/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); @@ -38,7 +38,7 @@ cur_frm.cscript.make_dashboard = function(doc) { return wn.call({ type: "GET", - method:"buying.doctype.supplier.supplier.get_dashboard_info", + method: "erpnext.buying.doctype.supplier.supplier.get_dashboard_info", args: { supplier: cur_frm.doc.name }, diff --git a/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py similarity index 98% rename from buying/doctype/supplier/supplier.py rename to erpnext/buying/doctype/supplier/supplier.py index bef86650c57..99c73523600 100644 --- a/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -10,7 +10,7 @@ from webnotes import msgprint, _ from webnotes.model.doc import make_autoname -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self, doc, doclist=[]): @@ -159,7 +159,7 @@ class DocType(TransactionBase): self.delete_supplier_account() def before_rename(self, olddn, newdn, merge=False): - from accounts.utils import rename_account_for + from erpnext.accounts.utils import rename_account_for rename_account_for("Supplier", olddn, newdn, merge) def after_rename(self, olddn, newdn, merge=False): diff --git a/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt similarity index 100% rename from buying/doctype/supplier/supplier.txt rename to erpnext/buying/doctype/supplier/supplier.txt diff --git a/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py similarity index 100% rename from buying/doctype/supplier/test_supplier.py rename to erpnext/buying/doctype/supplier/test_supplier.py diff --git a/buying/doctype/supplier_quotation/README.md b/erpnext/buying/doctype/supplier_quotation/README.md similarity index 100% rename from buying/doctype/supplier_quotation/README.md rename to erpnext/buying/doctype/supplier_quotation/README.md diff --git a/buying/doctype/supplier_quotation/__init__.py b/erpnext/buying/doctype/supplier_quotation/__init__.py similarity index 100% rename from buying/doctype/supplier_quotation/__init__.py rename to erpnext/buying/doctype/supplier_quotation/__init__.py diff --git a/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js similarity index 82% rename from buying/doctype/supplier_quotation/supplier_quotation.js rename to erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index 92bf7a1b0cb..bc56abd9170 100644 --- a/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() { @@ -22,7 +22,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext cur_frm.add_custom_button(wn._('From Material Request'), function() { wn.model.map_current_doc({ - method: "stock.doctype.material_request.material_request.make_supplier_quotation", + method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation", source_doctype: "Material Request", get_query_filters: { material_request_type: "Purchase", @@ -38,7 +38,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext make_purchase_order: function() { wn.model.open_mapped_doc({ - method: "buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order", + method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order", source_name: cur_frm.doc.name }) } diff --git a/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py similarity index 93% rename from buying/doctype/supplier_quotation/supplier_quotation.py rename to erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index dc564b93757..b4562e08320 100644 --- a/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.model.code import get_obj -from controllers.buying_controller import BuyingController +from erpnext.controllers.buying_controller import BuyingController class DocType(BuyingController): def __init__(self, doc, doclist=None): self.doc, self.doclist = doc, doclist or [] @@ -17,8 +17,8 @@ class DocType(BuyingController): if not self.doc.status: self.doc.status = "Draft" - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) self.validate_common() diff --git a/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt similarity index 100% rename from buying/doctype/supplier_quotation/supplier_quotation.txt rename to erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt diff --git a/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py similarity index 94% rename from buying/doctype/supplier_quotation/test_supplier_quotation.py rename to erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 82ad42a702e..82444eae7c6 100644 --- a/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -9,7 +9,7 @@ import webnotes.defaults class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_order(self): - from buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order + from erpnext.buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order sq = webnotes.bean(copy=test_records[0]).insert() diff --git a/buying/doctype/supplier_quotation_item/README.md b/erpnext/buying/doctype/supplier_quotation_item/README.md similarity index 100% rename from buying/doctype/supplier_quotation_item/README.md rename to erpnext/buying/doctype/supplier_quotation_item/README.md diff --git a/buying/doctype/supplier_quotation_item/__init__.py b/erpnext/buying/doctype/supplier_quotation_item/__init__.py similarity index 100% rename from buying/doctype/supplier_quotation_item/__init__.py rename to erpnext/buying/doctype/supplier_quotation_item/__init__.py diff --git a/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py similarity index 100% rename from buying/doctype/supplier_quotation_item/supplier_quotation_item.py rename to erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py diff --git a/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt similarity index 100% rename from buying/doctype/supplier_quotation_item/supplier_quotation_item.txt rename to erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt diff --git a/buying/page/__init__.py b/erpnext/buying/page/__init__.py similarity index 100% rename from buying/page/__init__.py rename to erpnext/buying/page/__init__.py diff --git a/buying/page/buying_home/__init__.py b/erpnext/buying/page/buying_home/__init__.py similarity index 100% rename from buying/page/buying_home/__init__.py rename to erpnext/buying/page/buying_home/__init__.py diff --git a/buying/page/buying_home/buying_home.js b/erpnext/buying/page/buying_home/buying_home.js similarity index 100% rename from buying/page/buying_home/buying_home.js rename to erpnext/buying/page/buying_home/buying_home.js diff --git a/buying/page/buying_home/buying_home.txt b/erpnext/buying/page/buying_home/buying_home.txt similarity index 100% rename from buying/page/buying_home/buying_home.txt rename to erpnext/buying/page/buying_home/buying_home.txt diff --git a/buying/page/purchase_analytics/README.md b/erpnext/buying/page/purchase_analytics/README.md similarity index 100% rename from buying/page/purchase_analytics/README.md rename to erpnext/buying/page/purchase_analytics/README.md diff --git a/buying/page/purchase_analytics/__init__.py b/erpnext/buying/page/purchase_analytics/__init__.py similarity index 100% rename from buying/page/purchase_analytics/__init__.py rename to erpnext/buying/page/purchase_analytics/__init__.py diff --git a/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js similarity index 100% rename from buying/page/purchase_analytics/purchase_analytics.js rename to erpnext/buying/page/purchase_analytics/purchase_analytics.js diff --git a/buying/page/purchase_analytics/purchase_analytics.txt b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt similarity index 100% rename from buying/page/purchase_analytics/purchase_analytics.txt rename to erpnext/buying/page/purchase_analytics/purchase_analytics.txt diff --git a/buying/doctype/buying_settings/__init__.py b/erpnext/buying/report/__init__.py similarity index 100% rename from buying/doctype/buying_settings/__init__.py rename to erpnext/buying/report/__init__.py diff --git a/buying/report/__init__.py b/erpnext/buying/report/item_wise_purchase_history/__init__.py similarity index 100% rename from buying/report/__init__.py rename to erpnext/buying/report/item_wise_purchase_history/__init__.py diff --git a/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt similarity index 100% rename from buying/report/item_wise_purchase_history/item_wise_purchase_history.txt rename to erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt diff --git a/buying/report/item_wise_purchase_history/__init__.py b/erpnext/buying/report/purchase_order_trends/__init__.py similarity index 100% rename from buying/report/item_wise_purchase_history/__init__.py rename to erpnext/buying/report/purchase_order_trends/__init__.py diff --git a/buying/report/purchase_order_trends/purchase_order_trends.js b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js similarity index 77% rename from buying/report/purchase_order_trends/purchase_order_trends.js rename to erpnext/buying/report/purchase_order_trends/purchase_order_trends.js index 2c7ffc0c769..d5371d36f4c 100644 --- a/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/buying/report/purchase_order_trends/purchase_order_trends.py b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py similarity index 86% rename from buying/report/purchase_order_trends/purchase_order_trends.py rename to erpnext/buying/report/purchase_order_trends/purchase_order_trends.py index df8d7cf0d5a..1ecdab29d81 100644 --- a/buying/report/purchase_order_trends/purchase_order_trends.py +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from controllers.trends import get_columns,get_data +from erpnext.controllers.trends import get_columns,get_data def execute(filters=None): if not filters: filters ={} diff --git a/buying/report/purchase_order_trends/purchase_order_trends.txt b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt similarity index 100% rename from buying/report/purchase_order_trends/purchase_order_trends.txt rename to erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt diff --git a/buying/report/purchase_order_trends/__init__.py b/erpnext/buying/report/requested_items_to_be_ordered/__init__.py similarity index 100% rename from buying/report/purchase_order_trends/__init__.py rename to erpnext/buying/report/requested_items_to_be_ordered/__init__.py diff --git a/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt b/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt similarity index 100% rename from buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt rename to erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt diff --git a/buying/report/requested_items_to_be_ordered/__init__.py b/erpnext/buying/report/supplier_addresses_and_contacts/__init__.py similarity index 100% rename from buying/report/requested_items_to_be_ordered/__init__.py rename to erpnext/buying/report/supplier_addresses_and_contacts/__init__.py diff --git a/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt b/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt similarity index 100% rename from buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt rename to erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt diff --git a/buying/utils.py b/erpnext/buying/utils.py similarity index 98% rename from buying/utils.py rename to erpnext/buying/utils.py index 0d9c8fa8385..8a4ae3f304c 100644 --- a/buying/utils.py +++ b/erpnext/buying/utils.py @@ -83,7 +83,7 @@ def _get_basic_details(args, item_bean): return out def _get_price_list_rate(args, item_bean, meta): - from utilities.transaction_base import validate_currency + from erpnext.utilities.transaction_base import validate_currency item = item_bean.doc out = webnotes._dict() @@ -117,7 +117,7 @@ def _get_supplier_part_no(args, item_bean): return item_supplier and item_supplier[0].supplier_part_no or None def _validate_item_details(args, item): - from utilities.transaction_base import validate_item_fetch + from erpnext.utilities.transaction_base import validate_item_fetch validate_item_fetch(args, item) # validate if purchase item or subcontracted item diff --git a/buying/report/supplier_addresses_and_contacts/__init__.py b/erpnext/controllers/__init__.py similarity index 100% rename from buying/report/supplier_addresses_and_contacts/__init__.py rename to erpnext/controllers/__init__.py diff --git a/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py similarity index 98% rename from controllers/accounts_controller.py rename to erpnext/controllers/accounts_controller.py index 5388ee120a6..d48a7a6d171 100644 --- a/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -6,9 +6,9 @@ import webnotes from webnotes import _, msgprint from webnotes.utils import flt, cint, today, cstr from webnotes.model.code import get_obj -from setup.utils import get_company_currency -from accounts.utils import get_fiscal_year, validate_fiscal_year -from utilities.transaction_base import TransactionBase, validate_conversion_rate +from erpnext.setup.utils import get_company_currency +from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year +from erpnext.utilities.transaction_base import TransactionBase, validate_conversion_rate import json class AccountsController(TransactionBase): @@ -403,7 +403,7 @@ class AccountsController(TransactionBase): raise_exception=1) def get_company_default(self, fieldname): - from accounts.utils import get_company_default + from erpnext.accounts.utils import get_company_default return get_company_default(self.doc.company, fieldname) def get_stock_items(self): diff --git a/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py similarity index 97% rename from controllers/buying_controller.py rename to erpnext/controllers/buying_controller.py index ab9f45c08af..40de926ea0d 100644 --- a/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -6,10 +6,10 @@ import webnotes from webnotes import _, msgprint from webnotes.utils import flt, _round -from buying.utils import get_item_details -from setup.utils import get_company_currency +from erpnext.buying.utils import get_item_details +from erpnext.setup.utils import get_company_currency -from controllers.stock_controller import StockController +from erpnext.controllers.stock_controller import StockController class BuyingController(StockController): def onload_post_render(self): @@ -50,7 +50,7 @@ class BuyingController(StockController): break def validate_warehouse(self): - from stock.utils import validate_warehouse_company + from erpnext.stock.utils import validate_warehouse_company warehouses = list(set([d.warehouse for d in self.doclist.get({"doctype": self.tname}) if d.warehouse])) @@ -68,8 +68,7 @@ class BuyingController(StockController): self.doclist.get({"parentfield": "purchase_tax_details"}) if d.category in ["Valuation", "Valuation and Total"]] if tax_for_valuation: - webnotes.msgprint(_("""Tax Category can not be 'Valuation' or 'Valuation and Total' - as all items are non-stock items"""), raise_exception=1) + webnotes.msgprint(_("""Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items"""), raise_exception=1) def set_total_in_words(self): from webnotes.utils import money_in_words diff --git a/controllers/js/contact_address_common.js b/erpnext/controllers/js/contact_address_common.js similarity index 100% rename from controllers/js/contact_address_common.js rename to erpnext/controllers/js/contact_address_common.js diff --git a/controllers/queries.py b/erpnext/controllers/queries.py similarity index 99% rename from controllers/queries.py rename to erpnext/controllers/queries.py index 9d64d16719f..535ca3b80a3 100644 --- a/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -186,7 +186,7 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, }, { "start": start, "page_len": page_len, "txt": ("%%%s%%" % txt) }) def get_batch_no(doctype, txt, searchfield, start, page_len, filters): - from controllers.queries import get_match_cond + from erpnext.controllers.queries import get_match_cond if filters.has_key('warehouse'): return webnotes.conn.sql("""select batch_no from `tabStock Ledger Entry` sle diff --git a/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py similarity index 98% rename from controllers/selling_controller.py rename to erpnext/controllers/selling_controller.py index 67c14626627..f950f281811 100644 --- a/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -4,11 +4,11 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cint, flt, comma_or, _round, cstr -from setup.utils import get_company_currency -from selling.utils import get_item_details +from erpnext.setup.utils import get_company_currency +from erpnext.selling.utils import get_item_details from webnotes import msgprint, _ -from controllers.stock_controller import StockController +from erpnext.controllers.stock_controller import StockController class SellingController(StockController): def onload_post_render(self): diff --git a/controllers/status_updater.py b/erpnext/controllers/status_updater.py similarity index 100% rename from controllers/status_updater.py rename to erpnext/controllers/status_updater.py diff --git a/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py similarity index 96% rename from controllers/stock_controller.py rename to erpnext/controllers/stock_controller.py index 8a4a4029901..eff6491db39 100644 --- a/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -7,8 +7,8 @@ from webnotes.utils import cint, flt, cstr from webnotes import msgprint, _ import webnotes.defaults -from controllers.accounts_controller import AccountsController -from accounts.general_ledger import make_gl_entries, delete_gl_entries +from erpnext.controllers.accounts_controller import AccountsController +from erpnext.accounts.general_ledger import make_gl_entries, delete_gl_entries class StockController(AccountsController): def make_gl_entries(self, update_gl_entries_after=True): @@ -27,7 +27,7 @@ class StockController(AccountsController): def get_gl_entries(self, warehouse_account=None, default_expense_account=None, default_cost_center=None): - from accounts.general_ledger import process_gl_map + from erpnext.accounts.general_ledger import process_gl_map if not warehouse_account: warehouse_account = self.get_warehouse_account() @@ -160,7 +160,7 @@ class StockController(AccountsController): where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no)) def make_adjustment_entry(self, expected_gle, voucher_obj): - from accounts.utils import get_stock_and_account_difference + from erpnext.accounts.utils import get_stock_and_account_difference account_list = [d.account for d in expected_gle] acc_diff = get_stock_and_account_difference(account_list, expected_gle[0].posting_date) @@ -190,7 +190,7 @@ class StockController(AccountsController): ]) if gl_entries: - from accounts.general_ledger import make_gl_entries + from erpnext.accounts.general_ledger import make_gl_entries make_gl_entries(gl_entries) def check_expense_account(self, item): @@ -226,7 +226,7 @@ class StockController(AccountsController): return sl_dict def make_sl_entries(self, sl_entries, is_amended=None): - from stock.stock_ledger import make_sl_entries + from erpnext.stock.stock_ledger import make_sl_entries make_sl_entries(sl_entries, is_amended) def get_stock_ledger_entries(self, item_list=None, warehouse_list=None): diff --git a/controllers/trends.py b/erpnext/controllers/trends.py similarity index 100% rename from controllers/trends.py rename to erpnext/controllers/trends.py diff --git a/erpnext/desktop.json b/erpnext/desktop.json new file mode 100644 index 00000000000..67c4f998842 --- /dev/null +++ b/erpnext/desktop.json @@ -0,0 +1,72 @@ +{ + "Accounts": { + "color": "#3498db", + "icon": "icon-money", + "link": "accounts-home", + "type": "module" + }, + "Activity": { + "color": "#e67e22", + "icon": "icon-play", + "label": "Activity", + "link": "activity", + "type": "page" + }, + "Buying": { + "color": "#c0392b", + "icon": "icon-shopping-cart", + "link": "buying-home", + "type": "module" + }, + "HR": { + "color": "#2ecc71", + "icon": "icon-group", + "label": "Human Resources", + "link": "hr-home", + "type": "module" + }, + "Manufacturing": { + "color": "#7f8c8d", + "icon": "icon-cogs", + "link": "manufacturing-home", + "type": "module" + }, + "Notes": { + "color": "#95a5a6", + "doctype": "Note", + "icon": "icon-file-alt", + "label": "Notes", + "link": "List/Note", + "type": "list" + }, + "Projects": { + "color": "#8e44ad", + "icon": "icon-puzzle-piece", + "link": "projects-home", + "type": "module" + }, + "Selling": { + "color": "#1abc9c", + "icon": "icon-tag", + "link": "selling-home", + "type": "module" + }, + "Setup": { + "color": "#bdc3c7", + "icon": "icon-wrench", + "link": "Setup", + "type": "setup" + }, + "Stock": { + "color": "#f39c12", + "icon": "icon-truck", + "link": "stock-home", + "type": "module" + }, + "Support": { + "color": "#2c3e50", + "icon": "icon-phone", + "link": "support-home", + "type": "module" + } +} \ No newline at end of file diff --git a/home/__init__.py b/erpnext/home/__init__.py similarity index 89% rename from home/__init__.py rename to erpnext/home/__init__.py index 9667efd2128..e092a71ff4e 100644 --- a/home/__init__.py +++ b/erpnext/home/__init__.py @@ -29,8 +29,8 @@ feed_dict = { 'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], # Purchase - 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], - 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], + 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], + 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], # Stock 'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'], @@ -89,3 +89,9 @@ def update_feed(controller, method=None): subject, color = feed_dict.get(doc.doctype, [None, None]) if subject: make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color) + +def make_comment_feed(bean, method): + """add comment to feed""" + doc = bean.doc + make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by, + '"' + doc.comment + '"', '#6B24B3') \ No newline at end of file diff --git a/home/doctype/__init__.py b/erpnext/home/doctype/__init__.py similarity index 100% rename from home/doctype/__init__.py rename to erpnext/home/doctype/__init__.py diff --git a/home/doctype/feed/README.md b/erpnext/home/doctype/feed/README.md similarity index 100% rename from home/doctype/feed/README.md rename to erpnext/home/doctype/feed/README.md diff --git a/home/doctype/feed/__init__.py b/erpnext/home/doctype/feed/__init__.py similarity index 100% rename from home/doctype/feed/__init__.py rename to erpnext/home/doctype/feed/__init__.py diff --git a/home/doctype/feed/feed.py b/erpnext/home/doctype/feed/feed.py similarity index 100% rename from home/doctype/feed/feed.py rename to erpnext/home/doctype/feed/feed.py diff --git a/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt similarity index 100% rename from home/doctype/feed/feed.txt rename to erpnext/home/doctype/feed/feed.txt diff --git a/home/page/__init__.py b/erpnext/home/page/__init__.py similarity index 100% rename from home/page/__init__.py rename to erpnext/home/page/__init__.py diff --git a/home/page/activity/README.md b/erpnext/home/page/activity/README.md similarity index 100% rename from home/page/activity/README.md rename to erpnext/home/page/activity/README.md diff --git a/home/page/activity/__init__.py b/erpnext/home/page/activity/__init__.py similarity index 100% rename from home/page/activity/__init__.py rename to erpnext/home/page/activity/__init__.py diff --git a/home/page/activity/activity.css b/erpnext/home/page/activity/activity.css similarity index 100% rename from home/page/activity/activity.css rename to erpnext/home/page/activity/activity.css diff --git a/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js similarity index 97% rename from home/page/activity/activity.js rename to erpnext/home/page/activity/activity.js index c4b0cf3073c..91b8184ab0d 100644 --- a/home/page/activity/activity.js +++ b/erpnext/home/page/activity/activity.js @@ -12,7 +12,7 @@ wn.pages['activity'].onload = function(wrapper) { var list = new wn.ui.Listing({ hide_refresh: true, appframe: wrapper.appframe, - method: 'home.page.activity.activity.get_feed', + method: 'erpnext.home.page.activity.activity.get_feed', parent: $(wrapper).find(".layout-main"), render_row: function(row, data) { new erpnext.ActivityFeed(row, data); diff --git a/home/page/activity/activity.py b/erpnext/home/page/activity/activity.py similarity index 100% rename from home/page/activity/activity.py rename to erpnext/home/page/activity/activity.py diff --git a/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt similarity index 100% rename from home/page/activity/activity.txt rename to erpnext/home/page/activity/activity.txt diff --git a/home/page/latest_updates/README.md b/erpnext/home/page/latest_updates/README.md similarity index 100% rename from home/page/latest_updates/README.md rename to erpnext/home/page/latest_updates/README.md diff --git a/controllers/__init__.py b/erpnext/home/page/latest_updates/__init__.py similarity index 100% rename from controllers/__init__.py rename to erpnext/home/page/latest_updates/__init__.py diff --git a/home/page/latest_updates/latest_updates.js b/erpnext/home/page/latest_updates/latest_updates.js similarity index 96% rename from home/page/latest_updates/latest_updates.js rename to erpnext/home/page/latest_updates/latest_updates.js index 80ba85e6a05..06c34efa082 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/erpnext/home/page/latest_updates/latest_updates.js @@ -13,7 +13,7 @@ wn.pages['latest-updates'].onload = function(wrapper) {
') return wn.call({ - method:"home.page.latest_updates.latest_updates.get", + method: "erpnext.home.page.latest_updates.latest_updates.get", callback: function(r) { parent.empty(); $(""+wn._("Report issues at")+ diff --git a/home/page/latest_updates/latest_updates.py b/erpnext/home/page/latest_updates/latest_updates.py similarity index 100% rename from home/page/latest_updates/latest_updates.py rename to erpnext/home/page/latest_updates/latest_updates.py diff --git a/home/page/latest_updates/latest_updates.txt b/erpnext/home/page/latest_updates/latest_updates.txt similarity index 100% rename from home/page/latest_updates/latest_updates.txt rename to erpnext/home/page/latest_updates/latest_updates.txt diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt new file mode 100644 index 00000000000..af11df97b17 --- /dev/null +++ b/erpnext/hooks.txt @@ -0,0 +1,64 @@ +app_name ERPNext +app_publisher Web Notes Technologies +app_description Open Source Enterprise Resource Planning for Small and Midsized Organizations +app_icon icon-th +app_color #e74c3c +app_version 4.0.0-wip + +app_include_js assets/js/erpnext.min.js +app_include_css assets/css/erpnext.css +web_include_js assets/js/erpnext-web.min.js + +after_install erpnext.setup.install.after_install + +boot_session erpnext.startup.boot.boot_session +notification_config erpnext.startup.notifications.get_notification_config + +dump_report_map erpnext.startup.report_data_map.data_map +update_website_context erpnext.startup.webutils.update_website_context + +mail_footer erpnext.startup.mail_footer + +on_session_creation erpnext.startup.event_handlers.on_session_creation +on_logout erpnext.startup.event_handlers.on_logut + +# Bean Events +# ----------- + +bean_event *:on_update:erpnext.home.update_feed +bean_event *:on_submit:erpnext.home.update_feed +bean_event Comment:on_update:erpnext.home.make_comment_feed + +bean_event *:on_update:webnotes.core.doctype.notification_count.notification_count.clear_doctype_notifications +bean_event *:on_cancel:webnotes.core.doctype.notification_count.notification_count.clear_doctype_notifications +bean_event *:on_trash:webnotes.core.doctype.notification_count.notification_count.clear_doctype_notifications + +bean_event Stock Entry:on_submit:erpnext.stock.doctype.material_request.material_request.update_completed_qty +bean_event Stock Entry:on_cancel:erpnext.stock.doctype.material_request.material_request.update_completed_qty + +standard_queries Warehouse:erpnext.stock.utils.get_warehouse_list +standard_queries Customer:erpnext.selling.utils.get_customer_list + +# Schedulers +# ---------- + +#### Frequently + +scheduler_event all:erpnext.support.doctype.support_ticket.get_support_mails.get_support_mails +scheduler_event all:erpnext.hr.doctype.job_applicant.get_job_applications.get_job_applications +scheduler_event all:erpnext.selling.doctype.lead.get_leads.get_leads +scheduler_event all:webnotes.utils.email_lib.bulk.flush + +#### Daily + +scheduler_event daily:webnotes.core.doctype.event.event.send_event_digest +scheduler_event daily:webnotes.core.doctype.notification_count.notification_count.delete_event_notification_count +scheduler_event daily:webnotes.utils.email_lib.bulk.clear_outbox +scheduler_event daily:erpnext.accounts.doctype.sales_invoice.sales_invoice.manage_recurring_invoices +scheduler_event daily:erpnext.setup.doctype.backup_manager.backup_manager.take_backups_daily +scheduler_event daily:erpnext.stock.utils.reorder_item +scheduler_event daily:erpnext.setup.doctype.email_digest.email_digest.send + +#### Weekly + +scheduler_event weekly:erpnext.setup.doctype.backup_manager.backup_manager.take_backups_weekly diff --git a/hr/README.md b/erpnext/hr/README.md similarity index 100% rename from hr/README.md rename to erpnext/hr/README.md diff --git a/home/page/latest_updates/__init__.py b/erpnext/hr/__init__.py similarity index 100% rename from home/page/latest_updates/__init__.py rename to erpnext/hr/__init__.py diff --git a/hr/doctype/__init__.py b/erpnext/hr/doctype/__init__.py similarity index 100% rename from hr/doctype/__init__.py rename to erpnext/hr/doctype/__init__.py diff --git a/hr/doctype/appraisal/README.md b/erpnext/hr/doctype/appraisal/README.md similarity index 100% rename from hr/doctype/appraisal/README.md rename to erpnext/hr/doctype/appraisal/README.md diff --git a/hr/doctype/appraisal/__init__.py b/erpnext/hr/doctype/appraisal/__init__.py similarity index 100% rename from hr/doctype/appraisal/__init__.py rename to erpnext/hr/doctype/appraisal/__init__.py diff --git a/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js similarity index 93% rename from hr/doctype/appraisal/appraisal.js rename to erpnext/hr/doctype/appraisal/appraisal.js index fd2856cc22a..29157d090a8 100644 --- a/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -25,7 +25,7 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){ cur_frm.cscript.kra_template = function(doc, dt, dn) { wn.model.map_current_doc({ - method: "hr.doctype.appraisal.appraisal.fetch_appraisal_template", + method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template", source_name: cur_frm.doc.kra_template, }); } @@ -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/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py similarity index 100% rename from hr/doctype/appraisal/appraisal.py rename to erpnext/hr/doctype/appraisal/appraisal.py diff --git a/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.txt similarity index 100% rename from hr/doctype/appraisal/appraisal.txt rename to erpnext/hr/doctype/appraisal/appraisal.txt diff --git a/hr/doctype/appraisal_goal/README.md b/erpnext/hr/doctype/appraisal_goal/README.md similarity index 100% rename from hr/doctype/appraisal_goal/README.md rename to erpnext/hr/doctype/appraisal_goal/README.md diff --git a/hr/doctype/appraisal_goal/__init__.py b/erpnext/hr/doctype/appraisal_goal/__init__.py similarity index 100% rename from hr/doctype/appraisal_goal/__init__.py rename to erpnext/hr/doctype/appraisal_goal/__init__.py diff --git a/hr/doctype/appraisal_goal/appraisal_goal.py b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py similarity index 100% rename from hr/doctype/appraisal_goal/appraisal_goal.py rename to erpnext/hr/doctype/appraisal_goal/appraisal_goal.py diff --git a/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt similarity index 100% rename from hr/doctype/appraisal_goal/appraisal_goal.txt rename to erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt diff --git a/hr/doctype/appraisal_template/README.md b/erpnext/hr/doctype/appraisal_template/README.md similarity index 100% rename from hr/doctype/appraisal_template/README.md rename to erpnext/hr/doctype/appraisal_template/README.md diff --git a/hr/doctype/appraisal_template/__init__.py b/erpnext/hr/doctype/appraisal_template/__init__.py similarity index 100% rename from hr/doctype/appraisal_template/__init__.py rename to erpnext/hr/doctype/appraisal_template/__init__.py diff --git a/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py similarity index 100% rename from hr/doctype/appraisal_template/appraisal_template.py rename to erpnext/hr/doctype/appraisal_template/appraisal_template.py diff --git a/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt similarity index 100% rename from hr/doctype/appraisal_template/appraisal_template.txt rename to erpnext/hr/doctype/appraisal_template/appraisal_template.txt diff --git a/hr/doctype/appraisal_template_goal/README.md b/erpnext/hr/doctype/appraisal_template_goal/README.md similarity index 100% rename from hr/doctype/appraisal_template_goal/README.md rename to erpnext/hr/doctype/appraisal_template_goal/README.md diff --git a/hr/doctype/appraisal_template_goal/__init__.py b/erpnext/hr/doctype/appraisal_template_goal/__init__.py similarity index 100% rename from hr/doctype/appraisal_template_goal/__init__.py rename to erpnext/hr/doctype/appraisal_template_goal/__init__.py diff --git a/hr/doctype/appraisal_template_goal/appraisal_template_goal.py b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py similarity index 100% rename from hr/doctype/appraisal_template_goal/appraisal_template_goal.py rename to erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py diff --git a/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt similarity index 100% rename from hr/doctype/appraisal_template_goal/appraisal_template_goal.txt rename to erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt diff --git a/hr/doctype/attendance/README.md b/erpnext/hr/doctype/attendance/README.md similarity index 100% rename from hr/doctype/attendance/README.md rename to erpnext/hr/doctype/attendance/README.md diff --git a/hr/doctype/attendance/__init__.py b/erpnext/hr/doctype/attendance/__init__.py similarity index 100% rename from hr/doctype/attendance/__init__.py rename to erpnext/hr/doctype/attendance/__init__.py diff --git a/hr/doctype/attendance/attendance.js b/erpnext/hr/doctype/attendance/attendance.js similarity index 89% rename from hr/doctype/attendance/attendance.js rename to erpnext/hr/doctype/attendance/attendance.js index be2b39dc829..ff7d7dd9840 100644 --- a/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/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py similarity index 92% rename from hr/doctype/attendance/attendance.py rename to erpnext/hr/doctype/attendance/attendance.py index 3abc1ae7e4c..10d42227b95 100644 --- a/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -33,7 +33,7 @@ class DocType: raise_exception=1) def validate_fiscal_year(self): - from accounts.utils import validate_fiscal_year + from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.doc.att_date, self.doc.fiscal_year) def validate_att_date(self): @@ -48,8 +48,8 @@ class DocType: _(" not active or does not exists in the system"), raise_exception=1) def validate(self): - import utilities - utilities.validate_status(self.doc.status, ["Present", "Absent", "Half Day"]) + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Present", "Absent", "Half Day"]) self.validate_fiscal_year() self.validate_att_date() self.validate_duplicate_record() diff --git a/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.txt similarity index 100% rename from hr/doctype/attendance/attendance.txt rename to erpnext/hr/doctype/attendance/attendance.txt diff --git a/hr/doctype/branch/README.md b/erpnext/hr/doctype/branch/README.md similarity index 100% rename from hr/doctype/branch/README.md rename to erpnext/hr/doctype/branch/README.md diff --git a/hr/doctype/branch/__init__.py b/erpnext/hr/doctype/branch/__init__.py similarity index 100% rename from hr/doctype/branch/__init__.py rename to erpnext/hr/doctype/branch/__init__.py diff --git a/hr/doctype/branch/branch.py b/erpnext/hr/doctype/branch/branch.py similarity index 100% rename from hr/doctype/branch/branch.py rename to erpnext/hr/doctype/branch/branch.py diff --git a/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.txt similarity index 100% rename from hr/doctype/branch/branch.txt rename to erpnext/hr/doctype/branch/branch.txt diff --git a/hr/doctype/branch/test_branch.py b/erpnext/hr/doctype/branch/test_branch.py similarity index 100% rename from hr/doctype/branch/test_branch.py rename to erpnext/hr/doctype/branch/test_branch.py diff --git a/hr/doctype/deduction_type/README.md b/erpnext/hr/doctype/deduction_type/README.md similarity index 100% rename from hr/doctype/deduction_type/README.md rename to erpnext/hr/doctype/deduction_type/README.md diff --git a/hr/doctype/deduction_type/__init__.py b/erpnext/hr/doctype/deduction_type/__init__.py similarity index 100% rename from hr/doctype/deduction_type/__init__.py rename to erpnext/hr/doctype/deduction_type/__init__.py diff --git a/hr/doctype/deduction_type/deduction_type.py b/erpnext/hr/doctype/deduction_type/deduction_type.py similarity index 100% rename from hr/doctype/deduction_type/deduction_type.py rename to erpnext/hr/doctype/deduction_type/deduction_type.py diff --git a/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.txt similarity index 100% rename from hr/doctype/deduction_type/deduction_type.txt rename to erpnext/hr/doctype/deduction_type/deduction_type.txt diff --git a/hr/doctype/deduction_type/test_deduction_type.py b/erpnext/hr/doctype/deduction_type/test_deduction_type.py similarity index 100% rename from hr/doctype/deduction_type/test_deduction_type.py rename to erpnext/hr/doctype/deduction_type/test_deduction_type.py diff --git a/hr/doctype/department/README.md b/erpnext/hr/doctype/department/README.md similarity index 100% rename from hr/doctype/department/README.md rename to erpnext/hr/doctype/department/README.md diff --git a/hr/doctype/department/__init__.py b/erpnext/hr/doctype/department/__init__.py similarity index 100% rename from hr/doctype/department/__init__.py rename to erpnext/hr/doctype/department/__init__.py diff --git a/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py similarity index 100% rename from hr/doctype/department/department.py rename to erpnext/hr/doctype/department/department.py diff --git a/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.txt similarity index 100% rename from hr/doctype/department/department.txt rename to erpnext/hr/doctype/department/department.txt diff --git a/hr/doctype/department/test_department.py b/erpnext/hr/doctype/department/test_department.py similarity index 100% rename from hr/doctype/department/test_department.py rename to erpnext/hr/doctype/department/test_department.py diff --git a/hr/doctype/designation/README.md b/erpnext/hr/doctype/designation/README.md similarity index 100% rename from hr/doctype/designation/README.md rename to erpnext/hr/doctype/designation/README.md diff --git a/hr/doctype/designation/__init__.py b/erpnext/hr/doctype/designation/__init__.py similarity index 100% rename from hr/doctype/designation/__init__.py rename to erpnext/hr/doctype/designation/__init__.py diff --git a/hr/doctype/designation/designation.py b/erpnext/hr/doctype/designation/designation.py similarity index 100% rename from hr/doctype/designation/designation.py rename to erpnext/hr/doctype/designation/designation.py diff --git a/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.txt similarity index 100% rename from hr/doctype/designation/designation.txt rename to erpnext/hr/doctype/designation/designation.txt diff --git a/hr/doctype/designation/test_designation.py b/erpnext/hr/doctype/designation/test_designation.py similarity index 100% rename from hr/doctype/designation/test_designation.py rename to erpnext/hr/doctype/designation/test_designation.py diff --git a/hr/doctype/earning_type/README.md b/erpnext/hr/doctype/earning_type/README.md similarity index 100% rename from hr/doctype/earning_type/README.md rename to erpnext/hr/doctype/earning_type/README.md diff --git a/hr/doctype/earning_type/__init__.py b/erpnext/hr/doctype/earning_type/__init__.py similarity index 100% rename from hr/doctype/earning_type/__init__.py rename to erpnext/hr/doctype/earning_type/__init__.py diff --git a/hr/doctype/earning_type/earning_type.py b/erpnext/hr/doctype/earning_type/earning_type.py similarity index 100% rename from hr/doctype/earning_type/earning_type.py rename to erpnext/hr/doctype/earning_type/earning_type.py diff --git a/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.txt similarity index 100% rename from hr/doctype/earning_type/earning_type.txt rename to erpnext/hr/doctype/earning_type/earning_type.txt diff --git a/hr/doctype/earning_type/test_earning_type.py b/erpnext/hr/doctype/earning_type/test_earning_type.py similarity index 100% rename from hr/doctype/earning_type/test_earning_type.py rename to erpnext/hr/doctype/earning_type/test_earning_type.py diff --git a/hr/doctype/employee/README.md b/erpnext/hr/doctype/employee/README.md similarity index 100% rename from hr/doctype/employee/README.md rename to erpnext/hr/doctype/employee/README.md diff --git a/hr/doctype/employee/__init__.py b/erpnext/hr/doctype/employee/__init__.py similarity index 100% rename from hr/doctype/employee/__init__.py rename to erpnext/hr/doctype/employee/__init__.py diff --git a/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js similarity index 95% rename from hr/doctype/employee/employee.js rename to erpnext/hr/doctype/employee/employee.js index 08cadbdc702..1df6175fae8 100644 --- a/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() { @@ -29,7 +29,7 @@ erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({ setup_leave_approver_select: function() { var me = this; return this.frm.call({ - method:"hr.utils.get_leave_approver_list", + method: "erpnext.hr.utils.get_leave_approver_list", callback: function(r) { var df = wn.meta.get_docfield("Employee Leave Approver", "leave_approver", me.frm.doc.name); diff --git a/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py similarity index 97% rename from hr/doctype/employee/employee.py rename to erpnext/hr/doctype/employee/employee.py index 6684951a936..da72ec7f39e 100644 --- a/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -25,8 +25,8 @@ class DocType(DocListController): self.doc.employee = self.doc.name def validate(self): - import utilities - utilities.validate_status(self.doc.status, ["Active", "Left"]) + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Active", "Left"]) self.doc.employee = self.doc.name self.validate_date() @@ -149,7 +149,7 @@ class DocType(DocListController): def validate_employee_leave_approver(self): from webnotes.profile import Profile - from hr.doctype.leave_application.leave_application import InvalidLeaveApproverError + from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError for l in self.doclist.get({"parentfield": "employee_leave_approvers"}): if "Leave Approver" not in Profile(l.leave_approver).get_roles(): diff --git a/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt similarity index 100% rename from hr/doctype/employee/employee.txt rename to erpnext/hr/doctype/employee/employee.txt diff --git a/hr/doctype/employee/test_employee.py b/erpnext/hr/doctype/employee/test_employee.py similarity index 100% rename from hr/doctype/employee/test_employee.py rename to erpnext/hr/doctype/employee/test_employee.py diff --git a/hr/doctype/employee_education/README.md b/erpnext/hr/doctype/employee_education/README.md similarity index 100% rename from hr/doctype/employee_education/README.md rename to erpnext/hr/doctype/employee_education/README.md diff --git a/hr/doctype/employee_education/__init__.py b/erpnext/hr/doctype/employee_education/__init__.py similarity index 100% rename from hr/doctype/employee_education/__init__.py rename to erpnext/hr/doctype/employee_education/__init__.py diff --git a/hr/doctype/employee_education/employee_education.py b/erpnext/hr/doctype/employee_education/employee_education.py similarity index 100% rename from hr/doctype/employee_education/employee_education.py rename to erpnext/hr/doctype/employee_education/employee_education.py diff --git a/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.txt similarity index 100% rename from hr/doctype/employee_education/employee_education.txt rename to erpnext/hr/doctype/employee_education/employee_education.txt diff --git a/hr/doctype/employee_external_work_history/README.md b/erpnext/hr/doctype/employee_external_work_history/README.md similarity index 100% rename from hr/doctype/employee_external_work_history/README.md rename to erpnext/hr/doctype/employee_external_work_history/README.md diff --git a/hr/doctype/employee_external_work_history/__init__.py b/erpnext/hr/doctype/employee_external_work_history/__init__.py similarity index 100% rename from hr/doctype/employee_external_work_history/__init__.py rename to erpnext/hr/doctype/employee_external_work_history/__init__.py diff --git a/hr/doctype/employee_external_work_history/employee_external_work_history.py b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py similarity index 100% rename from hr/doctype/employee_external_work_history/employee_external_work_history.py rename to erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py diff --git a/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt similarity index 100% rename from hr/doctype/employee_external_work_history/employee_external_work_history.txt rename to erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt diff --git a/hr/doctype/employee_internal_work_history/README.md b/erpnext/hr/doctype/employee_internal_work_history/README.md similarity index 100% rename from hr/doctype/employee_internal_work_history/README.md rename to erpnext/hr/doctype/employee_internal_work_history/README.md diff --git a/hr/doctype/employee_internal_work_history/__init__.py b/erpnext/hr/doctype/employee_internal_work_history/__init__.py similarity index 100% rename from hr/doctype/employee_internal_work_history/__init__.py rename to erpnext/hr/doctype/employee_internal_work_history/__init__.py diff --git a/hr/doctype/employee_internal_work_history/employee_internal_work_history.py b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py similarity index 100% rename from hr/doctype/employee_internal_work_history/employee_internal_work_history.py rename to erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py diff --git a/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt similarity index 100% rename from hr/doctype/employee_internal_work_history/employee_internal_work_history.txt rename to erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt diff --git a/hr/doctype/employee_leave_approver/README.md b/erpnext/hr/doctype/employee_leave_approver/README.md similarity index 100% rename from hr/doctype/employee_leave_approver/README.md rename to erpnext/hr/doctype/employee_leave_approver/README.md diff --git a/hr/__init__.py b/erpnext/hr/doctype/employee_leave_approver/__init__.py similarity index 100% rename from hr/__init__.py rename to erpnext/hr/doctype/employee_leave_approver/__init__.py diff --git a/hr/doctype/employee_leave_approver/employee_leave_approver.py b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py similarity index 100% rename from hr/doctype/employee_leave_approver/employee_leave_approver.py rename to erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py diff --git a/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt similarity index 100% rename from hr/doctype/employee_leave_approver/employee_leave_approver.txt rename to erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt diff --git a/hr/doctype/employment_type/README.md b/erpnext/hr/doctype/employment_type/README.md similarity index 100% rename from hr/doctype/employment_type/README.md rename to erpnext/hr/doctype/employment_type/README.md diff --git a/hr/doctype/employment_type/__init__.py b/erpnext/hr/doctype/employment_type/__init__.py similarity index 100% rename from hr/doctype/employment_type/__init__.py rename to erpnext/hr/doctype/employment_type/__init__.py diff --git a/hr/doctype/employment_type/employment_type.py b/erpnext/hr/doctype/employment_type/employment_type.py similarity index 100% rename from hr/doctype/employment_type/employment_type.py rename to erpnext/hr/doctype/employment_type/employment_type.py diff --git a/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.txt similarity index 100% rename from hr/doctype/employment_type/employment_type.txt rename to erpnext/hr/doctype/employment_type/employment_type.txt diff --git a/hr/doctype/employment_type/test_employment_type.py b/erpnext/hr/doctype/employment_type/test_employment_type.py similarity index 100% rename from hr/doctype/employment_type/test_employment_type.py rename to erpnext/hr/doctype/employment_type/test_employment_type.py diff --git a/hr/doctype/expense_claim/README.md b/erpnext/hr/doctype/expense_claim/README.md similarity index 100% rename from hr/doctype/expense_claim/README.md rename to erpnext/hr/doctype/expense_claim/README.md diff --git a/hr/doctype/expense_claim/__init__.py b/erpnext/hr/doctype/expense_claim/__init__.py similarity index 100% rename from hr/doctype/expense_claim/__init__.py rename to erpnext/hr/doctype/expense_claim/__init__.py diff --git a/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js similarity index 92% rename from hr/doctype/expense_claim/expense_claim.js rename to erpnext/hr/doctype/expense_claim/expense_claim.js index c32df80a0cb..716afd3dcd1 100644 --- a/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -7,7 +7,7 @@ erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({ make_bank_voucher: function() { var me = this; return wn.call({ - method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account", + method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account", args: { "company": cur_frm.doc.company, "voucher_type": "Bank Voucher" @@ -55,12 +55,12 @@ 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; return cur_frm.call({ - method:"hr.utils.get_expense_approver_list", + method: "erpnext.hr.utils.get_expense_approver_list", callback: function(r) { cur_frm.set_df_property("exp_approver", "options", r.message); if(exp_approver) cur_frm.set_value("exp_approver", exp_approver); @@ -104,11 +104,9 @@ cur_frm.cscript.set_help = function(doc) { } else { if(doc.docstatus==0 && doc.approval_status=="Draft") { if(user==doc.exp_approver) { - cur_frm.set_intro(wn._("You are the Expense Approver for this record. \ - Please Update the 'Status' and Save")); + cur_frm.set_intro(wn._("You are the Expense Approver for this record. Please Update the 'Status' and Save")); } else { - cur_frm.set_intro(wn._("Expense Claim is pending approval. \ - Only the Expense Approver can update status.")); + cur_frm.set_intro(wn._("Expense Claim is pending approval. Only the Expense Approver can update status.")); } } else { if(doc.approval_status=="Approved") { diff --git a/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py similarity index 94% rename from hr/doctype/expense_claim/expense_claim.py rename to erpnext/hr/doctype/expense_claim/expense_claim.py index 6b792c85616..521195feb59 100644 --- a/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -22,7 +22,7 @@ class DocType: 'Rejected' before submitting""", raise_exception=1) def validate_fiscal_year(self): - from accounts.utils import validate_fiscal_year + from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") def validate_exp_details(self): diff --git a/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.txt similarity index 100% rename from hr/doctype/expense_claim/expense_claim.txt rename to erpnext/hr/doctype/expense_claim/expense_claim.txt diff --git a/hr/doctype/expense_claim_detail/README.md b/erpnext/hr/doctype/expense_claim_detail/README.md similarity index 100% rename from hr/doctype/expense_claim_detail/README.md rename to erpnext/hr/doctype/expense_claim_detail/README.md diff --git a/hr/doctype/expense_claim_detail/__init__.py b/erpnext/hr/doctype/expense_claim_detail/__init__.py similarity index 100% rename from hr/doctype/expense_claim_detail/__init__.py rename to erpnext/hr/doctype/expense_claim_detail/__init__.py diff --git a/hr/doctype/expense_claim_detail/expense_claim_detail.py b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py similarity index 100% rename from hr/doctype/expense_claim_detail/expense_claim_detail.py rename to erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py diff --git a/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt similarity index 100% rename from hr/doctype/expense_claim_detail/expense_claim_detail.txt rename to erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt diff --git a/hr/doctype/expense_claim_type/README.md b/erpnext/hr/doctype/expense_claim_type/README.md similarity index 100% rename from hr/doctype/expense_claim_type/README.md rename to erpnext/hr/doctype/expense_claim_type/README.md diff --git a/hr/doctype/expense_claim_type/__init__.py b/erpnext/hr/doctype/expense_claim_type/__init__.py similarity index 100% rename from hr/doctype/expense_claim_type/__init__.py rename to erpnext/hr/doctype/expense_claim_type/__init__.py diff --git a/hr/doctype/expense_claim_type/expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py similarity index 100% rename from hr/doctype/expense_claim_type/expense_claim_type.py rename to erpnext/hr/doctype/expense_claim_type/expense_claim_type.py diff --git a/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt similarity index 100% rename from hr/doctype/expense_claim_type/expense_claim_type.txt rename to erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt diff --git a/hr/doctype/grade/README.md b/erpnext/hr/doctype/grade/README.md similarity index 100% rename from hr/doctype/grade/README.md rename to erpnext/hr/doctype/grade/README.md diff --git a/hr/doctype/grade/__init__.py b/erpnext/hr/doctype/grade/__init__.py similarity index 100% rename from hr/doctype/grade/__init__.py rename to erpnext/hr/doctype/grade/__init__.py diff --git a/hr/doctype/grade/grade.py b/erpnext/hr/doctype/grade/grade.py similarity index 100% rename from hr/doctype/grade/grade.py rename to erpnext/hr/doctype/grade/grade.py diff --git a/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.txt similarity index 100% rename from hr/doctype/grade/grade.txt rename to erpnext/hr/doctype/grade/grade.txt diff --git a/hr/doctype/grade/test_grade.py b/erpnext/hr/doctype/grade/test_grade.py similarity index 100% rename from hr/doctype/grade/test_grade.py rename to erpnext/hr/doctype/grade/test_grade.py diff --git a/hr/doctype/holiday/README.md b/erpnext/hr/doctype/holiday/README.md similarity index 100% rename from hr/doctype/holiday/README.md rename to erpnext/hr/doctype/holiday/README.md diff --git a/hr/doctype/holiday/__init__.py b/erpnext/hr/doctype/holiday/__init__.py similarity index 100% rename from hr/doctype/holiday/__init__.py rename to erpnext/hr/doctype/holiday/__init__.py diff --git a/hr/doctype/holiday/holiday.py b/erpnext/hr/doctype/holiday/holiday.py similarity index 100% rename from hr/doctype/holiday/holiday.py rename to erpnext/hr/doctype/holiday/holiday.py diff --git a/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.txt similarity index 100% rename from hr/doctype/holiday/holiday.txt rename to erpnext/hr/doctype/holiday/holiday.txt diff --git a/hr/doctype/holiday_list/README.md b/erpnext/hr/doctype/holiday_list/README.md similarity index 100% rename from hr/doctype/holiday_list/README.md rename to erpnext/hr/doctype/holiday_list/README.md diff --git a/hr/doctype/holiday_list/__init__.py b/erpnext/hr/doctype/holiday_list/__init__.py similarity index 100% rename from hr/doctype/holiday_list/__init__.py rename to erpnext/hr/doctype/holiday_list/__init__.py diff --git a/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py similarity index 100% rename from hr/doctype/holiday_list/holiday_list.py rename to erpnext/hr/doctype/holiday_list/holiday_list.py diff --git a/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.txt similarity index 100% rename from hr/doctype/holiday_list/holiday_list.txt rename to erpnext/hr/doctype/holiday_list/holiday_list.txt diff --git a/hr/doctype/holiday_list/test_holiday_list.py b/erpnext/hr/doctype/holiday_list/test_holiday_list.py similarity index 100% rename from hr/doctype/holiday_list/test_holiday_list.py rename to erpnext/hr/doctype/holiday_list/test_holiday_list.py diff --git a/hr/doctype/employee_leave_approver/__init__.py b/erpnext/hr/doctype/hr_settings/__init__.py similarity index 100% rename from hr/doctype/employee_leave_approver/__init__.py rename to erpnext/hr/doctype/hr_settings/__init__.py diff --git a/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py similarity index 93% rename from hr/doctype/hr_settings/hr_settings.py rename to erpnext/hr/doctype/hr_settings/hr_settings.py index 2abd7c6a931..e7e5d3e8598 100644 --- a/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -15,7 +15,7 @@ class DocType: def validate(self): self.update_birthday_reminders() - from setup.doctype.naming_series.naming_series import set_by_naming_series + from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Employee", "employee_number", self.doc.get("emp_created_by")=="Naming Series", hide_name_field=True) diff --git a/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.txt similarity index 100% rename from hr/doctype/hr_settings/hr_settings.txt rename to erpnext/hr/doctype/hr_settings/hr_settings.txt diff --git a/hr/doctype/job_applicant/README.md b/erpnext/hr/doctype/job_applicant/README.md similarity index 100% rename from hr/doctype/job_applicant/README.md rename to erpnext/hr/doctype/job_applicant/README.md diff --git a/hr/doctype/hr_settings/__init__.py b/erpnext/hr/doctype/job_applicant/__init__.py similarity index 100% rename from hr/doctype/hr_settings/__init__.py rename to erpnext/hr/doctype/job_applicant/__init__.py diff --git a/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py similarity index 95% rename from hr/doctype/job_applicant/get_job_applications.py rename to erpnext/hr/doctype/job_applicant/get_job_applications.py index 33e1261bc44..05bd46f6106 100644 --- a/hr/doctype/job_applicant/get_job_applications.py +++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, cint from webnotes.utils.email_lib.receive import POP3Mailbox -from core.doctype.communication.communication import make +from webnotes.core.doctype.communication.communication import make class JobsMailbox(POP3Mailbox): def setup(self, args=None): diff --git a/hr/doctype/job_applicant/job_applicant.js b/erpnext/hr/doctype/job_applicant/job_applicant.js similarity index 100% rename from hr/doctype/job_applicant/job_applicant.js rename to erpnext/hr/doctype/job_applicant/job_applicant.js diff --git a/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py similarity index 89% rename from hr/doctype/job_applicant/job_applicant.py rename to erpnext/hr/doctype/job_applicant/job_applicant.py index 887e7896905..0262568ffed 100644 --- a/hr/doctype/job_applicant/job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase from webnotes.utils import extract_email_id class DocType(TransactionBase): diff --git a/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.txt similarity index 100% rename from hr/doctype/job_applicant/job_applicant.txt rename to erpnext/hr/doctype/job_applicant/job_applicant.txt diff --git a/hr/doctype/job_opening/README.md b/erpnext/hr/doctype/job_opening/README.md similarity index 100% rename from hr/doctype/job_opening/README.md rename to erpnext/hr/doctype/job_opening/README.md diff --git a/hr/doctype/job_applicant/__init__.py b/erpnext/hr/doctype/job_opening/__init__.py similarity index 100% rename from hr/doctype/job_applicant/__init__.py rename to erpnext/hr/doctype/job_opening/__init__.py diff --git a/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py similarity index 100% rename from hr/doctype/job_opening/job_opening.py rename to erpnext/hr/doctype/job_opening/job_opening.py diff --git a/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.txt similarity index 100% rename from hr/doctype/job_opening/job_opening.txt rename to erpnext/hr/doctype/job_opening/job_opening.txt diff --git a/hr/doctype/leave_allocation/README.md b/erpnext/hr/doctype/leave_allocation/README.md similarity index 100% rename from hr/doctype/leave_allocation/README.md rename to erpnext/hr/doctype/leave_allocation/README.md diff --git a/hr/doctype/leave_allocation/__init__.py b/erpnext/hr/doctype/leave_allocation/__init__.py similarity index 100% rename from hr/doctype/leave_allocation/__init__.py rename to erpnext/hr/doctype/leave_allocation/__init__.py diff --git a/hr/doctype/leave_allocation/leave_allocation.js b/erpnext/hr/doctype/leave_allocation/leave_allocation.js similarity index 97% rename from hr/doctype/leave_allocation/leave_allocation.js rename to erpnext/hr/doctype/leave_allocation/leave_allocation.js index 4bc3c49bd1b..1e376dacf59 100755 --- a/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/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py similarity index 100% rename from hr/doctype/leave_allocation/leave_allocation.py rename to erpnext/hr/doctype/leave_allocation/leave_allocation.py diff --git a/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt similarity index 100% rename from hr/doctype/leave_allocation/leave_allocation.txt rename to erpnext/hr/doctype/leave_allocation/leave_allocation.txt diff --git a/hr/doctype/leave_application/README.md b/erpnext/hr/doctype/leave_application/README.md similarity index 100% rename from hr/doctype/leave_application/README.md rename to erpnext/hr/doctype/leave_application/README.md diff --git a/hr/doctype/leave_application/__init__.py b/erpnext/hr/doctype/leave_application/__init__.py similarity index 100% rename from hr/doctype/leave_application/__init__.py rename to erpnext/hr/doctype/leave_application/__init__.py diff --git a/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js similarity index 98% rename from hr/doctype/leave_application/leave_application.js rename to erpnext/hr/doctype/leave_application/leave_application.js index a3b62caca85..cd04384c222 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -13,7 +13,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) { var leave_approver = doc.leave_approver; return cur_frm.call({ - method:"hr.utils.get_leave_approver_list", + method: "erpnext.hr.utils.get_leave_approver_list", callback: function(r) { cur_frm.set_df_property("leave_approver", "options", $.map(r.message, function(profile) { diff --git a/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py similarity index 96% rename from hr/doctype/leave_application/leave_application.py rename to erpnext/hr/doctype/leave_application/leave_application.py index b547d3d2c92..04b03a79bc7 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -54,7 +54,7 @@ class DocType(DocListController): self.notify_employee("cancelled") def show_block_day_warning(self): - from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates + from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date, self.doc.employee, self.doc.company, all_lists=True) @@ -65,7 +65,7 @@ class DocType(DocListController): webnotes.msgprint(formatdate(d.block_date) + ": " + d.reason) def validate_block_days(self): - from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates + from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date, self.doc.employee, self.doc.company) @@ -108,8 +108,7 @@ class DocType(DocListController): self.doc.total_leave_days = self.get_total_leave_days()["total_leave_days"] if self.doc.total_leave_days == 0: - msgprint(_("Hurray! The day(s) on which you are applying for leave \ - coincide with holiday(s). You need not apply for leave."), + msgprint(_("The day(s) on which you are applying for leave coincide with holiday(s). You need not apply for leave."), raise_exception=1) if not is_lwp(self.doc.leave_type): @@ -210,7 +209,7 @@ class DocType(DocListController): def notify(self, args): args = webnotes._dict(args) - from core.page.messages.messages import post + from webnotes.core.page.messages.messages import post post({"txt": args.message, "contact": args.message_to, "subject": args.subject, "notify": cint(self.doc.follow_via_email)}) @@ -295,7 +294,7 @@ def add_leaves(events, start, end, employee, company, match_conditions=None): def add_block_dates(events, start, end, employee, company): # block days - from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates + from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates cnt = 0 block_dates = get_applicable_block_dates(start, end, employee, company, all_lists=True) diff --git a/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.txt similarity index 100% rename from hr/doctype/leave_application/leave_application.txt rename to erpnext/hr/doctype/leave_application/leave_application.txt diff --git a/hr/doctype/leave_application/leave_application_calendar.js b/erpnext/hr/doctype/leave_application/leave_application_calendar.js similarity index 81% rename from hr/doctype/leave_application/leave_application_calendar.js rename to erpnext/hr/doctype/leave_application/leave_application_calendar.js index a258c8fb621..ba09a39f15a 100644 --- a/hr/doctype/leave_application/leave_application_calendar.js +++ b/erpnext/hr/doctype/leave_application/leave_application_calendar.js @@ -16,5 +16,5 @@ wn.views.calendar["Leave Application"] = { right: 'month' } }, - get_events_method: "hr.doctype.leave_application.leave_application.get_events" + get_events_method: "erpnext.hr.doctype.leave_application.leave_application.get_events" } \ No newline at end of file diff --git a/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py similarity index 96% rename from hr/doctype/leave_application/test_leave_application.py rename to erpnext/hr/doctype/leave_application/test_leave_application.py index 2c4f3763a93..9bb01340e19 100644 --- a/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -4,7 +4,7 @@ import webnotes import unittest -from hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError +from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError class TestLeaveApplication(unittest.TestCase): def tearDown(self): @@ -132,7 +132,7 @@ class TestLeaveApplication(unittest.TestCase): "docstatus"), 1) def _test_leave_approval_invalid_leave_approver_insert(self): - from hr.doctype.leave_application.leave_application import InvalidLeaveApproverError + from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError self._clear_applications() @@ -163,7 +163,7 @@ class TestLeaveApplication(unittest.TestCase): webnotes.set_user("test1@example.com") application.doc.status = "Approved" - from hr.doctype.leave_application.leave_application import LeaveApproverIdentityError + from erpnext.hr.doctype.leave_application.leave_application import LeaveApproverIdentityError self.assertRaises(LeaveApproverIdentityError, application.submit) webnotes.conn.sql("""delete from `tabEmployee Leave Approver` where parent=%s""", diff --git a/hr/doctype/leave_block_list/README.md b/erpnext/hr/doctype/leave_block_list/README.md similarity index 100% rename from hr/doctype/leave_block_list/README.md rename to erpnext/hr/doctype/leave_block_list/README.md diff --git a/hr/doctype/job_opening/__init__.py b/erpnext/hr/doctype/leave_block_list/__init__.py similarity index 100% rename from hr/doctype/job_opening/__init__.py rename to erpnext/hr/doctype/leave_block_list/__init__.py diff --git a/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py similarity index 97% rename from hr/doctype/leave_block_list/leave_block_list.py rename to erpnext/hr/doctype/leave_block_list/leave_block_list.py index 973436ed12f..4585e908332 100644 --- a/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes -from accounts.utils import validate_fiscal_year +from erpnext.accounts.utils import validate_fiscal_year from webnotes import _ class DocType: diff --git a/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt similarity index 100% rename from hr/doctype/leave_block_list/leave_block_list.txt rename to erpnext/hr/doctype/leave_block_list/leave_block_list.txt diff --git a/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py similarity index 95% rename from hr/doctype/leave_block_list/test_leave_block_list.py rename to erpnext/hr/doctype/leave_block_list/test_leave_block_list.py index d2aab714973..d386704d213 100644 --- a/hr/doctype/leave_block_list/test_leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py @@ -4,7 +4,7 @@ import webnotes import unittest -from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates +from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates class TestLeaveBlockList(unittest.TestCase): def tearDown(self): diff --git a/hr/doctype/leave_block_list_allow/README.md b/erpnext/hr/doctype/leave_block_list_allow/README.md similarity index 100% rename from hr/doctype/leave_block_list_allow/README.md rename to erpnext/hr/doctype/leave_block_list_allow/README.md diff --git a/hr/doctype/leave_block_list/__init__.py b/erpnext/hr/doctype/leave_block_list_allow/__init__.py similarity index 100% rename from hr/doctype/leave_block_list/__init__.py rename to erpnext/hr/doctype/leave_block_list_allow/__init__.py diff --git a/hr/doctype/leave_block_list_allow/leave_block_list_allow.py b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py similarity index 100% rename from hr/doctype/leave_block_list_allow/leave_block_list_allow.py rename to erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py diff --git a/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt similarity index 100% rename from hr/doctype/leave_block_list_allow/leave_block_list_allow.txt rename to erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt diff --git a/hr/doctype/leave_block_list_date/README.md b/erpnext/hr/doctype/leave_block_list_date/README.md similarity index 100% rename from hr/doctype/leave_block_list_date/README.md rename to erpnext/hr/doctype/leave_block_list_date/README.md diff --git a/hr/doctype/leave_block_list_allow/__init__.py b/erpnext/hr/doctype/leave_block_list_date/__init__.py similarity index 100% rename from hr/doctype/leave_block_list_allow/__init__.py rename to erpnext/hr/doctype/leave_block_list_date/__init__.py diff --git a/hr/doctype/leave_block_list_date/leave_block_list_date.py b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py similarity index 100% rename from hr/doctype/leave_block_list_date/leave_block_list_date.py rename to erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py diff --git a/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt similarity index 100% rename from hr/doctype/leave_block_list_date/leave_block_list_date.txt rename to erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt diff --git a/hr/doctype/leave_control_panel/README.md b/erpnext/hr/doctype/leave_control_panel/README.md similarity index 100% rename from hr/doctype/leave_control_panel/README.md rename to erpnext/hr/doctype/leave_control_panel/README.md diff --git a/hr/doctype/leave_control_panel/__init__.py b/erpnext/hr/doctype/leave_control_panel/__init__.py similarity index 100% rename from hr/doctype/leave_control_panel/__init__.py rename to erpnext/hr/doctype/leave_control_panel/__init__.py diff --git a/hr/doctype/leave_control_panel/leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js similarity index 100% rename from hr/doctype/leave_control_panel/leave_control_panel.js rename to erpnext/hr/doctype/leave_control_panel/leave_control_panel.js diff --git a/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py similarity index 100% rename from hr/doctype/leave_control_panel/leave_control_panel.py rename to erpnext/hr/doctype/leave_control_panel/leave_control_panel.py diff --git a/hr/doctype/leave_control_panel/leave_control_panel.txt b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt similarity index 100% rename from hr/doctype/leave_control_panel/leave_control_panel.txt rename to erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt diff --git a/hr/doctype/leave_type/README.md b/erpnext/hr/doctype/leave_type/README.md similarity index 100% rename from hr/doctype/leave_type/README.md rename to erpnext/hr/doctype/leave_type/README.md diff --git a/hr/doctype/leave_type/__init__.py b/erpnext/hr/doctype/leave_type/__init__.py similarity index 100% rename from hr/doctype/leave_type/__init__.py rename to erpnext/hr/doctype/leave_type/__init__.py diff --git a/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py similarity index 100% rename from hr/doctype/leave_type/leave_type.py rename to erpnext/hr/doctype/leave_type/leave_type.py diff --git a/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.txt similarity index 100% rename from hr/doctype/leave_type/leave_type.txt rename to erpnext/hr/doctype/leave_type/leave_type.txt diff --git a/hr/doctype/leave_type/test_leave_type.py b/erpnext/hr/doctype/leave_type/test_leave_type.py similarity index 100% rename from hr/doctype/leave_type/test_leave_type.py rename to erpnext/hr/doctype/leave_type/test_leave_type.py diff --git a/hr/doctype/salary_manager/README.md b/erpnext/hr/doctype/salary_manager/README.md similarity index 100% rename from hr/doctype/salary_manager/README.md rename to erpnext/hr/doctype/salary_manager/README.md diff --git a/hr/doctype/salary_manager/__init__.py b/erpnext/hr/doctype/salary_manager/__init__.py similarity index 100% rename from hr/doctype/salary_manager/__init__.py rename to erpnext/hr/doctype/salary_manager/__init__.py diff --git a/hr/doctype/salary_manager/salary_manager.js b/erpnext/hr/doctype/salary_manager/salary_manager.js similarity index 100% rename from hr/doctype/salary_manager/salary_manager.js rename to erpnext/hr/doctype/salary_manager/salary_manager.js diff --git a/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py similarity index 100% rename from hr/doctype/salary_manager/salary_manager.py rename to erpnext/hr/doctype/salary_manager/salary_manager.py diff --git a/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.txt similarity index 100% rename from hr/doctype/salary_manager/salary_manager.txt rename to erpnext/hr/doctype/salary_manager/salary_manager.txt diff --git a/hr/doctype/salary_manager/test_salary_manager.py b/erpnext/hr/doctype/salary_manager/test_salary_manager.py similarity index 100% rename from hr/doctype/salary_manager/test_salary_manager.py rename to erpnext/hr/doctype/salary_manager/test_salary_manager.py diff --git a/hr/doctype/salary_slip/README.md b/erpnext/hr/doctype/salary_slip/README.md similarity index 100% rename from hr/doctype/salary_slip/README.md rename to erpnext/hr/doctype/salary_slip/README.md diff --git a/hr/doctype/salary_slip/__init__.py b/erpnext/hr/doctype/salary_slip/__init__.py similarity index 100% rename from hr/doctype/salary_slip/__init__.py rename to erpnext/hr/doctype/salary_slip/__init__.py diff --git a/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js similarity index 98% rename from hr/doctype/salary_slip/salary_slip.js rename to erpnext/hr/doctype/salary_slip/salary_slip.js index 3716953cd26..ceab14843ec 100644 --- a/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/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py similarity index 98% rename from hr/doctype/salary_slip/salary_slip.py rename to erpnext/hr/doctype/salary_slip/salary_slip.py index 94660d0fd85..f799592f62f 100644 --- a/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -9,10 +9,10 @@ from webnotes.model.doc import make_autoname from webnotes.model.bean import getlist from webnotes.model.code import get_obj from webnotes import msgprint, _ -from setup.utils import get_company_currency +from erpnext.setup.utils import get_company_currency -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self,doc,doclist=[]): @@ -38,7 +38,7 @@ class DocType(TransactionBase): return struct and struct[0][0] or '' def pull_sal_struct(self, struct): - from hr.doctype.salary_structure.salary_structure import get_mapped_doclist + from erpnext.hr.doctype.salary_structure.salary_structure import get_mapped_doclist self.doclist = get_mapped_doclist(struct, self.doclist) def pull_emp_details(self): diff --git a/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.txt similarity index 100% rename from hr/doctype/salary_slip/salary_slip.txt rename to erpnext/hr/doctype/salary_slip/salary_slip.txt diff --git a/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py similarity index 96% rename from hr/doctype/salary_slip/test_salary_slip.py rename to erpnext/hr/doctype/salary_slip/test_salary_slip.py index 29e94077d4b..372a858cc28 100644 --- a/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -8,7 +8,7 @@ class TestSalarySlip(unittest.TestCase): def setUp(self): webnotes.conn.sql("""delete from `tabLeave Application`""") webnotes.conn.sql("""delete from `tabSalary Slip`""") - from hr.doctype.leave_application.test_leave_application import test_records as leave_applications + from erpnext.hr.doctype.leave_application.test_leave_application import test_records as leave_applications la = webnotes.bean(copy=leave_applications[4]) la.insert() la.doc.status = "Approved" diff --git a/hr/doctype/salary_slip_deduction/README.md b/erpnext/hr/doctype/salary_slip_deduction/README.md similarity index 100% rename from hr/doctype/salary_slip_deduction/README.md rename to erpnext/hr/doctype/salary_slip_deduction/README.md diff --git a/hr/doctype/salary_slip_deduction/__init__.py b/erpnext/hr/doctype/salary_slip_deduction/__init__.py similarity index 100% rename from hr/doctype/salary_slip_deduction/__init__.py rename to erpnext/hr/doctype/salary_slip_deduction/__init__.py diff --git a/hr/doctype/salary_slip_deduction/salary_slip_deduction.py b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py similarity index 100% rename from hr/doctype/salary_slip_deduction/salary_slip_deduction.py rename to erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py diff --git a/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt similarity index 100% rename from hr/doctype/salary_slip_deduction/salary_slip_deduction.txt rename to erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt diff --git a/hr/doctype/salary_slip_earning/README.md b/erpnext/hr/doctype/salary_slip_earning/README.md similarity index 100% rename from hr/doctype/salary_slip_earning/README.md rename to erpnext/hr/doctype/salary_slip_earning/README.md diff --git a/hr/doctype/salary_slip_earning/__init__.py b/erpnext/hr/doctype/salary_slip_earning/__init__.py similarity index 100% rename from hr/doctype/salary_slip_earning/__init__.py rename to erpnext/hr/doctype/salary_slip_earning/__init__.py diff --git a/hr/doctype/salary_slip_earning/salary_slip_earning.py b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py similarity index 100% rename from hr/doctype/salary_slip_earning/salary_slip_earning.py rename to erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py diff --git a/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt similarity index 100% rename from hr/doctype/salary_slip_earning/salary_slip_earning.txt rename to erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt diff --git a/hr/doctype/salary_structure/README.md b/erpnext/hr/doctype/salary_structure/README.md similarity index 100% rename from hr/doctype/salary_structure/README.md rename to erpnext/hr/doctype/salary_structure/README.md diff --git a/hr/doctype/salary_structure/__init__.py b/erpnext/hr/doctype/salary_structure/__init__.py similarity index 100% rename from hr/doctype/salary_structure/__init__.py rename to erpnext/hr/doctype/salary_structure/__init__.py diff --git a/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js similarity index 93% rename from hr/doctype/salary_structure/salary_structure.js rename to erpnext/hr/doctype/salary_structure/salary_structure.js index 8e36dbd5e74..24da8a0503b 100644 --- a/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -20,7 +20,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn){ cur_frm.cscript['Make Salary Slip'] = function() { wn.model.open_mapped_doc({ - method: "hr.doctype.salary_structure.salary_structure.make_salary_slip", + method: "erpnext.hr.doctype.salary_structure.salary_structure.make_salary_slip", source_name: cur_frm.doc.name }); } @@ -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/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py similarity index 97% rename from hr/doctype/salary_structure/salary_structure.py rename to erpnext/hr/doctype/salary_structure/salary_structure.py index a034b902846..67771e60b26 100644 --- a/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -60,8 +60,7 @@ class DocType: ret = webnotes.conn.sql("""select name from `tabSalary Structure` where is_active = 'Yes' and employee = %s and name!=%s""", (self.doc.employee,self.doc.name)) if ret and self.doc.is_active=='Yes': - msgprint(_("""Another Salary Structure '%s' is active for employee '%s'. - Please make its status 'Inactive' to proceed.""") % + msgprint(_("""Another Salary Structure '%s' is active for employee '%s'. Please make its status 'Inactive' to proceed.""") % (cstr(ret), self.doc.employee), raise_exception=1) def validate_amount(self): @@ -112,4 +111,4 @@ def get_mapped_doclist(source_name, target_doclist=None): } }, target_doclist, postprocess) - return doclist \ No newline at end of file + return doclist diff --git a/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.txt similarity index 100% rename from hr/doctype/salary_structure/salary_structure.txt rename to erpnext/hr/doctype/salary_structure/salary_structure.txt diff --git a/hr/doctype/salary_structure_deduction/README.md b/erpnext/hr/doctype/salary_structure_deduction/README.md similarity index 100% rename from hr/doctype/salary_structure_deduction/README.md rename to erpnext/hr/doctype/salary_structure_deduction/README.md diff --git a/hr/doctype/salary_structure_deduction/__init__.py b/erpnext/hr/doctype/salary_structure_deduction/__init__.py similarity index 100% rename from hr/doctype/salary_structure_deduction/__init__.py rename to erpnext/hr/doctype/salary_structure_deduction/__init__.py diff --git a/hr/doctype/salary_structure_deduction/salary_structure_deduction.py b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py similarity index 100% rename from hr/doctype/salary_structure_deduction/salary_structure_deduction.py rename to erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py diff --git a/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt similarity index 100% rename from hr/doctype/salary_structure_deduction/salary_structure_deduction.txt rename to erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt diff --git a/hr/doctype/salary_structure_earning/README.md b/erpnext/hr/doctype/salary_structure_earning/README.md similarity index 100% rename from hr/doctype/salary_structure_earning/README.md rename to erpnext/hr/doctype/salary_structure_earning/README.md diff --git a/hr/doctype/salary_structure_earning/__init__.py b/erpnext/hr/doctype/salary_structure_earning/__init__.py similarity index 100% rename from hr/doctype/salary_structure_earning/__init__.py rename to erpnext/hr/doctype/salary_structure_earning/__init__.py diff --git a/hr/doctype/salary_structure_earning/salary_structure_earning.py b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py similarity index 100% rename from hr/doctype/salary_structure_earning/salary_structure_earning.py rename to erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py diff --git a/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt similarity index 100% rename from hr/doctype/salary_structure_earning/salary_structure_earning.txt rename to erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt diff --git a/hr/doctype/upload_attendance/README.md b/erpnext/hr/doctype/upload_attendance/README.md similarity index 100% rename from hr/doctype/upload_attendance/README.md rename to erpnext/hr/doctype/upload_attendance/README.md diff --git a/hr/doctype/leave_block_list_date/__init__.py b/erpnext/hr/doctype/upload_attendance/__init__.py similarity index 100% rename from hr/doctype/leave_block_list_date/__init__.py rename to erpnext/hr/doctype/upload_attendance/__init__.py diff --git a/hr/doctype/upload_attendance/upload_attendance.js b/erpnext/hr/doctype/upload_attendance/upload_attendance.js similarity index 92% rename from hr/doctype/upload_attendance/upload_attendance.js rename to erpnext/hr/doctype/upload_attendance/upload_attendance.js index 9f86dfe4860..ee58945dc27 100644 --- a/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({ @@ -22,7 +22,7 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({ } window.location.href = repl(wn.request.url + '?cmd=%(cmd)s&from_date=%(from_date)s&to_date=%(to_date)s', { - cmd: "hr.doctype.upload_attendance.upload_attendance.get_template", + cmd: "erpnext.hr.doctype.upload_attendance.upload_attendance.get_template", from_date: this.frm.doc.att_fr_date, to_date: this.frm.doc.att_to_date, }); @@ -36,7 +36,7 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({ wn.upload.make({ parent: $wrapper, args: { - method: 'hr.doctype.upload_attendance.upload_attendance.upload' + method: 'erpnext.hr.doctype.upload_attendance.upload_attendance.upload' }, sample_url: "e.g. http://example.com/somefile.csv", callback: function(fid, filename, r) { diff --git a/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py similarity index 97% rename from hr/doctype/upload_attendance/upload_attendance.py rename to erpnext/hr/doctype/upload_attendance/upload_attendance.py index 7bd1fd0aaa7..53b88f78c19 100644 --- a/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -51,7 +51,7 @@ def add_header(w): return w def add_data(w, args): - from accounts.utils import get_fiscal_year + from erpnext.accounts.utils import get_fiscal_year dates = get_dates(args) employees = get_active_employees() @@ -138,7 +138,7 @@ def upload(): error = True ret.append('Error for row (#%d) %s : %s' % (row_idx, len(row)>1 and row[1] or "", cstr(e))) - webnotes.errprint(webnotes.getTraceback()) + webnotes.errprint(webnotes.get_traceback()) if error: webnotes.conn.rollback() diff --git a/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt similarity index 100% rename from hr/doctype/upload_attendance/upload_attendance.txt rename to erpnext/hr/doctype/upload_attendance/upload_attendance.txt diff --git a/hr/page/__init__.py b/erpnext/hr/page/__init__.py similarity index 100% rename from hr/page/__init__.py rename to erpnext/hr/page/__init__.py diff --git a/hr/page/hr_home/__init__.py b/erpnext/hr/page/hr_home/__init__.py similarity index 100% rename from hr/page/hr_home/__init__.py rename to erpnext/hr/page/hr_home/__init__.py diff --git a/hr/page/hr_home/hr_home.js b/erpnext/hr/page/hr_home/hr_home.js similarity index 100% rename from hr/page/hr_home/hr_home.js rename to erpnext/hr/page/hr_home/hr_home.js diff --git a/hr/page/hr_home/hr_home.txt b/erpnext/hr/page/hr_home/hr_home.txt similarity index 100% rename from hr/page/hr_home/hr_home.txt rename to erpnext/hr/page/hr_home/hr_home.txt diff --git a/hr/doctype/upload_attendance/__init__.py b/erpnext/hr/report/__init__.py similarity index 100% rename from hr/doctype/upload_attendance/__init__.py rename to erpnext/hr/report/__init__.py diff --git a/hr/report/__init__.py b/erpnext/hr/report/employee_birthday/__init__.py similarity index 100% rename from hr/report/__init__.py rename to erpnext/hr/report/employee_birthday/__init__.py diff --git a/hr/report/employee_birthday/employee_birthday.js b/erpnext/hr/report/employee_birthday/employee_birthday.js similarity index 100% rename from hr/report/employee_birthday/employee_birthday.js rename to erpnext/hr/report/employee_birthday/employee_birthday.js diff --git a/hr/report/employee_birthday/employee_birthday.py b/erpnext/hr/report/employee_birthday/employee_birthday.py similarity index 100% rename from hr/report/employee_birthday/employee_birthday.py rename to erpnext/hr/report/employee_birthday/employee_birthday.py diff --git a/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.txt similarity index 100% rename from hr/report/employee_birthday/employee_birthday.txt rename to erpnext/hr/report/employee_birthday/employee_birthday.txt diff --git a/hr/report/employee_birthday/__init__.py b/erpnext/hr/report/employee_information/__init__.py similarity index 100% rename from hr/report/employee_birthday/__init__.py rename to erpnext/hr/report/employee_information/__init__.py diff --git a/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.txt similarity index 100% rename from hr/report/employee_information/employee_information.txt rename to erpnext/hr/report/employee_information/employee_information.txt diff --git a/hr/report/employee_information/__init__.py b/erpnext/hr/report/employee_leave_balance/__init__.py similarity index 100% rename from hr/report/employee_information/__init__.py rename to erpnext/hr/report/employee_leave_balance/__init__.py diff --git a/hr/report/employee_leave_balance/employee_leave_balance.js b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.js similarity index 100% rename from hr/report/employee_leave_balance/employee_leave_balance.js rename to erpnext/hr/report/employee_leave_balance/employee_leave_balance.js diff --git a/hr/report/employee_leave_balance/employee_leave_balance.py b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py similarity index 100% rename from hr/report/employee_leave_balance/employee_leave_balance.py rename to erpnext/hr/report/employee_leave_balance/employee_leave_balance.py diff --git a/hr/report/employee_leave_balance/employee_leave_balance.txt b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt similarity index 100% rename from hr/report/employee_leave_balance/employee_leave_balance.txt rename to erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt diff --git a/hr/report/employee_leave_balance/__init__.py b/erpnext/hr/report/monthly_attendance_sheet/__init__.py similarity index 100% rename from hr/report/employee_leave_balance/__init__.py rename to erpnext/hr/report/monthly_attendance_sheet/__init__.py diff --git a/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js similarity index 100% rename from hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js rename to erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js diff --git a/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py similarity index 100% rename from hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py rename to erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py diff --git a/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt similarity index 100% rename from hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt rename to erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt diff --git a/hr/report/monthly_attendance_sheet/__init__.py b/erpnext/hr/report/monthly_salary_register/__init__.py similarity index 100% rename from hr/report/monthly_attendance_sheet/__init__.py rename to erpnext/hr/report/monthly_salary_register/__init__.py diff --git a/hr/report/monthly_salary_register/monthly_salary_register.js b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js similarity index 100% rename from hr/report/monthly_salary_register/monthly_salary_register.js rename to erpnext/hr/report/monthly_salary_register/monthly_salary_register.js diff --git a/hr/report/monthly_salary_register/monthly_salary_register.py b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.py similarity index 100% rename from hr/report/monthly_salary_register/monthly_salary_register.py rename to erpnext/hr/report/monthly_salary_register/monthly_salary_register.py diff --git a/hr/report/monthly_salary_register/monthly_salary_register.txt b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt similarity index 100% rename from hr/report/monthly_salary_register/monthly_salary_register.txt rename to erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt diff --git a/hr/utils.py b/erpnext/hr/utils.py similarity index 100% rename from hr/utils.py rename to erpnext/hr/utils.py diff --git a/manufacturing/README.md b/erpnext/manufacturing/README.md similarity index 100% rename from manufacturing/README.md rename to erpnext/manufacturing/README.md diff --git a/hr/report/monthly_salary_register/__init__.py b/erpnext/manufacturing/__init__.py similarity index 100% rename from hr/report/monthly_salary_register/__init__.py rename to erpnext/manufacturing/__init__.py diff --git a/manufacturing/doctype/__init__.py b/erpnext/manufacturing/doctype/__init__.py similarity index 100% rename from manufacturing/doctype/__init__.py rename to erpnext/manufacturing/doctype/__init__.py diff --git a/manufacturing/doctype/bom/README.md b/erpnext/manufacturing/doctype/bom/README.md similarity index 100% rename from manufacturing/doctype/bom/README.md rename to erpnext/manufacturing/doctype/bom/README.md diff --git a/manufacturing/doctype/bom/__init__.py b/erpnext/manufacturing/doctype/bom/__init__.py similarity index 100% rename from manufacturing/doctype/bom/__init__.py rename to erpnext/manufacturing/doctype/bom/__init__.py diff --git a/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js similarity index 98% rename from manufacturing/doctype/bom/bom.js rename to erpnext/manufacturing/doctype/bom/bom.js index a43e5dac6b6..c0dcdfc8f1a 100644 --- a/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/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py similarity index 99% rename from manufacturing/doctype/bom/bom.py rename to erpnext/manufacturing/doctype/bom/bom.py index 7b647a7cec3..45e96f771ce 100644 --- a/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -30,7 +30,7 @@ class DocType: self.clear_operations() self.validate_main_item() - from utilities.transaction_base import validate_uom_is_integer + from erpnext.utilities.transaction_base import validate_uom_is_integer validate_uom_is_integer(self.doclist, "stock_uom", "qty") self.validate_operations() @@ -152,7 +152,7 @@ class DocType: as per valuation method (MAR/FIFO) as on costing date """ - from stock.utils import get_incoming_rate + from erpnext.stock.utils import get_incoming_rate dt = self.doc.costing_date or nowdate() time = self.doc.costing_date == nowdate() and now().split()[1] or '23:59' warehouse = webnotes.conn.sql("select warehouse from `tabBin` where item_code = %s", args['item_code']) diff --git a/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.txt similarity index 100% rename from manufacturing/doctype/bom/bom.txt rename to erpnext/manufacturing/doctype/bom/bom.txt diff --git a/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py similarity index 93% rename from manufacturing/doctype/bom/test_bom.py rename to erpnext/manufacturing/doctype/bom/test_bom.py index 7917ab3b275..5f9186a14d7 100644 --- a/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -98,14 +98,14 @@ test_records = [ class TestBOM(unittest.TestCase): def test_get_items(self): - from manufacturing.doctype.bom.bom import get_bom_items_as_dict + from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=0) self.assertTrue(test_records[2][1]["item_code"] in items_dict) self.assertTrue(test_records[2][2]["item_code"] in items_dict) self.assertEquals(len(items_dict.values()), 2) def test_get_items_exploded(self): - from manufacturing.doctype.bom.bom import get_bom_items_as_dict + from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1) self.assertTrue(test_records[2][1]["item_code"] in items_dict) self.assertFalse(test_records[2][2]["item_code"] in items_dict) @@ -114,6 +114,6 @@ class TestBOM(unittest.TestCase): self.assertEquals(len(items_dict.values()), 3) def test_get_items_list(self): - from manufacturing.doctype.bom.bom import get_bom_items + from erpnext.manufacturing.doctype.bom.bom import get_bom_items self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3) diff --git a/manufacturing/doctype/bom_explosion_item/README.md b/erpnext/manufacturing/doctype/bom_explosion_item/README.md similarity index 100% rename from manufacturing/doctype/bom_explosion_item/README.md rename to erpnext/manufacturing/doctype/bom_explosion_item/README.md diff --git a/manufacturing/doctype/bom_explosion_item/__init__.py b/erpnext/manufacturing/doctype/bom_explosion_item/__init__.py similarity index 100% rename from manufacturing/doctype/bom_explosion_item/__init__.py rename to erpnext/manufacturing/doctype/bom_explosion_item/__init__.py diff --git a/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py similarity index 100% rename from manufacturing/doctype/bom_explosion_item/bom_explosion_item.py rename to erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py diff --git a/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt similarity index 100% rename from manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt rename to erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt diff --git a/manufacturing/doctype/bom_item/README.md b/erpnext/manufacturing/doctype/bom_item/README.md similarity index 100% rename from manufacturing/doctype/bom_item/README.md rename to erpnext/manufacturing/doctype/bom_item/README.md diff --git a/manufacturing/doctype/bom_item/__init__.py b/erpnext/manufacturing/doctype/bom_item/__init__.py similarity index 100% rename from manufacturing/doctype/bom_item/__init__.py rename to erpnext/manufacturing/doctype/bom_item/__init__.py diff --git a/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py similarity index 100% rename from manufacturing/doctype/bom_item/bom_item.py rename to erpnext/manufacturing/doctype/bom_item/bom_item.py diff --git a/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt similarity index 100% rename from manufacturing/doctype/bom_item/bom_item.txt rename to erpnext/manufacturing/doctype/bom_item/bom_item.txt diff --git a/manufacturing/doctype/bom_operation/README.md b/erpnext/manufacturing/doctype/bom_operation/README.md similarity index 100% rename from manufacturing/doctype/bom_operation/README.md rename to erpnext/manufacturing/doctype/bom_operation/README.md diff --git a/manufacturing/doctype/bom_operation/__init__.py b/erpnext/manufacturing/doctype/bom_operation/__init__.py similarity index 100% rename from manufacturing/doctype/bom_operation/__init__.py rename to erpnext/manufacturing/doctype/bom_operation/__init__.py diff --git a/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py similarity index 100% rename from manufacturing/doctype/bom_operation/bom_operation.py rename to erpnext/manufacturing/doctype/bom_operation/bom_operation.py diff --git a/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt similarity index 100% rename from manufacturing/doctype/bom_operation/bom_operation.txt rename to erpnext/manufacturing/doctype/bom_operation/bom_operation.txt diff --git a/manufacturing/doctype/bom_replace_tool/README.md b/erpnext/manufacturing/doctype/bom_replace_tool/README.md similarity index 100% rename from manufacturing/doctype/bom_replace_tool/README.md rename to erpnext/manufacturing/doctype/bom_replace_tool/README.md diff --git a/manufacturing/__init__.py b/erpnext/manufacturing/doctype/bom_replace_tool/__init__.py similarity index 100% rename from manufacturing/__init__.py rename to erpnext/manufacturing/doctype/bom_replace_tool/__init__.py diff --git a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js similarity index 82% rename from manufacturing/doctype/bom_replace_tool/bom_replace_tool.js rename to erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js index 3bf31f93b64..e5415ade86f 100644 --- a/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/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py similarity index 100% rename from manufacturing/doctype/bom_replace_tool/bom_replace_tool.py rename to erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py diff --git a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt similarity index 100% rename from manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt rename to erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt diff --git a/manufacturing/doctype/production_order/README.md b/erpnext/manufacturing/doctype/production_order/README.md similarity index 100% rename from manufacturing/doctype/production_order/README.md rename to erpnext/manufacturing/doctype/production_order/README.md diff --git a/manufacturing/doctype/production_order/__init__.py b/erpnext/manufacturing/doctype/production_order/__init__.py similarity index 100% rename from manufacturing/doctype/production_order/__init__.py rename to erpnext/manufacturing/doctype/production_order/__init__.py diff --git a/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js similarity index 96% rename from manufacturing/doctype/production_order/production_order.js rename to erpnext/manufacturing/doctype/production_order/production_order.js index 31900ea57af..480f1a6dcce 100644 --- a/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -39,7 +39,7 @@ $.extend(cur_frm.cscript, { var me = this; wn.call({ - method:"manufacturing.doctype.production_order.production_order.make_stock_entry", + method:"erpnext.manufacturing.doctype.production_order.production_order.make_stock_entry", args: { "production_order_id": me.frm.doc.name, "purpose": purpose @@ -108,7 +108,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/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py similarity index 95% rename from manufacturing/doctype/production_order/production_order.py rename to erpnext/manufacturing/doctype/production_order/production_order.py index e00b3dc2883..8a47a8e1554 100644 --- a/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -19,15 +19,15 @@ class DocType: if self.doc.docstatus == 0: self.doc.status = "Draft" - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "In Process", "Completed", "Cancelled"]) self.validate_bom_no() self.validate_sales_order() self.validate_warehouse() - from utilities.transaction_base import validate_uom_is_integer + from erpnext.utilities.transaction_base import validate_uom_is_integer validate_uom_is_integer(self.doclist, "stock_uom", ["qty", "produced_qty"]) def validate_bom_no(self): @@ -54,7 +54,7 @@ class DocType: self.validate_production_order_against_so() def validate_warehouse(self): - from stock.utils import validate_warehouse_company + from erpnext.stock.utils import validate_warehouse_company for w in [self.doc.fg_warehouse, self.doc.wip_warehouse]: validate_warehouse_company(w, self.doc.company) @@ -131,7 +131,7 @@ class DocType: "posting_date": nowdate(), "planned_qty": flt(qty) } - from stock.utils import update_bin + from erpnext.stock.utils import update_bin update_bin(args) @webnotes.whitelist() diff --git a/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.txt similarity index 100% rename from manufacturing/doctype/production_order/production_order.txt rename to erpnext/manufacturing/doctype/production_order/production_order.txt diff --git a/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py similarity index 78% rename from manufacturing/doctype/production_order/test_production_order.py rename to erpnext/manufacturing/doctype/production_order/test_production_order.py index 52697292c8e..9b1300f0395 100644 --- a/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -5,8 +5,9 @@ from __future__ import unicode_literals import unittest import webnotes -from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory -from manufacturing.doctype.production_order.production_order import make_stock_entry +from webnotes.utils import cstr, getdate +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory +from erpnext.manufacturing.doctype.production_order.production_order import make_stock_entry class TestProductionOrder(unittest.TestCase): @@ -20,7 +21,7 @@ class TestProductionOrder(unittest.TestCase): pro_bean.insert() pro_bean.submit() - from stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records + from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records mr1 = webnotes.bean(copy = se_test_records[0]) mr1.insert() mr1.submit() @@ -32,7 +33,7 @@ class TestProductionOrder(unittest.TestCase): stock_entry = make_stock_entry(pro_bean.doc.name, "Manufacture/Repack") stock_entry = webnotes.bean(stock_entry) - + stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" stock_entry.doc.fg_completed_qty = 4 stock_entry.run_method("get_items") stock_entry.submit() @@ -45,12 +46,12 @@ class TestProductionOrder(unittest.TestCase): return pro_bean.doc.name def test_over_production(self): - from stock.doctype.stock_entry.stock_entry import StockOverProductionError + from erpnext.stock.doctype.stock_entry.stock_entry import StockOverProductionError pro_order = self.test_planned_qty() stock_entry = make_stock_entry(pro_order, "Manufacture/Repack") stock_entry = webnotes.bean(stock_entry) - + stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" stock_entry.doc.fg_completed_qty = 15 stock_entry.run_method("get_items") stock_entry.insert() diff --git a/manufacturing/doctype/production_plan_item/README.md b/erpnext/manufacturing/doctype/production_plan_item/README.md similarity index 100% rename from manufacturing/doctype/production_plan_item/README.md rename to erpnext/manufacturing/doctype/production_plan_item/README.md diff --git a/manufacturing/doctype/production_plan_item/__init__.py b/erpnext/manufacturing/doctype/production_plan_item/__init__.py similarity index 100% rename from manufacturing/doctype/production_plan_item/__init__.py rename to erpnext/manufacturing/doctype/production_plan_item/__init__.py diff --git a/manufacturing/doctype/production_plan_item/production_plan_item.py b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py similarity index 100% rename from manufacturing/doctype/production_plan_item/production_plan_item.py rename to erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py diff --git a/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt similarity index 100% rename from manufacturing/doctype/production_plan_item/production_plan_item.txt rename to erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt diff --git a/manufacturing/doctype/production_plan_sales_order/README.md b/erpnext/manufacturing/doctype/production_plan_sales_order/README.md similarity index 100% rename from manufacturing/doctype/production_plan_sales_order/README.md rename to erpnext/manufacturing/doctype/production_plan_sales_order/README.md diff --git a/manufacturing/doctype/production_plan_sales_order/__init__.py b/erpnext/manufacturing/doctype/production_plan_sales_order/__init__.py similarity index 100% rename from manufacturing/doctype/production_plan_sales_order/__init__.py rename to erpnext/manufacturing/doctype/production_plan_sales_order/__init__.py diff --git a/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py similarity index 100% rename from manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py rename to erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py diff --git a/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt similarity index 100% rename from manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt rename to erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt diff --git a/manufacturing/doctype/production_planning_tool/README.md b/erpnext/manufacturing/doctype/production_planning_tool/README.md similarity index 100% rename from manufacturing/doctype/production_planning_tool/README.md rename to erpnext/manufacturing/doctype/production_planning_tool/README.md diff --git a/manufacturing/doctype/production_planning_tool/__init__.py b/erpnext/manufacturing/doctype/production_planning_tool/__init__.py similarity index 100% rename from manufacturing/doctype/production_planning_tool/__init__.py rename to erpnext/manufacturing/doctype/production_planning_tool/__init__.py diff --git a/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js similarity index 94% rename from manufacturing/doctype/production_planning_tool/production_planning_tool.js rename to erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js index 870f01fd38f..f52fb8d6940 100644 --- a/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/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py similarity index 98% rename from manufacturing/doctype/production_planning_tool/production_planning_tool.py rename to erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 29232f5f519..3b529cbe102 100644 --- a/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -174,7 +174,7 @@ class DocType: """It will raise production order (Draft) for all distinct FG items""" self.validate_data() - from utilities.transaction_base import validate_uom_is_integer + from erpnext.utilities.transaction_base import validate_uom_is_integer validate_uom_is_integer(self.doclist, "stock_uom", "planned_qty") items = self.get_distinct_items_and_boms()[1] @@ -212,7 +212,7 @@ class DocType: def create_production_order(self, items): """Create production order. Called from Production Planning Tool""" - from manufacturing.doctype.production_order.production_order import OverProductionError + from erpnext.manufacturing.doctype.production_order.production_order import OverProductionError pro_list = [] for key in items: @@ -362,7 +362,7 @@ class DocType: def insert_purchase_request(self): items_to_be_requested = self.get_requested_items() - from accounts.utils import get_fiscal_year + from erpnext.accounts.utils import get_fiscal_year fiscal_year = get_fiscal_year(nowdate())[0] purchase_request_list = [] @@ -408,4 +408,4 @@ class DocType: msgprint("Material Request(s) created: \n%s" % "\n".join(pur_req)) else: - msgprint(_("Nothing to request")) \ No newline at end of file + msgprint(_("Nothing to request")) diff --git a/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt similarity index 100% rename from manufacturing/doctype/production_planning_tool/production_planning_tool.txt rename to erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt diff --git a/manufacturing/doctype/workstation/README.md b/erpnext/manufacturing/doctype/workstation/README.md similarity index 100% rename from manufacturing/doctype/workstation/README.md rename to erpnext/manufacturing/doctype/workstation/README.md diff --git a/manufacturing/doctype/workstation/__init__.py b/erpnext/manufacturing/doctype/workstation/__init__.py similarity index 100% rename from manufacturing/doctype/workstation/__init__.py rename to erpnext/manufacturing/doctype/workstation/__init__.py diff --git a/manufacturing/doctype/workstation/workstation.js b/erpnext/manufacturing/doctype/workstation/workstation.js similarity index 100% rename from manufacturing/doctype/workstation/workstation.js rename to erpnext/manufacturing/doctype/workstation/workstation.js diff --git a/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py similarity index 100% rename from manufacturing/doctype/workstation/workstation.py rename to erpnext/manufacturing/doctype/workstation/workstation.py diff --git a/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.txt similarity index 100% rename from manufacturing/doctype/workstation/workstation.txt rename to erpnext/manufacturing/doctype/workstation/workstation.txt diff --git a/manufacturing/page/__init__.py b/erpnext/manufacturing/page/__init__.py similarity index 100% rename from manufacturing/page/__init__.py rename to erpnext/manufacturing/page/__init__.py diff --git a/manufacturing/page/manufacturing_home/__init__.py b/erpnext/manufacturing/page/manufacturing_home/__init__.py similarity index 100% rename from manufacturing/page/manufacturing_home/__init__.py rename to erpnext/manufacturing/page/manufacturing_home/__init__.py diff --git a/manufacturing/page/manufacturing_home/manufacturing_home.js b/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.js similarity index 100% rename from manufacturing/page/manufacturing_home/manufacturing_home.js rename to erpnext/manufacturing/page/manufacturing_home/manufacturing_home.js diff --git a/manufacturing/page/manufacturing_home/manufacturing_home.txt b/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.txt similarity index 100% rename from manufacturing/page/manufacturing_home/manufacturing_home.txt rename to erpnext/manufacturing/page/manufacturing_home/manufacturing_home.txt diff --git a/manufacturing/doctype/bom_replace_tool/__init__.py b/erpnext/manufacturing/report/__init__.py similarity index 100% rename from manufacturing/doctype/bom_replace_tool/__init__.py rename to erpnext/manufacturing/report/__init__.py diff --git a/manufacturing/report/__init__.py b/erpnext/manufacturing/report/completed_production_orders/__init__.py similarity index 100% rename from manufacturing/report/__init__.py rename to erpnext/manufacturing/report/completed_production_orders/__init__.py diff --git a/manufacturing/report/completed_production_orders/completed_production_orders.txt b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt similarity index 100% rename from manufacturing/report/completed_production_orders/completed_production_orders.txt rename to erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt diff --git a/manufacturing/report/completed_production_orders/__init__.py b/erpnext/manufacturing/report/issued_items_against_production_order/__init__.py similarity index 100% rename from manufacturing/report/completed_production_orders/__init__.py rename to erpnext/manufacturing/report/issued_items_against_production_order/__init__.py diff --git a/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt b/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt similarity index 100% rename from manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt rename to erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt diff --git a/manufacturing/report/issued_items_against_production_order/__init__.py b/erpnext/manufacturing/report/open_production_orders/__init__.py similarity index 100% rename from manufacturing/report/issued_items_against_production_order/__init__.py rename to erpnext/manufacturing/report/open_production_orders/__init__.py diff --git a/manufacturing/report/open_production_orders/open_production_orders.txt b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt similarity index 100% rename from manufacturing/report/open_production_orders/open_production_orders.txt rename to erpnext/manufacturing/report/open_production_orders/open_production_orders.txt diff --git a/manufacturing/report/open_production_orders/__init__.py b/erpnext/manufacturing/report/production_orders_in_progress/__init__.py similarity index 100% rename from manufacturing/report/open_production_orders/__init__.py rename to erpnext/manufacturing/report/production_orders_in_progress/__init__.py diff --git a/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt b/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt similarity index 100% rename from manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt rename to erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt diff --git a/erpnext/modules.txt b/erpnext/modules.txt new file mode 100644 index 00000000000..f7857e43341 --- /dev/null +++ b/erpnext/modules.txt @@ -0,0 +1,11 @@ +accounts +buying +home +hr +manufacturing +projects +selling +setup +stock +support +utilities \ No newline at end of file diff --git a/erpnext/patches.txt b/erpnext/patches.txt new file mode 100644 index 00000000000..ce41342f79b --- /dev/null +++ b/erpnext/patches.txt @@ -0,0 +1,4 @@ +# patches after permission rewrite +patches.1312.p02_update_user_properties +patches.1312.p03_move_warehouse_user_to_restrictions +patches.1312.p04_new_permissions \ No newline at end of file diff --git a/manufacturing/report/production_orders_in_progress/__init__.py b/erpnext/patches/1311/__init__.py similarity index 100% rename from manufacturing/report/production_orders_in_progress/__init__.py rename to erpnext/patches/1311/__init__.py diff --git a/patches/1311/p01_cleanup.py b/erpnext/patches/1311/p01_cleanup.py similarity index 92% rename from patches/1311/p01_cleanup.py rename to erpnext/patches/1311/p01_cleanup.py index 04d8f6a1614..23f65769273 100644 --- a/patches/1311/p01_cleanup.py +++ b/erpnext/patches/1311/p01_cleanup.py @@ -9,7 +9,7 @@ def execute(): webnotes.reload_doc("buying", "doctype", "purchase_order") webnotes.reload_doc("selling", "doctype", "lead") - from core.doctype.custom_field.custom_field import create_custom_field_if_values_exist + from webnotes.core.doctype.custom_field.custom_field import create_custom_field_if_values_exist create_custom_field_if_values_exist("Material Request", {"fieldtype":"Text", "fieldname":"remark", "label":"Remarks","insert_after":"Fiscal Year"}) diff --git a/patches/1311/p01_make_gl_entries_for_si.py b/erpnext/patches/1311/p01_make_gl_entries_for_si.py similarity index 100% rename from patches/1311/p01_make_gl_entries_for_si.py rename to erpnext/patches/1311/p01_make_gl_entries_for_si.py diff --git a/patches/1311/p02_index_singles.py b/erpnext/patches/1311/p02_index_singles.py similarity index 100% rename from patches/1311/p02_index_singles.py rename to erpnext/patches/1311/p02_index_singles.py diff --git a/patches/1311/p03_update_reqd_report_fields.py b/erpnext/patches/1311/p03_update_reqd_report_fields.py similarity index 100% rename from patches/1311/p03_update_reqd_report_fields.py rename to erpnext/patches/1311/p03_update_reqd_report_fields.py diff --git a/patches/1311/p04_update_comments.py b/erpnext/patches/1311/p04_update_comments.py similarity index 100% rename from patches/1311/p04_update_comments.py rename to erpnext/patches/1311/p04_update_comments.py diff --git a/patches/1311/p04_update_year_end_date_of_fiscal_year.py b/erpnext/patches/1311/p04_update_year_end_date_of_fiscal_year.py similarity index 100% rename from patches/1311/p04_update_year_end_date_of_fiscal_year.py rename to erpnext/patches/1311/p04_update_year_end_date_of_fiscal_year.py diff --git a/patches/1311/p05_website_brand_html.py b/erpnext/patches/1311/p05_website_brand_html.py similarity index 100% rename from patches/1311/p05_website_brand_html.py rename to erpnext/patches/1311/p05_website_brand_html.py diff --git a/patches/1311/p06_fix_report_columns.py b/erpnext/patches/1311/p06_fix_report_columns.py similarity index 100% rename from patches/1311/p06_fix_report_columns.py rename to erpnext/patches/1311/p06_fix_report_columns.py diff --git a/patches/1311/p07_scheduler_errors_digest.py b/erpnext/patches/1311/p07_scheduler_errors_digest.py similarity index 100% rename from patches/1311/p07_scheduler_errors_digest.py rename to erpnext/patches/1311/p07_scheduler_errors_digest.py diff --git a/patches/1311/p08_email_digest_recipients.py b/erpnext/patches/1311/p08_email_digest_recipients.py similarity index 100% rename from patches/1311/p08_email_digest_recipients.py rename to erpnext/patches/1311/p08_email_digest_recipients.py diff --git a/patches/1311/__init__.py b/erpnext/patches/1312/__init__.py similarity index 100% rename from patches/1311/__init__.py rename to erpnext/patches/1312/__init__.py diff --git a/patches/1312/p01_delete_old_stock_reports.py b/erpnext/patches/1312/p01_delete_old_stock_reports.py similarity index 100% rename from patches/1312/p01_delete_old_stock_reports.py rename to erpnext/patches/1312/p01_delete_old_stock_reports.py diff --git a/erpnext/patches/1312/p02_update_item_details_in_item_price.py b/erpnext/patches/1312/p02_update_item_details_in_item_price.py new file mode 100644 index 00000000000..c19988c9ef7 --- /dev/null +++ b/erpnext/patches/1312/p02_update_item_details_in_item_price.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes + +def execute(): + webnotes.conn.sql("""update `tabItem Price` ip INNER JOIN `tabItem` i + ON (ip.item_code = i.name) + set ip.item_name = i.item_name, ip.item_description = i.description""") \ No newline at end of file diff --git a/patches/__init__.py b/erpnext/patches/__init__.py similarity index 100% rename from patches/__init__.py rename to erpnext/patches/__init__.py diff --git a/patches/1312/__init__.py b/erpnext/patches/april_2013/__init__.py similarity index 100% rename from patches/1312/__init__.py rename to erpnext/patches/april_2013/__init__.py diff --git a/patches/april_2013/p01_update_serial_no_valuation_rate.py b/erpnext/patches/april_2013/p01_update_serial_no_valuation_rate.py similarity index 95% rename from patches/april_2013/p01_update_serial_no_valuation_rate.py rename to erpnext/patches/april_2013/p01_update_serial_no_valuation_rate.py index 18fe9b5b0c3..c6f0612f878 100644 --- a/patches/april_2013/p01_update_serial_no_valuation_rate.py +++ b/erpnext/patches/april_2013/p01_update_serial_no_valuation_rate.py @@ -3,7 +3,7 @@ import webnotes from webnotes.utils import cstr -from stock.stock_ledger import update_entries_after +from erpnext.stock.stock_ledger import update_entries_after def execute(): webnotes.conn.auto_commit_on_many_writes = 1 diff --git a/patches/april_2013/p02_add_country_and_currency.py b/erpnext/patches/april_2013/p02_add_country_and_currency.py similarity index 100% rename from patches/april_2013/p02_add_country_and_currency.py rename to erpnext/patches/april_2013/p02_add_country_and_currency.py diff --git a/patches/april_2013/p03_fixes_for_lead_in_quotation.py b/erpnext/patches/april_2013/p03_fixes_for_lead_in_quotation.py similarity index 100% rename from patches/april_2013/p03_fixes_for_lead_in_quotation.py rename to erpnext/patches/april_2013/p03_fixes_for_lead_in_quotation.py diff --git a/patches/april_2013/p04_reverse_modules_list.py b/erpnext/patches/april_2013/p04_reverse_modules_list.py similarity index 100% rename from patches/april_2013/p04_reverse_modules_list.py rename to erpnext/patches/april_2013/p04_reverse_modules_list.py diff --git a/patches/april_2013/p04_update_role_in_pages.py b/erpnext/patches/april_2013/p04_update_role_in_pages.py similarity index 100% rename from patches/april_2013/p04_update_role_in_pages.py rename to erpnext/patches/april_2013/p04_update_role_in_pages.py diff --git a/patches/april_2013/p05_fixes_in_reverse_modules.py b/erpnext/patches/april_2013/p05_fixes_in_reverse_modules.py similarity index 100% rename from patches/april_2013/p05_fixes_in_reverse_modules.py rename to erpnext/patches/april_2013/p05_fixes_in_reverse_modules.py diff --git a/patches/april_2013/p05_update_file_data.py b/erpnext/patches/april_2013/p05_update_file_data.py similarity index 98% rename from patches/april_2013/p05_update_file_data.py rename to erpnext/patches/april_2013/p05_update_file_data.py index b41019d3521..1403dff3379 100644 --- a/patches/april_2013/p05_update_file_data.py +++ b/erpnext/patches/april_2013/p05_update_file_data.py @@ -35,7 +35,7 @@ def update_file_list(doctype, singles): webnotes.conn.commit() webnotes.conn.sql("""alter table `tab%s` drop column `file_list`""" % doctype) except Exception, e: - print webnotes.getTraceback() + print webnotes.get_traceback() if (e.args and e.args[0]!=1054) or not e.args: raise diff --git a/patches/april_2013/p06_default_cost_center.py b/erpnext/patches/april_2013/p06_default_cost_center.py similarity index 100% rename from patches/april_2013/p06_default_cost_center.py rename to erpnext/patches/april_2013/p06_default_cost_center.py diff --git a/patches/april_2013/p06_update_file_size.py b/erpnext/patches/april_2013/p06_update_file_size.py similarity index 100% rename from patches/april_2013/p06_update_file_size.py rename to erpnext/patches/april_2013/p06_update_file_size.py diff --git a/patches/april_2013/p07_rename_cost_center_other_charges.py b/erpnext/patches/april_2013/p07_rename_cost_center_other_charges.py similarity index 100% rename from patches/april_2013/p07_rename_cost_center_other_charges.py rename to erpnext/patches/april_2013/p07_rename_cost_center_other_charges.py diff --git a/patches/april_2013/p07_update_file_data_2.py b/erpnext/patches/april_2013/p07_update_file_data_2.py similarity index 100% rename from patches/april_2013/p07_update_file_data_2.py rename to erpnext/patches/april_2013/p07_update_file_data_2.py diff --git a/patches/april_2013/rebuild_sales_browser.py b/erpnext/patches/april_2013/rebuild_sales_browser.py similarity index 100% rename from patches/april_2013/rebuild_sales_browser.py rename to erpnext/patches/april_2013/rebuild_sales_browser.py diff --git a/patches/april_2013/__init__.py b/erpnext/patches/august_2013/__init__.py similarity index 100% rename from patches/april_2013/__init__.py rename to erpnext/patches/august_2013/__init__.py diff --git a/patches/august_2013/fix_fiscal_year.py b/erpnext/patches/august_2013/fix_fiscal_year.py similarity index 100% rename from patches/august_2013/fix_fiscal_year.py rename to erpnext/patches/august_2013/fix_fiscal_year.py diff --git a/patches/august_2013/p01_auto_accounting_for_stock_patch.py b/erpnext/patches/august_2013/p01_auto_accounting_for_stock_patch.py similarity index 100% rename from patches/august_2013/p01_auto_accounting_for_stock_patch.py rename to erpnext/patches/august_2013/p01_auto_accounting_for_stock_patch.py diff --git a/patches/august_2013/p01_hr_settings.py b/erpnext/patches/august_2013/p01_hr_settings.py similarity index 100% rename from patches/august_2013/p01_hr_settings.py rename to erpnext/patches/august_2013/p01_hr_settings.py diff --git a/patches/august_2013/p02_rename_price_list.py b/erpnext/patches/august_2013/p02_rename_price_list.py similarity index 100% rename from patches/august_2013/p02_rename_price_list.py rename to erpnext/patches/august_2013/p02_rename_price_list.py diff --git a/patches/august_2013/p03_pos_setting_replace_customer_account.py b/erpnext/patches/august_2013/p03_pos_setting_replace_customer_account.py similarity index 100% rename from patches/august_2013/p03_pos_setting_replace_customer_account.py rename to erpnext/patches/august_2013/p03_pos_setting_replace_customer_account.py diff --git a/patches/august_2013/p05_employee_birthdays.py b/erpnext/patches/august_2013/p05_employee_birthdays.py similarity index 100% rename from patches/august_2013/p05_employee_birthdays.py rename to erpnext/patches/august_2013/p05_employee_birthdays.py diff --git a/patches/august_2013/p05_update_serial_no_status.py b/erpnext/patches/august_2013/p05_update_serial_no_status.py similarity index 100% rename from patches/august_2013/p05_update_serial_no_status.py rename to erpnext/patches/august_2013/p05_update_serial_no_status.py diff --git a/patches/august_2013/p06_deprecate_is_cancelled.py b/erpnext/patches/august_2013/p06_deprecate_is_cancelled.py similarity index 100% rename from patches/august_2013/p06_deprecate_is_cancelled.py rename to erpnext/patches/august_2013/p06_deprecate_is_cancelled.py diff --git a/patches/august_2013/p06_fix_sle_against_stock_entry.py b/erpnext/patches/august_2013/p06_fix_sle_against_stock_entry.py similarity index 100% rename from patches/august_2013/p06_fix_sle_against_stock_entry.py rename to erpnext/patches/august_2013/p06_fix_sle_against_stock_entry.py diff --git a/patches/august_2013/__init__.py b/erpnext/patches/december_2012/__init__.py similarity index 100% rename from patches/august_2013/__init__.py rename to erpnext/patches/december_2012/__init__.py diff --git a/patches/december_2012/address_title.py b/erpnext/patches/december_2012/address_title.py similarity index 100% rename from patches/december_2012/address_title.py rename to erpnext/patches/december_2012/address_title.py diff --git a/patches/december_2012/delete_form16_print_format.py b/erpnext/patches/december_2012/delete_form16_print_format.py similarity index 100% rename from patches/december_2012/delete_form16_print_format.py rename to erpnext/patches/december_2012/delete_form16_print_format.py diff --git a/patches/december_2012/deleted_contact_address_patch.py b/erpnext/patches/december_2012/deleted_contact_address_patch.py similarity index 100% rename from patches/december_2012/deleted_contact_address_patch.py rename to erpnext/patches/december_2012/deleted_contact_address_patch.py diff --git a/patches/december_2012/deprecate_tds.py b/erpnext/patches/december_2012/deprecate_tds.py similarity index 100% rename from patches/december_2012/deprecate_tds.py rename to erpnext/patches/december_2012/deprecate_tds.py diff --git a/patches/december_2012/expense_leave_reload.py b/erpnext/patches/december_2012/expense_leave_reload.py similarity index 100% rename from patches/december_2012/expense_leave_reload.py rename to erpnext/patches/december_2012/expense_leave_reload.py diff --git a/patches/december_2012/file_list_rename.py b/erpnext/patches/december_2012/file_list_rename.py similarity index 100% rename from patches/december_2012/file_list_rename.py rename to erpnext/patches/december_2012/file_list_rename.py diff --git a/patches/december_2012/fix_default_print_format.py b/erpnext/patches/december_2012/fix_default_print_format.py similarity index 100% rename from patches/december_2012/fix_default_print_format.py rename to erpnext/patches/december_2012/fix_default_print_format.py diff --git a/patches/december_2012/move_recent_to_memcache.py b/erpnext/patches/december_2012/move_recent_to_memcache.py similarity index 100% rename from patches/december_2012/move_recent_to_memcache.py rename to erpnext/patches/december_2012/move_recent_to_memcache.py diff --git a/patches/december_2012/production_cleanup.py b/erpnext/patches/december_2012/production_cleanup.py similarity index 100% rename from patches/december_2012/production_cleanup.py rename to erpnext/patches/december_2012/production_cleanup.py diff --git a/patches/december_2012/production_order_naming_series.py b/erpnext/patches/december_2012/production_order_naming_series.py similarity index 100% rename from patches/december_2012/production_order_naming_series.py rename to erpnext/patches/december_2012/production_order_naming_series.py diff --git a/patches/december_2012/rebuild_item_group_tree.py b/erpnext/patches/december_2012/rebuild_item_group_tree.py similarity index 100% rename from patches/december_2012/rebuild_item_group_tree.py rename to erpnext/patches/december_2012/rebuild_item_group_tree.py diff --git a/patches/december_2012/remove_quotation_next_contact.py b/erpnext/patches/december_2012/remove_quotation_next_contact.py similarity index 100% rename from patches/december_2012/remove_quotation_next_contact.py rename to erpnext/patches/december_2012/remove_quotation_next_contact.py diff --git a/patches/december_2012/replace_createlocal.py b/erpnext/patches/december_2012/replace_createlocal.py similarity index 100% rename from patches/december_2012/replace_createlocal.py rename to erpnext/patches/december_2012/replace_createlocal.py diff --git a/patches/december_2012/repost_ordered_qty.py b/erpnext/patches/december_2012/repost_ordered_qty.py similarity index 81% rename from patches/december_2012/repost_ordered_qty.py rename to erpnext/patches/december_2012/repost_ordered_qty.py index 05cbb64e77a..5b24fdf34b6 100644 --- a/patches/december_2012/repost_ordered_qty.py +++ b/erpnext/patches/december_2012/repost_ordered_qty.py @@ -3,7 +3,7 @@ def execute(): import webnotes - from utilities.repost_stock import get_ordered_qty, update_bin + from erpnext.utilities.repost_stock import get_ordered_qty, update_bin for d in webnotes.conn.sql("select item_code, warehouse from tabBin"): update_bin(d[0], d[1], { diff --git a/patches/december_2012/repost_projected_qty.py b/erpnext/patches/december_2012/repost_projected_qty.py similarity index 100% rename from patches/december_2012/repost_projected_qty.py rename to erpnext/patches/december_2012/repost_projected_qty.py diff --git a/patches/december_2012/stock_entry_cleanup.py b/erpnext/patches/december_2012/stock_entry_cleanup.py similarity index 100% rename from patches/december_2012/stock_entry_cleanup.py rename to erpnext/patches/december_2012/stock_entry_cleanup.py diff --git a/patches/december_2012/update_print_width.py b/erpnext/patches/december_2012/update_print_width.py similarity index 100% rename from patches/december_2012/update_print_width.py rename to erpnext/patches/december_2012/update_print_width.py diff --git a/patches/december_2012/website_cache_refactor.py b/erpnext/patches/december_2012/website_cache_refactor.py similarity index 100% rename from patches/december_2012/website_cache_refactor.py rename to erpnext/patches/december_2012/website_cache_refactor.py diff --git a/patches/december_2012/__init__.py b/erpnext/patches/february_2013/__init__.py similarity index 100% rename from patches/december_2012/__init__.py rename to erpnext/patches/february_2013/__init__.py diff --git a/patches/february_2013/account_negative_balance.py b/erpnext/patches/february_2013/account_negative_balance.py similarity index 100% rename from patches/february_2013/account_negative_balance.py rename to erpnext/patches/february_2013/account_negative_balance.py diff --git a/patches/february_2013/fix_outstanding.py b/erpnext/patches/february_2013/fix_outstanding.py similarity index 100% rename from patches/february_2013/fix_outstanding.py rename to erpnext/patches/february_2013/fix_outstanding.py diff --git a/patches/february_2013/gle_floating_point_issue_revisited.py b/erpnext/patches/february_2013/gle_floating_point_issue_revisited.py similarity index 100% rename from patches/february_2013/gle_floating_point_issue_revisited.py rename to erpnext/patches/february_2013/gle_floating_point_issue_revisited.py diff --git a/patches/february_2013/p01_event.py b/erpnext/patches/february_2013/p01_event.py similarity index 100% rename from patches/february_2013/p01_event.py rename to erpnext/patches/february_2013/p01_event.py diff --git a/patches/february_2013/p02_email_digest.py b/erpnext/patches/february_2013/p02_email_digest.py similarity index 100% rename from patches/february_2013/p02_email_digest.py rename to erpnext/patches/february_2013/p02_email_digest.py diff --git a/patches/february_2013/p03_material_request.py b/erpnext/patches/february_2013/p03_material_request.py similarity index 100% rename from patches/february_2013/p03_material_request.py rename to erpnext/patches/february_2013/p03_material_request.py diff --git a/patches/february_2013/p04_remove_old_doctypes.py b/erpnext/patches/february_2013/p04_remove_old_doctypes.py similarity index 100% rename from patches/february_2013/p04_remove_old_doctypes.py rename to erpnext/patches/february_2013/p04_remove_old_doctypes.py diff --git a/patches/february_2013/p05_leave_application.py b/erpnext/patches/february_2013/p05_leave_application.py similarity index 100% rename from patches/february_2013/p05_leave_application.py rename to erpnext/patches/february_2013/p05_leave_application.py diff --git a/patches/february_2013/p08_todo_query_report.py b/erpnext/patches/february_2013/p08_todo_query_report.py similarity index 100% rename from patches/february_2013/p08_todo_query_report.py rename to erpnext/patches/february_2013/p08_todo_query_report.py diff --git a/patches/february_2013/p09_remove_cancelled_warehouses.py b/erpnext/patches/february_2013/p09_remove_cancelled_warehouses.py similarity index 100% rename from patches/february_2013/p09_remove_cancelled_warehouses.py rename to erpnext/patches/february_2013/p09_remove_cancelled_warehouses.py diff --git a/patches/february_2013/p09_timesheets.py b/erpnext/patches/february_2013/p09_timesheets.py similarity index 100% rename from patches/february_2013/p09_timesheets.py rename to erpnext/patches/february_2013/p09_timesheets.py diff --git a/patches/february_2013/payment_reconciliation_reset_values.py b/erpnext/patches/february_2013/payment_reconciliation_reset_values.py similarity index 100% rename from patches/february_2013/payment_reconciliation_reset_values.py rename to erpnext/patches/february_2013/payment_reconciliation_reset_values.py diff --git a/patches/february_2013/reload_bom_replace_tool_permission.py b/erpnext/patches/february_2013/reload_bom_replace_tool_permission.py similarity index 100% rename from patches/february_2013/reload_bom_replace_tool_permission.py rename to erpnext/patches/february_2013/reload_bom_replace_tool_permission.py diff --git a/patches/february_2013/remove_account_utils_folder.py b/erpnext/patches/february_2013/remove_account_utils_folder.py similarity index 100% rename from patches/february_2013/remove_account_utils_folder.py rename to erpnext/patches/february_2013/remove_account_utils_folder.py diff --git a/patches/february_2013/remove_gl_mapper.py b/erpnext/patches/february_2013/remove_gl_mapper.py similarity index 100% rename from patches/february_2013/remove_gl_mapper.py rename to erpnext/patches/february_2013/remove_gl_mapper.py diff --git a/patches/february_2013/repost_reserved_qty.py b/erpnext/patches/february_2013/repost_reserved_qty.py similarity index 84% rename from patches/february_2013/repost_reserved_qty.py rename to erpnext/patches/february_2013/repost_reserved_qty.py index 442a81b109a..fbc6f1a1723 100644 --- a/patches/february_2013/repost_reserved_qty.py +++ b/erpnext/patches/february_2013/repost_reserved_qty.py @@ -4,7 +4,7 @@ import webnotes def execute(): webnotes.conn.auto_commit_on_many_writes = 1 - from utilities.repost_stock import get_reserved_qty, update_bin + from erpnext.utilities.repost_stock import get_reserved_qty, update_bin for d in webnotes.conn.sql("select item_code, warehouse from tabBin"): update_bin(d[0], d[1], { diff --git a/patches/february_2013/update_company_in_leave_application.py b/erpnext/patches/february_2013/update_company_in_leave_application.py similarity index 100% rename from patches/february_2013/update_company_in_leave_application.py rename to erpnext/patches/february_2013/update_company_in_leave_application.py diff --git a/patches/february_2013/__init__.py b/erpnext/patches/january_2013/__init__.py similarity index 100% rename from patches/february_2013/__init__.py rename to erpnext/patches/january_2013/__init__.py diff --git a/patches/january_2013/change_patch_structure.py b/erpnext/patches/january_2013/change_patch_structure.py similarity index 100% rename from patches/january_2013/change_patch_structure.py rename to erpnext/patches/january_2013/change_patch_structure.py diff --git a/patches/january_2013/enable_currencies.py b/erpnext/patches/january_2013/enable_currencies.py similarity index 100% rename from patches/january_2013/enable_currencies.py rename to erpnext/patches/january_2013/enable_currencies.py diff --git a/patches/january_2013/file_list_rename_returns.py b/erpnext/patches/january_2013/file_list_rename_returns.py similarity index 100% rename from patches/january_2013/file_list_rename_returns.py rename to erpnext/patches/january_2013/file_list_rename_returns.py diff --git a/patches/january_2013/give_report_permission_on_read.py b/erpnext/patches/january_2013/give_report_permission_on_read.py similarity index 100% rename from patches/january_2013/give_report_permission_on_read.py rename to erpnext/patches/january_2013/give_report_permission_on_read.py diff --git a/patches/january_2013/holiday_list_patch.py b/erpnext/patches/january_2013/holiday_list_patch.py similarity index 100% rename from patches/january_2013/holiday_list_patch.py rename to erpnext/patches/january_2013/holiday_list_patch.py diff --git a/patches/january_2013/rebuild_tree.py b/erpnext/patches/january_2013/rebuild_tree.py similarity index 100% rename from patches/january_2013/rebuild_tree.py rename to erpnext/patches/january_2013/rebuild_tree.py diff --git a/patches/january_2013/reload_print_format.py b/erpnext/patches/january_2013/reload_print_format.py similarity index 100% rename from patches/january_2013/reload_print_format.py rename to erpnext/patches/january_2013/reload_print_format.py diff --git a/patches/january_2013/remove_bad_permissions.py b/erpnext/patches/january_2013/remove_bad_permissions.py similarity index 100% rename from patches/january_2013/remove_bad_permissions.py rename to erpnext/patches/january_2013/remove_bad_permissions.py diff --git a/patches/january_2013/remove_landed_cost_master.py b/erpnext/patches/january_2013/remove_landed_cost_master.py similarity index 100% rename from patches/january_2013/remove_landed_cost_master.py rename to erpnext/patches/january_2013/remove_landed_cost_master.py diff --git a/patches/january_2013/remove_tds_entry_from_gl_mapper.py b/erpnext/patches/january_2013/remove_tds_entry_from_gl_mapper.py similarity index 100% rename from patches/january_2013/remove_tds_entry_from_gl_mapper.py rename to erpnext/patches/january_2013/remove_tds_entry_from_gl_mapper.py diff --git a/patches/january_2013/remove_unwanted_permission.py b/erpnext/patches/january_2013/remove_unwanted_permission.py similarity index 100% rename from patches/january_2013/remove_unwanted_permission.py rename to erpnext/patches/january_2013/remove_unwanted_permission.py diff --git a/patches/january_2013/report_permission.py b/erpnext/patches/january_2013/report_permission.py similarity index 100% rename from patches/january_2013/report_permission.py rename to erpnext/patches/january_2013/report_permission.py diff --git a/patches/january_2013/stock_reconciliation_patch.py b/erpnext/patches/january_2013/stock_reconciliation_patch.py similarity index 100% rename from patches/january_2013/stock_reconciliation_patch.py rename to erpnext/patches/january_2013/stock_reconciliation_patch.py diff --git a/patches/january_2013/tabsessions_to_myisam.py b/erpnext/patches/january_2013/tabsessions_to_myisam.py similarity index 100% rename from patches/january_2013/tabsessions_to_myisam.py rename to erpnext/patches/january_2013/tabsessions_to_myisam.py diff --git a/patches/january_2013/update_closed_on.py b/erpnext/patches/january_2013/update_closed_on.py similarity index 100% rename from patches/january_2013/update_closed_on.py rename to erpnext/patches/january_2013/update_closed_on.py diff --git a/patches/january_2013/update_country_info.py b/erpnext/patches/january_2013/update_country_info.py similarity index 100% rename from patches/january_2013/update_country_info.py rename to erpnext/patches/january_2013/update_country_info.py diff --git a/patches/january_2013/update_fraction_for_usd.py b/erpnext/patches/january_2013/update_fraction_for_usd.py similarity index 100% rename from patches/january_2013/update_fraction_for_usd.py rename to erpnext/patches/january_2013/update_fraction_for_usd.py diff --git a/patches/january_2013/update_number_format.py b/erpnext/patches/january_2013/update_number_format.py similarity index 100% rename from patches/january_2013/update_number_format.py rename to erpnext/patches/january_2013/update_number_format.py diff --git a/patches/january_2013/__init__.py b/erpnext/patches/july_2013/__init__.py similarity index 100% rename from patches/january_2013/__init__.py rename to erpnext/patches/july_2013/__init__.py diff --git a/patches/july_2013/p01_remove_doctype_mappers.py b/erpnext/patches/july_2013/p01_remove_doctype_mappers.py similarity index 100% rename from patches/july_2013/p01_remove_doctype_mappers.py rename to erpnext/patches/july_2013/p01_remove_doctype_mappers.py diff --git a/patches/july_2013/p01_same_sales_rate_patch.py b/erpnext/patches/july_2013/p01_same_sales_rate_patch.py similarity index 100% rename from patches/july_2013/p01_same_sales_rate_patch.py rename to erpnext/patches/july_2013/p01_same_sales_rate_patch.py diff --git a/patches/july_2013/p02_copy_shipping_address.py b/erpnext/patches/july_2013/p02_copy_shipping_address.py similarity index 100% rename from patches/july_2013/p02_copy_shipping_address.py rename to erpnext/patches/july_2013/p02_copy_shipping_address.py diff --git a/patches/july_2013/p03_cost_center_company.py b/erpnext/patches/july_2013/p03_cost_center_company.py similarity index 100% rename from patches/july_2013/p03_cost_center_company.py rename to erpnext/patches/july_2013/p03_cost_center_company.py diff --git a/patches/july_2013/p04_merge_duplicate_leads.py b/erpnext/patches/july_2013/p04_merge_duplicate_leads.py similarity index 100% rename from patches/july_2013/p04_merge_duplicate_leads.py rename to erpnext/patches/july_2013/p04_merge_duplicate_leads.py diff --git a/patches/july_2013/p05_custom_doctypes_in_list_view.py b/erpnext/patches/july_2013/p05_custom_doctypes_in_list_view.py similarity index 100% rename from patches/july_2013/p05_custom_doctypes_in_list_view.py rename to erpnext/patches/july_2013/p05_custom_doctypes_in_list_view.py diff --git a/patches/july_2013/p06_same_sales_rate.py b/erpnext/patches/july_2013/p06_same_sales_rate.py similarity index 100% rename from patches/july_2013/p06_same_sales_rate.py rename to erpnext/patches/july_2013/p06_same_sales_rate.py diff --git a/patches/july_2013/p07_repost_billed_amt_in_sales_cycle.py b/erpnext/patches/july_2013/p07_repost_billed_amt_in_sales_cycle.py similarity index 100% rename from patches/july_2013/p07_repost_billed_amt_in_sales_cycle.py rename to erpnext/patches/july_2013/p07_repost_billed_amt_in_sales_cycle.py diff --git a/patches/july_2013/p08_custom_print_format_net_total_export.py b/erpnext/patches/july_2013/p08_custom_print_format_net_total_export.py similarity index 100% rename from patches/july_2013/p08_custom_print_format_net_total_export.py rename to erpnext/patches/july_2013/p08_custom_print_format_net_total_export.py diff --git a/patches/july_2013/p09_remove_website_pyc.py b/erpnext/patches/july_2013/p09_remove_website_pyc.py similarity index 100% rename from patches/july_2013/p09_remove_website_pyc.py rename to erpnext/patches/july_2013/p09_remove_website_pyc.py diff --git a/patches/july_2013/p10_change_partner_user_to_website_user.py b/erpnext/patches/july_2013/p10_change_partner_user_to_website_user.py similarity index 100% rename from patches/july_2013/p10_change_partner_user_to_website_user.py rename to erpnext/patches/july_2013/p10_change_partner_user_to_website_user.py diff --git a/patches/july_2013/p11_update_price_list_currency.py b/erpnext/patches/july_2013/p11_update_price_list_currency.py similarity index 100% rename from patches/july_2013/p11_update_price_list_currency.py rename to erpnext/patches/july_2013/p11_update_price_list_currency.py diff --git a/patches/july_2013/restore_tree_roots.py b/erpnext/patches/july_2013/restore_tree_roots.py similarity index 75% rename from patches/july_2013/restore_tree_roots.py rename to erpnext/patches/july_2013/restore_tree_roots.py index b6a988fa3c9..91b328ce2e8 100644 --- a/patches/july_2013/restore_tree_roots.py +++ b/erpnext/patches/july_2013/restore_tree_roots.py @@ -2,5 +2,5 @@ # License: GNU General Public License v3. See license.txt def execute(): - from startup.install import import_defaults + from erpnext.startup.install import import_defaults import_defaults() \ No newline at end of file diff --git a/patches/july_2013/__init__.py b/erpnext/patches/june_2013/__init__.py similarity index 100% rename from patches/july_2013/__init__.py rename to erpnext/patches/june_2013/__init__.py diff --git a/patches/june_2013/p01_update_bom_exploded_items.py b/erpnext/patches/june_2013/p01_update_bom_exploded_items.py similarity index 100% rename from patches/june_2013/p01_update_bom_exploded_items.py rename to erpnext/patches/june_2013/p01_update_bom_exploded_items.py diff --git a/patches/june_2013/p02_update_project_completed.py b/erpnext/patches/june_2013/p02_update_project_completed.py similarity index 100% rename from patches/june_2013/p02_update_project_completed.py rename to erpnext/patches/june_2013/p02_update_project_completed.py diff --git a/patches/june_2013/p03_buying_selling_for_price_list.py b/erpnext/patches/june_2013/p03_buying_selling_for_price_list.py similarity index 100% rename from patches/june_2013/p03_buying_selling_for_price_list.py rename to erpnext/patches/june_2013/p03_buying_selling_for_price_list.py diff --git a/patches/june_2013/p04_fix_event_for_lead_oppty_project.py b/erpnext/patches/june_2013/p04_fix_event_for_lead_oppty_project.py similarity index 93% rename from patches/june_2013/p04_fix_event_for_lead_oppty_project.py rename to erpnext/patches/june_2013/p04_fix_event_for_lead_oppty_project.py index 735a28a7d57..f80209f5bdd 100644 --- a/patches/june_2013/p04_fix_event_for_lead_oppty_project.py +++ b/erpnext/patches/june_2013/p04_fix_event_for_lead_oppty_project.py @@ -4,7 +4,7 @@ import webnotes def execute(): - from utilities.transaction_base import delete_events + from erpnext.utilities.transaction_base import delete_events # delete orphaned Event User webnotes.conn.sql("""delete from `tabEvent User` diff --git a/patches/june_2013/p05_remove_search_criteria_reports.py b/erpnext/patches/june_2013/p05_remove_search_criteria_reports.py similarity index 100% rename from patches/june_2013/p05_remove_search_criteria_reports.py rename to erpnext/patches/june_2013/p05_remove_search_criteria_reports.py diff --git a/patches/june_2013/p05_remove_unused_doctypes.py b/erpnext/patches/june_2013/p05_remove_unused_doctypes.py similarity index 100% rename from patches/june_2013/p05_remove_unused_doctypes.py rename to erpnext/patches/june_2013/p05_remove_unused_doctypes.py diff --git a/patches/june_2013/p06_drop_unused_tables.py b/erpnext/patches/june_2013/p06_drop_unused_tables.py similarity index 100% rename from patches/june_2013/p06_drop_unused_tables.py rename to erpnext/patches/june_2013/p06_drop_unused_tables.py diff --git a/patches/june_2013/p07_taxes_price_list_for_territory.py b/erpnext/patches/june_2013/p07_taxes_price_list_for_territory.py similarity index 95% rename from patches/june_2013/p07_taxes_price_list_for_territory.py rename to erpnext/patches/june_2013/p07_taxes_price_list_for_territory.py index 1cdb78399cf..4a224e34f00 100644 --- a/patches/june_2013/p07_taxes_price_list_for_territory.py +++ b/erpnext/patches/june_2013/p07_taxes_price_list_for_territory.py @@ -9,7 +9,7 @@ def execute(): webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master") webnotes.reload_doc("accounts", "doctype", "shipping_rule") - from setup.utils import get_root_of + from erpnext.setup.utils import get_root_of root_territory = get_root_of("Territory") for parenttype in ["Sales Taxes and Charges Master", "Price List", "Shipping Rule"]: diff --git a/patches/june_2013/p08_shopping_cart_settings.py b/erpnext/patches/june_2013/p08_shopping_cart_settings.py similarity index 85% rename from patches/june_2013/p08_shopping_cart_settings.py rename to erpnext/patches/june_2013/p08_shopping_cart_settings.py index 6af7eb83fd4..45028c8731a 100644 --- a/patches/june_2013/p08_shopping_cart_settings.py +++ b/erpnext/patches/june_2013/p08_shopping_cart_settings.py @@ -7,7 +7,7 @@ def execute(): webnotes.reload_doc("selling", "doctype", "shopping_cart_settings") # create two default territories, one for home country and one named Rest of the World - from setup.page.setup_wizard.setup_wizard import create_territories + from erpnext.setup.page.setup_wizard.setup_wizard import create_territories create_territories() webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World") diff --git a/patches/june_2013/p09_update_global_defaults.py b/erpnext/patches/june_2013/p09_update_global_defaults.py similarity index 100% rename from patches/june_2013/p09_update_global_defaults.py rename to erpnext/patches/june_2013/p09_update_global_defaults.py diff --git a/patches/june_2013/p10_lead_address.py b/erpnext/patches/june_2013/p10_lead_address.py similarity index 100% rename from patches/june_2013/p10_lead_address.py rename to erpnext/patches/june_2013/p10_lead_address.py diff --git a/patches/june_2013/__init__.py b/erpnext/patches/march_2013/__init__.py similarity index 100% rename from patches/june_2013/__init__.py rename to erpnext/patches/march_2013/__init__.py diff --git a/patches/march_2013/p01_c_form.py b/erpnext/patches/march_2013/p01_c_form.py similarity index 100% rename from patches/march_2013/p01_c_form.py rename to erpnext/patches/march_2013/p01_c_form.py diff --git a/patches/march_2013/p02_get_global_default.py b/erpnext/patches/march_2013/p02_get_global_default.py similarity index 100% rename from patches/march_2013/p02_get_global_default.py rename to erpnext/patches/march_2013/p02_get_global_default.py diff --git a/patches/march_2013/p03_rename_blog_to_blog_post.py b/erpnext/patches/march_2013/p03_rename_blog_to_blog_post.py similarity index 100% rename from patches/march_2013/p03_rename_blog_to_blog_post.py rename to erpnext/patches/march_2013/p03_rename_blog_to_blog_post.py diff --git a/patches/march_2013/p04_pos_update_stock_check.py b/erpnext/patches/march_2013/p04_pos_update_stock_check.py similarity index 100% rename from patches/march_2013/p04_pos_update_stock_check.py rename to erpnext/patches/march_2013/p04_pos_update_stock_check.py diff --git a/patches/march_2013/p05_payment_reconciliation.py b/erpnext/patches/march_2013/p05_payment_reconciliation.py similarity index 100% rename from patches/march_2013/p05_payment_reconciliation.py rename to erpnext/patches/march_2013/p05_payment_reconciliation.py diff --git a/patches/march_2013/p06_remove_sales_purchase_return_tool.py b/erpnext/patches/march_2013/p06_remove_sales_purchase_return_tool.py similarity index 100% rename from patches/march_2013/p06_remove_sales_purchase_return_tool.py rename to erpnext/patches/march_2013/p06_remove_sales_purchase_return_tool.py diff --git a/patches/march_2013/p07_update_project_in_stock_ledger.py b/erpnext/patches/march_2013/p07_update_project_in_stock_ledger.py similarity index 100% rename from patches/march_2013/p07_update_project_in_stock_ledger.py rename to erpnext/patches/march_2013/p07_update_project_in_stock_ledger.py diff --git a/patches/march_2013/p07_update_valuation_rate.py b/erpnext/patches/march_2013/p07_update_valuation_rate.py similarity index 100% rename from patches/march_2013/p07_update_valuation_rate.py rename to erpnext/patches/march_2013/p07_update_valuation_rate.py diff --git a/patches/march_2013/p08_create_aii_accounts.py b/erpnext/patches/march_2013/p08_create_aii_accounts.py similarity index 100% rename from patches/march_2013/p08_create_aii_accounts.py rename to erpnext/patches/march_2013/p08_create_aii_accounts.py diff --git a/patches/march_2013/p10_set_fiscal_year_for_stock.py b/erpnext/patches/march_2013/p10_set_fiscal_year_for_stock.py similarity index 91% rename from patches/march_2013/p10_set_fiscal_year_for_stock.py rename to erpnext/patches/march_2013/p10_set_fiscal_year_for_stock.py index 1f5adf67abe..97510c713e0 100644 --- a/patches/march_2013/p10_set_fiscal_year_for_stock.py +++ b/erpnext/patches/march_2013/p10_set_fiscal_year_for_stock.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt import webnotes -from accounts.utils import get_fiscal_year, FiscalYearError +from erpnext.accounts.utils import get_fiscal_year, FiscalYearError def execute(): webnotes.reload_doc("stock", "doctype", "stock_entry") diff --git a/patches/march_2013/p10_update_against_expense_account.py b/erpnext/patches/march_2013/p10_update_against_expense_account.py similarity index 100% rename from patches/march_2013/p10_update_against_expense_account.py rename to erpnext/patches/march_2013/p10_update_against_expense_account.py diff --git a/patches/march_2013/p11_update_attach_files.py b/erpnext/patches/march_2013/p11_update_attach_files.py similarity index 100% rename from patches/march_2013/p11_update_attach_files.py rename to erpnext/patches/march_2013/p11_update_attach_files.py diff --git a/patches/march_2013/p12_set_item_tax_rate_in_json.py b/erpnext/patches/march_2013/p12_set_item_tax_rate_in_json.py similarity index 100% rename from patches/march_2013/p12_set_item_tax_rate_in_json.py rename to erpnext/patches/march_2013/p12_set_item_tax_rate_in_json.py diff --git a/patches/march_2013/update_po_prevdoc_doctype.py b/erpnext/patches/march_2013/update_po_prevdoc_doctype.py similarity index 100% rename from patches/march_2013/update_po_prevdoc_doctype.py rename to erpnext/patches/march_2013/update_po_prevdoc_doctype.py diff --git a/patches/march_2013/__init__.py b/erpnext/patches/may_2013/__init__.py similarity index 100% rename from patches/march_2013/__init__.py rename to erpnext/patches/may_2013/__init__.py diff --git a/patches/may_2013/p01_selling_net_total_export.py b/erpnext/patches/may_2013/p01_selling_net_total_export.py similarity index 100% rename from patches/may_2013/p01_selling_net_total_export.py rename to erpnext/patches/may_2013/p01_selling_net_total_export.py diff --git a/patches/may_2013/p02_update_valuation_rate.py b/erpnext/patches/may_2013/p02_update_valuation_rate.py similarity index 95% rename from patches/may_2013/p02_update_valuation_rate.py rename to erpnext/patches/may_2013/p02_update_valuation_rate.py index b521734a574..1419ebf5059 100644 --- a/patches/may_2013/p02_update_valuation_rate.py +++ b/erpnext/patches/may_2013/p02_update_valuation_rate.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import webnotes def execute(): - from stock.stock_ledger import update_entries_after + from erpnext.stock.stock_ledger import update_entries_after item_warehouse = [] # update valuation_rate in transaction doctypes = {"Purchase Receipt": "purchase_receipt_details", "Purchase Invoice": "entries"} diff --git a/patches/may_2013/p03_update_support_ticket.py b/erpnext/patches/may_2013/p03_update_support_ticket.py similarity index 100% rename from patches/may_2013/p03_update_support_ticket.py rename to erpnext/patches/may_2013/p03_update_support_ticket.py diff --git a/patches/may_2013/p04_reorder_level.py b/erpnext/patches/may_2013/p04_reorder_level.py similarity index 100% rename from patches/may_2013/p04_reorder_level.py rename to erpnext/patches/may_2013/p04_reorder_level.py diff --git a/patches/may_2013/p05_update_cancelled_gl_entries.py b/erpnext/patches/may_2013/p05_update_cancelled_gl_entries.py similarity index 100% rename from patches/may_2013/p05_update_cancelled_gl_entries.py rename to erpnext/patches/may_2013/p05_update_cancelled_gl_entries.py diff --git a/patches/may_2013/p06_make_notes.py b/erpnext/patches/may_2013/p06_make_notes.py similarity index 100% rename from patches/may_2013/p06_make_notes.py rename to erpnext/patches/may_2013/p06_make_notes.py diff --git a/patches/may_2013/p06_update_billed_amt_po_pr.py b/erpnext/patches/may_2013/p06_update_billed_amt_po_pr.py similarity index 100% rename from patches/may_2013/p06_update_billed_amt_po_pr.py rename to erpnext/patches/may_2013/p06_update_billed_amt_po_pr.py diff --git a/patches/may_2013/p07_move_update_stock_to_pos.py b/erpnext/patches/may_2013/p07_move_update_stock_to_pos.py similarity index 100% rename from patches/may_2013/p07_move_update_stock_to_pos.py rename to erpnext/patches/may_2013/p07_move_update_stock_to_pos.py diff --git a/patches/may_2013/p08_change_item_wise_tax.py b/erpnext/patches/may_2013/p08_change_item_wise_tax.py similarity index 100% rename from patches/may_2013/p08_change_item_wise_tax.py rename to erpnext/patches/may_2013/p08_change_item_wise_tax.py diff --git a/patches/may_2013/repost_stock_for_no_posting_time.py b/erpnext/patches/may_2013/repost_stock_for_no_posting_time.py similarity index 90% rename from patches/may_2013/repost_stock_for_no_posting_time.py rename to erpnext/patches/may_2013/repost_stock_for_no_posting_time.py index db03992e2ed..b36ccf3881a 100644 --- a/patches/may_2013/repost_stock_for_no_posting_time.py +++ b/erpnext/patches/may_2013/repost_stock_for_no_posting_time.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals def execute(): import webnotes - from stock.stock_ledger import update_entries_after + from erpnext.stock.stock_ledger import update_entries_after res = webnotes.conn.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry` where posting_time = '00:00'""") diff --git a/patches/may_2013/__init__.py b/erpnext/patches/november_2012/__init__.py similarity index 100% rename from patches/may_2013/__init__.py rename to erpnext/patches/november_2012/__init__.py diff --git a/patches/november_2012/add_employee_field_in_employee.py b/erpnext/patches/november_2012/add_employee_field_in_employee.py similarity index 100% rename from patches/november_2012/add_employee_field_in_employee.py rename to erpnext/patches/november_2012/add_employee_field_in_employee.py diff --git a/patches/november_2012/add_theme_to_profile.py b/erpnext/patches/november_2012/add_theme_to_profile.py similarity index 100% rename from patches/november_2012/add_theme_to_profile.py rename to erpnext/patches/november_2012/add_theme_to_profile.py diff --git a/patches/november_2012/cancelled_bom_patch.py b/erpnext/patches/november_2012/cancelled_bom_patch.py similarity index 100% rename from patches/november_2012/cancelled_bom_patch.py rename to erpnext/patches/november_2012/cancelled_bom_patch.py diff --git a/patches/november_2012/communication_sender_and_recipient.py b/erpnext/patches/november_2012/communication_sender_and_recipient.py similarity index 100% rename from patches/november_2012/communication_sender_and_recipient.py rename to erpnext/patches/november_2012/communication_sender_and_recipient.py diff --git a/patches/november_2012/custom_field_insert_after.py b/erpnext/patches/november_2012/custom_field_insert_after.py similarity index 100% rename from patches/november_2012/custom_field_insert_after.py rename to erpnext/patches/november_2012/custom_field_insert_after.py diff --git a/patches/november_2012/customer_issue_allocated_to_assigned.py b/erpnext/patches/november_2012/customer_issue_allocated_to_assigned.py similarity index 100% rename from patches/november_2012/customer_issue_allocated_to_assigned.py rename to erpnext/patches/november_2012/customer_issue_allocated_to_assigned.py diff --git a/patches/november_2012/disable_cancelled_profiles.py b/erpnext/patches/november_2012/disable_cancelled_profiles.py similarity index 100% rename from patches/november_2012/disable_cancelled_profiles.py rename to erpnext/patches/november_2012/disable_cancelled_profiles.py diff --git a/patches/november_2012/gle_floating_point_issue.py b/erpnext/patches/november_2012/gle_floating_point_issue.py similarity index 100% rename from patches/november_2012/gle_floating_point_issue.py rename to erpnext/patches/november_2012/gle_floating_point_issue.py diff --git a/patches/november_2012/leave_application_cleanup.py b/erpnext/patches/november_2012/leave_application_cleanup.py similarity index 100% rename from patches/november_2012/leave_application_cleanup.py rename to erpnext/patches/november_2012/leave_application_cleanup.py diff --git a/patches/november_2012/production_order_patch.py b/erpnext/patches/november_2012/production_order_patch.py similarity index 100% rename from patches/november_2012/production_order_patch.py rename to erpnext/patches/november_2012/production_order_patch.py diff --git a/patches/november_2012/report_permissions.py b/erpnext/patches/november_2012/report_permissions.py similarity index 100% rename from patches/november_2012/report_permissions.py rename to erpnext/patches/november_2012/report_permissions.py diff --git a/patches/november_2012/reset_appraisal_permissions.py b/erpnext/patches/november_2012/reset_appraisal_permissions.py similarity index 100% rename from patches/november_2012/reset_appraisal_permissions.py rename to erpnext/patches/november_2012/reset_appraisal_permissions.py diff --git a/patches/november_2012/support_ticket_response_to_communication.py b/erpnext/patches/november_2012/support_ticket_response_to_communication.py similarity index 100% rename from patches/november_2012/support_ticket_response_to_communication.py rename to erpnext/patches/november_2012/support_ticket_response_to_communication.py diff --git a/patches/november_2012/update_delivered_billed_percentage_for_pos.py b/erpnext/patches/november_2012/update_delivered_billed_percentage_for_pos.py similarity index 100% rename from patches/november_2012/update_delivered_billed_percentage_for_pos.py rename to erpnext/patches/november_2012/update_delivered_billed_percentage_for_pos.py diff --git a/patches/november_2012/__init__.py b/erpnext/patches/october_2012/__init__.py similarity index 100% rename from patches/november_2012/__init__.py rename to erpnext/patches/october_2012/__init__.py diff --git a/patches/october_2012/company_fiscal_year_docstatus_patch.py b/erpnext/patches/october_2012/company_fiscal_year_docstatus_patch.py similarity index 100% rename from patches/october_2012/company_fiscal_year_docstatus_patch.py rename to erpnext/patches/october_2012/company_fiscal_year_docstatus_patch.py diff --git a/patches/october_2012/custom_script_delete_permission.py b/erpnext/patches/october_2012/custom_script_delete_permission.py similarity index 100% rename from patches/october_2012/custom_script_delete_permission.py rename to erpnext/patches/october_2012/custom_script_delete_permission.py diff --git a/patches/october_2012/fix_cancelled_gl_entries.py b/erpnext/patches/october_2012/fix_cancelled_gl_entries.py similarity index 100% rename from patches/october_2012/fix_cancelled_gl_entries.py rename to erpnext/patches/october_2012/fix_cancelled_gl_entries.py diff --git a/patches/october_2012/fix_wrong_vouchers.py b/erpnext/patches/october_2012/fix_wrong_vouchers.py similarity index 100% rename from patches/october_2012/fix_wrong_vouchers.py rename to erpnext/patches/october_2012/fix_wrong_vouchers.py diff --git a/patches/october_2012/update_account_property.py b/erpnext/patches/october_2012/update_account_property.py similarity index 100% rename from patches/october_2012/update_account_property.py rename to erpnext/patches/october_2012/update_account_property.py diff --git a/patches/october_2012/update_permission.py b/erpnext/patches/october_2012/update_permission.py similarity index 100% rename from patches/october_2012/update_permission.py rename to erpnext/patches/october_2012/update_permission.py diff --git a/patches/october_2012/__init__.py b/erpnext/patches/october_2013/__init__.py similarity index 100% rename from patches/october_2012/__init__.py rename to erpnext/patches/october_2013/__init__.py diff --git a/patches/october_2013/fix_is_cancelled_in_sle.py b/erpnext/patches/october_2013/fix_is_cancelled_in_sle.py similarity index 100% rename from patches/october_2013/fix_is_cancelled_in_sle.py rename to erpnext/patches/october_2013/fix_is_cancelled_in_sle.py diff --git a/patches/october_2013/p01_fix_serial_no_status.py b/erpnext/patches/october_2013/p01_fix_serial_no_status.py similarity index 100% rename from patches/october_2013/p01_fix_serial_no_status.py rename to erpnext/patches/october_2013/p01_fix_serial_no_status.py diff --git a/patches/october_2013/p01_update_delivery_note_prevdocs.py b/erpnext/patches/october_2013/p01_update_delivery_note_prevdocs.py similarity index 100% rename from patches/october_2013/p01_update_delivery_note_prevdocs.py rename to erpnext/patches/october_2013/p01_update_delivery_note_prevdocs.py diff --git a/patches/october_2013/p02_set_communication_status.py b/erpnext/patches/october_2013/p02_set_communication_status.py similarity index 100% rename from patches/october_2013/p02_set_communication_status.py rename to erpnext/patches/october_2013/p02_set_communication_status.py diff --git a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py b/erpnext/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py similarity index 100% rename from patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py rename to erpnext/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py diff --git a/patches/october_2013/p03_crm_update_status.py b/erpnext/patches/october_2013/p03_crm_update_status.py similarity index 100% rename from patches/october_2013/p03_crm_update_status.py rename to erpnext/patches/october_2013/p03_crm_update_status.py diff --git a/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py b/erpnext/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py similarity index 100% rename from patches/october_2013/p03_remove_sales_and_purchase_return_tool.py rename to erpnext/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py diff --git a/patches/october_2013/p04_update_report_permission.py b/erpnext/patches/october_2013/p04_update_report_permission.py similarity index 100% rename from patches/october_2013/p04_update_report_permission.py rename to erpnext/patches/october_2013/p04_update_report_permission.py diff --git a/patches/october_2013/p04_wsgi_migration.py b/erpnext/patches/october_2013/p04_wsgi_migration.py similarity index 100% rename from patches/october_2013/p04_wsgi_migration.py rename to erpnext/patches/october_2013/p04_wsgi_migration.py diff --git a/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py b/erpnext/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py similarity index 100% rename from patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py rename to erpnext/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py diff --git a/patches/october_2013/p05_server_custom_script_to_file.py b/erpnext/patches/october_2013/p05_server_custom_script_to_file.py similarity index 92% rename from patches/october_2013/p05_server_custom_script_to_file.py rename to erpnext/patches/october_2013/p05_server_custom_script_to_file.py index 76ec56cbfd9..5cffed64fe6 100644 --- a/patches/october_2013/p05_server_custom_script_to_file.py +++ b/erpnext/patches/october_2013/p05_server_custom_script_to_file.py @@ -17,7 +17,7 @@ def execute(): """ import os from webnotes.utils import get_site_base_path - from core.doctype.custom_script.custom_script import make_custom_server_script_file + from webnotes.core.doctype.custom_script.custom_script import make_custom_server_script_file for name, dt, script in webnotes.conn.sql("""select name, dt, script from `tabCustom Script` where script_type='Server'"""): if script and script.strip(): diff --git a/patches/october_2013/p06_rename_packing_list_doctype.py b/erpnext/patches/october_2013/p06_rename_packing_list_doctype.py similarity index 100% rename from patches/october_2013/p06_rename_packing_list_doctype.py rename to erpnext/patches/october_2013/p06_rename_packing_list_doctype.py diff --git a/patches/october_2013/p06_update_control_panel_and_global_defaults.py b/erpnext/patches/october_2013/p06_update_control_panel_and_global_defaults.py similarity index 100% rename from patches/october_2013/p06_update_control_panel_and_global_defaults.py rename to erpnext/patches/october_2013/p06_update_control_panel_and_global_defaults.py diff --git a/patches/october_2013/p07_rename_for_territory.py b/erpnext/patches/october_2013/p07_rename_for_territory.py similarity index 100% rename from patches/october_2013/p07_rename_for_territory.py rename to erpnext/patches/october_2013/p07_rename_for_territory.py diff --git a/patches/october_2013/p08_cleanup_after_item_price_module_change.py b/erpnext/patches/october_2013/p08_cleanup_after_item_price_module_change.py similarity index 100% rename from patches/october_2013/p08_cleanup_after_item_price_module_change.py rename to erpnext/patches/october_2013/p08_cleanup_after_item_price_module_change.py diff --git a/patches/october_2013/p09_update_naming_series_settings.py b/erpnext/patches/october_2013/p09_update_naming_series_settings.py similarity index 100% rename from patches/october_2013/p09_update_naming_series_settings.py rename to erpnext/patches/october_2013/p09_update_naming_series_settings.py diff --git a/patches/october_2013/p10_plugins_refactor.py b/erpnext/patches/october_2013/p10_plugins_refactor.py similarity index 99% rename from patches/october_2013/p10_plugins_refactor.py rename to erpnext/patches/october_2013/p10_plugins_refactor.py index 47d9d09191f..851c8afccd0 100644 --- a/patches/october_2013/p10_plugins_refactor.py +++ b/erpnext/patches/october_2013/p10_plugins_refactor.py @@ -6,6 +6,8 @@ import webnotes, os, shutil def execute(): # changed cache key for plugin code files + return + for doctype in webnotes.conn.sql_list("""select name from `tabDocType`"""): webnotes.cache().delete_value("_server_script:"+doctype) diff --git a/patches/october_2013/perpetual_inventory_stock_transfer_utility.py b/erpnext/patches/october_2013/perpetual_inventory_stock_transfer_utility.py similarity index 98% rename from patches/october_2013/perpetual_inventory_stock_transfer_utility.py rename to erpnext/patches/october_2013/perpetual_inventory_stock_transfer_utility.py index 593742250b4..889f5e27f8b 100644 --- a/patches/october_2013/perpetual_inventory_stock_transfer_utility.py +++ b/erpnext/patches/october_2013/perpetual_inventory_stock_transfer_utility.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import nowdate, nowtime, cstr -from accounts.utils import get_fiscal_year +from erpnext.accounts.utils import get_fiscal_year def execute(): item_map = {} diff --git a/patches/october_2013/repost_ordered_qty.py b/erpnext/patches/october_2013/repost_ordered_qty.py similarity index 100% rename from patches/october_2013/repost_ordered_qty.py rename to erpnext/patches/october_2013/repost_ordered_qty.py diff --git a/patches/october_2013/repost_planned_qty.py b/erpnext/patches/october_2013/repost_planned_qty.py similarity index 81% rename from patches/october_2013/repost_planned_qty.py rename to erpnext/patches/october_2013/repost_planned_qty.py index 6a78d3382b4..1e9da30fe3e 100644 --- a/patches/october_2013/repost_planned_qty.py +++ b/erpnext/patches/october_2013/repost_planned_qty.py @@ -3,7 +3,7 @@ def execute(): import webnotes - from utilities.repost_stock import get_planned_qty, update_bin + from erpnext.utilities.repost_stock import get_planned_qty, update_bin for d in webnotes.conn.sql("select item_code, warehouse from tabBin"): update_bin(d[0], d[1], { diff --git a/patches/october_2013/set_stock_value_diff_in_sle.py b/erpnext/patches/october_2013/set_stock_value_diff_in_sle.py similarity index 100% rename from patches/october_2013/set_stock_value_diff_in_sle.py rename to erpnext/patches/october_2013/set_stock_value_diff_in_sle.py diff --git a/patches/patch_list.py b/erpnext/patches/patch_list.py similarity index 99% rename from patches/patch_list.py rename to erpnext/patches/patch_list.py index d5d50b6ed08..350ca37432a 100644 --- a/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -262,7 +262,5 @@ patch_list = [ "patches.1311.p08_email_digest_recipients", "execute:webnotes.delete_doc('DocType', 'Warehouse Type')", "patches.1312.p01_delete_old_stock_reports", - "patches.1312.p02_update_user_properties", - "patches.1312.p03_move_warehouse_user_to_restrictions", - "patches.1312.p04_new_permissions", + "patches.1312.p02_update_item_details_in_item_price", ] \ No newline at end of file diff --git a/patches/september_2012/__init__.py b/erpnext/patches/september_2012/__init__.py similarity index 100% rename from patches/september_2012/__init__.py rename to erpnext/patches/september_2012/__init__.py diff --git a/patches/september_2012/add_stock_ledger_entry_index.py b/erpnext/patches/september_2012/add_stock_ledger_entry_index.py similarity index 100% rename from patches/september_2012/add_stock_ledger_entry_index.py rename to erpnext/patches/september_2012/add_stock_ledger_entry_index.py diff --git a/patches/september_2012/all_permissions_patch.py b/erpnext/patches/september_2012/all_permissions_patch.py similarity index 100% rename from patches/september_2012/all_permissions_patch.py rename to erpnext/patches/september_2012/all_permissions_patch.py diff --git a/patches/september_2012/communication_delete_permission.py b/erpnext/patches/september_2012/communication_delete_permission.py similarity index 100% rename from patches/september_2012/communication_delete_permission.py rename to erpnext/patches/september_2012/communication_delete_permission.py diff --git a/patches/september_2012/customer_permission_patch.py b/erpnext/patches/september_2012/customer_permission_patch.py similarity index 100% rename from patches/september_2012/customer_permission_patch.py rename to erpnext/patches/september_2012/customer_permission_patch.py diff --git a/patches/september_2012/deprecate_account_balance.py b/erpnext/patches/september_2012/deprecate_account_balance.py similarity index 100% rename from patches/september_2012/deprecate_account_balance.py rename to erpnext/patches/september_2012/deprecate_account_balance.py diff --git a/patches/september_2012/event_permission.py b/erpnext/patches/september_2012/event_permission.py similarity index 100% rename from patches/september_2012/event_permission.py rename to erpnext/patches/september_2012/event_permission.py diff --git a/patches/september_2012/plot_patch.py b/erpnext/patches/september_2012/plot_patch.py similarity index 100% rename from patches/september_2012/plot_patch.py rename to erpnext/patches/september_2012/plot_patch.py diff --git a/patches/september_2012/profile_delete_permission.py b/erpnext/patches/september_2012/profile_delete_permission.py similarity index 100% rename from patches/september_2012/profile_delete_permission.py rename to erpnext/patches/september_2012/profile_delete_permission.py diff --git a/patches/september_2012/rebuild_trees.py b/erpnext/patches/september_2012/rebuild_trees.py similarity index 100% rename from patches/september_2012/rebuild_trees.py rename to erpnext/patches/september_2012/rebuild_trees.py diff --git a/patches/september_2012/repost_stock.py b/erpnext/patches/september_2012/repost_stock.py similarity index 89% rename from patches/september_2012/repost_stock.py rename to erpnext/patches/september_2012/repost_stock.py index 5df65a21c65..11c87475f13 100644 --- a/patches/september_2012/repost_stock.py +++ b/erpnext/patches/september_2012/repost_stock.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals def execute(): import webnotes - from stock.stock_ledger import update_entries_after + from erpnext.stock.stock_ledger import update_entries_after res = webnotes.conn.sql("select distinct item_code, warehouse from `tabStock Ledger Entry`") i=0 for d in res: diff --git a/patches/september_2012/stock_report_permissions_for_accounts.py b/erpnext/patches/september_2012/stock_report_permissions_for_accounts.py similarity index 100% rename from patches/september_2012/stock_report_permissions_for_accounts.py rename to erpnext/patches/september_2012/stock_report_permissions_for_accounts.py diff --git a/patches/september_2013/__init__.py b/erpnext/patches/september_2013/__init__.py similarity index 100% rename from patches/september_2013/__init__.py rename to erpnext/patches/september_2013/__init__.py diff --git a/patches/september_2013/p01_add_user_defaults_from_pos_setting.py b/erpnext/patches/september_2013/p01_add_user_defaults_from_pos_setting.py similarity index 100% rename from patches/september_2013/p01_add_user_defaults_from_pos_setting.py rename to erpnext/patches/september_2013/p01_add_user_defaults_from_pos_setting.py diff --git a/patches/september_2013/p01_fix_buying_amount_gl_entries.py b/erpnext/patches/september_2013/p01_fix_buying_amount_gl_entries.py similarity index 100% rename from patches/september_2013/p01_fix_buying_amount_gl_entries.py rename to erpnext/patches/september_2013/p01_fix_buying_amount_gl_entries.py diff --git a/patches/september_2013/p01_update_communication.py b/erpnext/patches/september_2013/p01_update_communication.py similarity index 100% rename from patches/september_2013/p01_update_communication.py rename to erpnext/patches/september_2013/p01_update_communication.py diff --git a/patches/september_2013/p02_fix_serial_no_status.py b/erpnext/patches/september_2013/p02_fix_serial_no_status.py similarity index 100% rename from patches/september_2013/p02_fix_serial_no_status.py rename to erpnext/patches/september_2013/p02_fix_serial_no_status.py diff --git a/patches/september_2013/p03_modify_item_price_include_in_price_list.py b/erpnext/patches/september_2013/p03_modify_item_price_include_in_price_list.py similarity index 100% rename from patches/september_2013/p03_modify_item_price_include_in_price_list.py rename to erpnext/patches/september_2013/p03_modify_item_price_include_in_price_list.py diff --git a/patches/september_2013/p03_move_website_to_framework.py b/erpnext/patches/september_2013/p03_move_website_to_framework.py similarity index 100% rename from patches/september_2013/p03_move_website_to_framework.py rename to erpnext/patches/september_2013/p03_move_website_to_framework.py diff --git a/patches/september_2013/p03_update_stock_uom_in_sle.py b/erpnext/patches/september_2013/p03_update_stock_uom_in_sle.py similarity index 100% rename from patches/september_2013/p03_update_stock_uom_in_sle.py rename to erpnext/patches/september_2013/p03_update_stock_uom_in_sle.py diff --git a/patches/september_2013/p04_unsubmit_serial_nos.py b/erpnext/patches/september_2013/p04_unsubmit_serial_nos.py similarity index 100% rename from patches/september_2013/p04_unsubmit_serial_nos.py rename to erpnext/patches/september_2013/p04_unsubmit_serial_nos.py diff --git a/patches/september_2013/p05_fix_customer_in_pos.py b/erpnext/patches/september_2013/p05_fix_customer_in_pos.py similarity index 100% rename from patches/september_2013/p05_fix_customer_in_pos.py rename to erpnext/patches/september_2013/p05_fix_customer_in_pos.py diff --git a/patches/october_2013/__init__.py b/erpnext/projects/__init__.py similarity index 100% rename from patches/october_2013/__init__.py rename to erpnext/projects/__init__.py diff --git a/projects/doctype/__init__.py b/erpnext/projects/doctype/__init__.py similarity index 100% rename from projects/doctype/__init__.py rename to erpnext/projects/doctype/__init__.py diff --git a/projects/doctype/activity_type/README.md b/erpnext/projects/doctype/activity_type/README.md similarity index 100% rename from projects/doctype/activity_type/README.md rename to erpnext/projects/doctype/activity_type/README.md diff --git a/portal/__init__.py b/erpnext/projects/doctype/activity_type/__init__.py similarity index 100% rename from portal/__init__.py rename to erpnext/projects/doctype/activity_type/__init__.py diff --git a/projects/doctype/activity_type/activity_type.py b/erpnext/projects/doctype/activity_type/activity_type.py similarity index 100% rename from projects/doctype/activity_type/activity_type.py rename to erpnext/projects/doctype/activity_type/activity_type.py diff --git a/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.txt similarity index 100% rename from projects/doctype/activity_type/activity_type.txt rename to erpnext/projects/doctype/activity_type/activity_type.txt diff --git a/projects/doctype/activity_type/test_activity_type.py b/erpnext/projects/doctype/activity_type/test_activity_type.py similarity index 100% rename from projects/doctype/activity_type/test_activity_type.py rename to erpnext/projects/doctype/activity_type/test_activity_type.py diff --git a/projects/doctype/project/README.md b/erpnext/projects/doctype/project/README.md similarity index 100% rename from projects/doctype/project/README.md rename to erpnext/projects/doctype/project/README.md diff --git a/projects/doctype/project/__init__.py b/erpnext/projects/doctype/project/__init__.py similarity index 100% rename from projects/doctype/project/__init__.py rename to erpnext/projects/doctype/project/__init__.py diff --git a/projects/doctype/project/help.md b/erpnext/projects/doctype/project/help.md similarity index 100% rename from projects/doctype/project/help.md rename to erpnext/projects/doctype/project/help.md diff --git a/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js similarity index 91% rename from projects/doctype/project/project.js rename to erpnext/projects/doctype/project/project.js index 30873b5abe0..a77866ea0e0 100644 --- a/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/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py similarity index 97% rename from projects/doctype/project/project.py rename to erpnext/projects/doctype/project/project.py index 5b20c5ba6a2..f1594523138 100644 --- a/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -6,7 +6,7 @@ import webnotes from webnotes.utils import flt, getdate from webnotes import msgprint -from utilities.transaction_base import delete_events +from erpnext.utilities.transaction_base import delete_events class DocType: def __init__(self, doc, doclist=None): diff --git a/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt similarity index 100% rename from projects/doctype/project/project.txt rename to erpnext/projects/doctype/project/project.txt diff --git a/projects/doctype/project/test_project.py b/erpnext/projects/doctype/project/test_project.py similarity index 100% rename from projects/doctype/project/test_project.py rename to erpnext/projects/doctype/project/test_project.py diff --git a/projects/doctype/project_milestone/README.md b/erpnext/projects/doctype/project_milestone/README.md similarity index 100% rename from projects/doctype/project_milestone/README.md rename to erpnext/projects/doctype/project_milestone/README.md diff --git a/projects/doctype/project_milestone/__init__.py b/erpnext/projects/doctype/project_milestone/__init__.py similarity index 100% rename from projects/doctype/project_milestone/__init__.py rename to erpnext/projects/doctype/project_milestone/__init__.py diff --git a/projects/doctype/project_milestone/project_milestone.py b/erpnext/projects/doctype/project_milestone/project_milestone.py similarity index 100% rename from projects/doctype/project_milestone/project_milestone.py rename to erpnext/projects/doctype/project_milestone/project_milestone.py diff --git a/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.txt similarity index 100% rename from projects/doctype/project_milestone/project_milestone.txt rename to erpnext/projects/doctype/project_milestone/project_milestone.txt diff --git a/projects/doctype/task/README.md b/erpnext/projects/doctype/task/README.md similarity index 100% rename from projects/doctype/task/README.md rename to erpnext/projects/doctype/task/README.md diff --git a/projects/doctype/task/__init__.py b/erpnext/projects/doctype/task/__init__.py similarity index 100% rename from projects/doctype/task/__init__.py rename to erpnext/projects/doctype/task/__init__.py diff --git a/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js similarity index 100% rename from projects/doctype/task/task.js rename to erpnext/projects/doctype/task/task.js diff --git a/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py similarity index 98% rename from projects/doctype/task/task.py rename to erpnext/projects/doctype/task/task.py index 227119e9015..85d8a4986e6 100644 --- a/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -80,7 +80,7 @@ def get_events(start, end, filters=None): return data def get_project(doctype, txt, searchfield, start, page_len, filters): - from controllers.queries import get_match_cond + from erpnext.controllers.queries import get_match_cond return webnotes.conn.sql(""" select name from `tabProject` where %(key)s like "%(txt)s" %(mcond)s diff --git a/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt similarity index 100% rename from projects/doctype/task/task.txt rename to erpnext/projects/doctype/task/task.txt diff --git a/projects/doctype/task/task_calendar.js b/erpnext/projects/doctype/task/task_calendar.js similarity index 86% rename from projects/doctype/task/task_calendar.js rename to erpnext/projects/doctype/task/task_calendar.js index 62d9757f486..f6adf58d9ed 100644 --- a/projects/doctype/task/task_calendar.js +++ b/erpnext/projects/doctype/task/task_calendar.js @@ -18,5 +18,5 @@ wn.views.calendar["Task"] = { "label": wn._("Project") } ], - get_events_method: "projects.doctype.task.task.get_events" + get_events_method: "erpnext.projects.doctype.task.task.get_events" } \ No newline at end of file diff --git a/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py similarity index 100% rename from projects/doctype/task/test_task.py rename to erpnext/projects/doctype/task/test_task.py diff --git a/projects/doctype/time_log/README.md b/erpnext/projects/doctype/time_log/README.md similarity index 100% rename from projects/doctype/time_log/README.md rename to erpnext/projects/doctype/time_log/README.md diff --git a/portal/templates/__init__.py b/erpnext/projects/doctype/time_log/__init__.py similarity index 100% rename from portal/templates/__init__.py rename to erpnext/projects/doctype/time_log/__init__.py diff --git a/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py similarity index 89% rename from projects/doctype/time_log/test_time_log.py rename to erpnext/projects/doctype/time_log/test_time_log.py index c62bee17c89..23206d69a14 100644 --- a/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -4,7 +4,7 @@ import webnotes import unittest -from projects.doctype.time_log.time_log import OverlapError +from erpnext.projects.doctype.time_log.time_log import OverlapError class TestTimeLog(unittest.TestCase): def test_duplication(self): diff --git a/projects/doctype/time_log/time_log.js b/erpnext/projects/doctype/time_log/time_log.js similarity index 100% rename from projects/doctype/time_log/time_log.js rename to erpnext/projects/doctype/time_log/time_log.js diff --git a/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py similarity index 100% rename from projects/doctype/time_log/time_log.py rename to erpnext/projects/doctype/time_log/time_log.py diff --git a/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.txt similarity index 100% rename from projects/doctype/time_log/time_log.txt rename to erpnext/projects/doctype/time_log/time_log.txt diff --git a/projects/doctype/time_log/time_log_calendar.js b/erpnext/projects/doctype/time_log/time_log_calendar.js similarity index 79% rename from projects/doctype/time_log/time_log_calendar.js rename to erpnext/projects/doctype/time_log/time_log_calendar.js index 2451de170da..ea14074cc72 100644 --- a/projects/doctype/time_log/time_log_calendar.js +++ b/erpnext/projects/doctype/time_log/time_log_calendar.js @@ -9,5 +9,5 @@ wn.views.calendar["Time Log"] = { "title": "title", "allDay": "allDay" }, - get_events_method: "projects.doctype.time_log.time_log.get_events" + get_events_method: "erpnext.projects.doctype.time_log.time_log.get_events" } \ No newline at end of file diff --git a/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js similarity index 100% rename from projects/doctype/time_log/time_log_list.js rename to erpnext/projects/doctype/time_log/time_log_list.js diff --git a/projects/doctype/time_log_batch/README.md b/erpnext/projects/doctype/time_log_batch/README.md similarity index 100% rename from projects/doctype/time_log_batch/README.md rename to erpnext/projects/doctype/time_log_batch/README.md diff --git a/portal/templates/pages/__init__.py b/erpnext/projects/doctype/time_log_batch/__init__.py similarity index 100% rename from portal/templates/pages/__init__.py rename to erpnext/projects/doctype/time_log_batch/__init__.py diff --git a/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py similarity index 92% rename from projects/doctype/time_log_batch/test_time_log_batch.py rename to erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index 8a7e6f528ff..9fbf709f078 100644 --- a/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -5,7 +5,7 @@ import webnotes, unittest class TimeLogBatchTest(unittest.TestCase): def test_time_log_status(self): - from projects.doctype.time_log.test_time_log import test_records as time_log_records + from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records time_log = webnotes.bean(copy=time_log_records[0]) time_log.doc.fields.update({ "from_time": "2013-01-02 10:00:00", diff --git a/projects/doctype/time_log_batch/time_log_batch.js b/erpnext/projects/doctype/time_log_batch/time_log_batch.js similarity index 100% rename from projects/doctype/time_log_batch/time_log_batch.js rename to erpnext/projects/doctype/time_log_batch/time_log_batch.js diff --git a/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py similarity index 100% rename from projects/doctype/time_log_batch/time_log_batch.py rename to erpnext/projects/doctype/time_log_batch/time_log_batch.py diff --git a/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt similarity index 100% rename from projects/doctype/time_log_batch/time_log_batch.txt rename to erpnext/projects/doctype/time_log_batch/time_log_batch.txt diff --git a/projects/doctype/time_log_batch_detail/README.md b/erpnext/projects/doctype/time_log_batch_detail/README.md similarity index 100% rename from projects/doctype/time_log_batch_detail/README.md rename to erpnext/projects/doctype/time_log_batch_detail/README.md diff --git a/projects/__init__.py b/erpnext/projects/doctype/time_log_batch_detail/__init__.py similarity index 100% rename from projects/__init__.py rename to erpnext/projects/doctype/time_log_batch_detail/__init__.py diff --git a/projects/doctype/time_log_batch_detail/time_log_batch_detail.py b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py similarity index 100% rename from projects/doctype/time_log_batch_detail/time_log_batch_detail.py rename to erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py diff --git a/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt similarity index 100% rename from projects/doctype/time_log_batch_detail/time_log_batch_detail.txt rename to erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt diff --git a/projects/page/__init__.py b/erpnext/projects/page/__init__.py similarity index 100% rename from projects/page/__init__.py rename to erpnext/projects/page/__init__.py diff --git a/projects/page/projects_home/__init__.py b/erpnext/projects/page/projects_home/__init__.py similarity index 100% rename from projects/page/projects_home/__init__.py rename to erpnext/projects/page/projects_home/__init__.py diff --git a/projects/page/projects_home/projects_home.js b/erpnext/projects/page/projects_home/projects_home.js similarity index 100% rename from projects/page/projects_home/projects_home.js rename to erpnext/projects/page/projects_home/projects_home.js diff --git a/projects/page/projects_home/projects_home.txt b/erpnext/projects/page/projects_home/projects_home.txt similarity index 100% rename from projects/page/projects_home/projects_home.txt rename to erpnext/projects/page/projects_home/projects_home.txt diff --git a/projects/doctype/activity_type/__init__.py b/erpnext/projects/report/__init__.py similarity index 100% rename from projects/doctype/activity_type/__init__.py rename to erpnext/projects/report/__init__.py diff --git a/projects/doctype/time_log/__init__.py b/erpnext/projects/report/daily_time_log_summary/__init__.py similarity index 100% rename from projects/doctype/time_log/__init__.py rename to erpnext/projects/report/daily_time_log_summary/__init__.py diff --git a/projects/report/daily_time_log_summary/daily_time_log_summary.js b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.js similarity index 100% rename from projects/report/daily_time_log_summary/daily_time_log_summary.js rename to erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.js diff --git a/projects/report/daily_time_log_summary/daily_time_log_summary.py b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py similarity index 100% rename from projects/report/daily_time_log_summary/daily_time_log_summary.py rename to erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py diff --git a/projects/report/daily_time_log_summary/daily_time_log_summary.txt b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt similarity index 100% rename from projects/report/daily_time_log_summary/daily_time_log_summary.txt rename to erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt diff --git a/projects/doctype/time_log_batch/__init__.py b/erpnext/projects/report/project_wise_stock_tracking/__init__.py similarity index 100% rename from projects/doctype/time_log_batch/__init__.py rename to erpnext/projects/report/project_wise_stock_tracking/__init__.py diff --git a/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py similarity index 100% rename from projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py rename to erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py diff --git a/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt similarity index 100% rename from projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt rename to erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt diff --git a/projects/utils.py b/erpnext/projects/utils.py similarity index 100% rename from projects/utils.py rename to erpnext/projects/utils.py diff --git a/erpnext/public/build.json b/erpnext/public/build.json new file mode 100644 index 00000000000..ea9808abcd0 --- /dev/null +++ b/erpnext/public/build.json @@ -0,0 +1,16 @@ +{ + "css/erpnext.css": [ + "public/js/startup.css" + ], + "js/erpnext-web.min.js": [ + "public/js/website_utils.js" + ], + "js/erpnext.min.js": [ + "public/js/startup.js", + "public/js/conf.js", + "public/js/toolbar.js", + "public/js/feature_setup.js", + "public/js/utils.js", + "public/js/queries.js" + ] +} \ No newline at end of file diff --git a/public/css/splash.css b/erpnext/public/css/splash.css similarity index 100% rename from public/css/splash.css rename to erpnext/public/css/splash.css diff --git a/public/images/erpnext-fade.png b/erpnext/public/images/erpnext-fade.png similarity index 100% rename from public/images/erpnext-fade.png rename to erpnext/public/images/erpnext-fade.png diff --git a/public/images/erpnext1.png b/erpnext/public/images/erpnext1.png similarity index 100% rename from public/images/erpnext1.png rename to erpnext/public/images/erpnext1.png diff --git a/public/images/favicon.ico b/erpnext/public/images/favicon.ico similarity index 100% rename from public/images/favicon.ico rename to erpnext/public/images/favicon.ico diff --git a/public/images/feed.png b/erpnext/public/images/feed.png similarity index 100% rename from public/images/feed.png rename to erpnext/public/images/feed.png diff --git a/public/images/splash.svg b/erpnext/public/images/splash.svg similarity index 100% rename from public/images/splash.svg rename to erpnext/public/images/splash.svg diff --git a/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js similarity index 100% rename from public/js/account_tree_grid.js rename to erpnext/public/js/account_tree_grid.js diff --git a/public/js/conf.js b/erpnext/public/js/conf.js similarity index 81% rename from public/js/conf.js rename to erpnext/public/js/conf.js index 929bfcaa593..d902fe1fdcf 100644 --- a/public/js/conf.js +++ b/erpnext/public/js/conf.js @@ -9,7 +9,7 @@ $(document).bind('toolbar_setup', function() { var brand = ($("
").append(wn.boot.website_settings.brand_html).text() || 'erpnext'); $('.navbar-brand').html('"+wn._("ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd.\ - to provide an integrated tool to manage most processes in a small organization.\ - For more information about Web Notes, or to buy hosting servies, go to ")+ +
"+wn._("ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd. to provide an integrated tool to manage most processes in a small organization. For more information about Web Notes, or to buy hosting servies, go to ")+ "https://erpnext.com.
\"+wn._("To report an issue, go to ")+"GitHub Issues
\Calendar Events
" def get_todo_list(self, user_id): - from core.page.todo.todo import get + from webnotes.core.page.todo.todo import get todo_list = get() html = "" @@ -483,4 +483,4 @@ def send(): where enabled=1 and docstatus<2""", as_list=1): ed_obj = get_obj('Email Digest', ed[0]) if (now_date == ed_obj.get_next_sending()): - ed_obj.send() \ No newline at end of file + ed_obj.send() diff --git a/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt similarity index 100% rename from setup/doctype/email_digest/email_digest.txt rename to erpnext/setup/doctype/email_digest/email_digest.txt diff --git a/setup/doctype/email_settings/README.md b/erpnext/setup/doctype/email_settings/README.md similarity index 100% rename from setup/doctype/email_settings/README.md rename to erpnext/setup/doctype/email_settings/README.md diff --git a/setup/doctype/email_settings/__init__.py b/erpnext/setup/doctype/email_settings/__init__.py similarity index 100% rename from setup/doctype/email_settings/__init__.py rename to erpnext/setup/doctype/email_settings/__init__.py diff --git a/setup/doctype/email_settings/email_settings.py b/erpnext/setup/doctype/email_settings/email_settings.py similarity index 100% rename from setup/doctype/email_settings/email_settings.py rename to erpnext/setup/doctype/email_settings/email_settings.py diff --git a/setup/doctype/email_settings/email_settings.txt b/erpnext/setup/doctype/email_settings/email_settings.txt similarity index 100% rename from setup/doctype/email_settings/email_settings.txt rename to erpnext/setup/doctype/email_settings/email_settings.txt diff --git a/setup/doctype/features_setup/README.md b/erpnext/setup/doctype/features_setup/README.md similarity index 100% rename from setup/doctype/features_setup/README.md rename to erpnext/setup/doctype/features_setup/README.md diff --git a/setup/doctype/features_setup/__init__.py b/erpnext/setup/doctype/features_setup/__init__.py similarity index 100% rename from setup/doctype/features_setup/__init__.py rename to erpnext/setup/doctype/features_setup/__init__.py diff --git a/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py similarity index 100% rename from setup/doctype/features_setup/features_setup.py rename to erpnext/setup/doctype/features_setup/features_setup.py diff --git a/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt similarity index 99% rename from setup/doctype/features_setup/features_setup.txt rename to erpnext/setup/doctype/features_setup/features_setup.txt index 2f7b67773fa..dd2df028def 100644 --- a/setup/doctype/features_setup/features_setup.txt +++ b/erpnext/setup/doctype/features_setup/features_setup.txt @@ -2,7 +2,7 @@ { "creation": "2012-12-20 12:50:49", "docstatus": 0, - "modified": "2013-12-20 19:23:13", + "modified": "2013-12-24 11:40:19", "modified_by": "Administrator", "owner": "Administrator" }, @@ -92,7 +92,7 @@ "doctype": "DocField", "fieldname": "fs_packing_details", "fieldtype": "Check", - "label": "Packing Detials" + "label": "Packing Details" }, { "description": "To get Item Group in details table", diff --git a/setup/doctype/global_defaults/README.md b/erpnext/setup/doctype/global_defaults/README.md similarity index 100% rename from setup/doctype/global_defaults/README.md rename to erpnext/setup/doctype/global_defaults/README.md diff --git a/setup/doctype/global_defaults/__init__.py b/erpnext/setup/doctype/global_defaults/__init__.py similarity index 100% rename from setup/doctype/global_defaults/__init__.py rename to erpnext/setup/doctype/global_defaults/__init__.py diff --git a/setup/doctype/global_defaults/global_defaults.js b/erpnext/setup/doctype/global_defaults/global_defaults.js similarity index 95% rename from setup/doctype/global_defaults/global_defaults.js rename to erpnext/setup/doctype/global_defaults/global_defaults.js index ba31f3c85e6..6a2f84a659e 100644 --- a/setup/doctype/global_defaults/global_defaults.js +++ b/erpnext/setup/doctype/global_defaults/global_defaults.js @@ -7,7 +7,7 @@ $.extend(cur_frm.cscript, { this.timezone = doc.time_zone; wn.call({ - method:"webnotes.country_info.get_country_timezone_info", + method: "webnotes.country_info.get_country_timezone_info", callback: function(data) { erpnext.country_info = data.message.country_info; erpnext.all_timezones = data.message.all_timezones; diff --git a/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py similarity index 100% rename from setup/doctype/global_defaults/global_defaults.py rename to erpnext/setup/doctype/global_defaults/global_defaults.py diff --git a/setup/doctype/global_defaults/global_defaults.txt b/erpnext/setup/doctype/global_defaults/global_defaults.txt similarity index 100% rename from setup/doctype/global_defaults/global_defaults.txt rename to erpnext/setup/doctype/global_defaults/global_defaults.txt diff --git a/setup/doctype/item_group/README.md b/erpnext/setup/doctype/item_group/README.md similarity index 100% rename from setup/doctype/item_group/README.md rename to erpnext/setup/doctype/item_group/README.md diff --git a/setup/doctype/item_group/__init__.py b/erpnext/setup/doctype/item_group/__init__.py similarity index 100% rename from setup/doctype/item_group/__init__.py rename to erpnext/setup/doctype/item_group/__init__.py diff --git a/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js similarity index 100% rename from setup/doctype/item_group/item_group.js rename to erpnext/setup/doctype/item_group/item_group.js diff --git a/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py similarity index 86% rename from setup/doctype/item_group/item_group.py rename to erpnext/setup/doctype/item_group/item_group.py index e2fc7abe11e..6b989d5af61 100644 --- a/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -19,7 +19,7 @@ class DocType(DocTypeNestedSet, WebsiteGenerator): self.validate_name_with_item() - from selling.utils.product import invalidate_cache_for + from erpnext.selling.utils.product import invalidate_cache_for invalidate_cache_for(self.doc.name) self.validate_one_root() @@ -30,7 +30,7 @@ class DocType(DocTypeNestedSet, WebsiteGenerator): item group name or rename the item" % self.doc.name, raise_exception=1) def get_context(self): - from selling.utils.product import get_product_list_for_group, \ + from erpnext.selling.utils.product import get_product_list_for_group, \ get_parent_item_groups, get_group_item_count self.doc.sub_groups = webnotes.conn.sql("""select name, page_name @@ -45,6 +45,6 @@ class DocType(DocTypeNestedSet, WebsiteGenerator): self.doc.title = self.doc.name if self.doc.slideshow: - from website.doctype.website_slideshow.website_slideshow import get_slideshow + from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow get_slideshow(self) \ No newline at end of file diff --git a/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt similarity index 100% rename from setup/doctype/item_group/item_group.txt rename to erpnext/setup/doctype/item_group/item_group.txt diff --git a/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py similarity index 100% rename from setup/doctype/item_group/test_item_group.py rename to erpnext/setup/doctype/item_group/test_item_group.py diff --git a/setup/doctype/jobs_email_settings/README.md b/erpnext/setup/doctype/jobs_email_settings/README.md similarity index 100% rename from setup/doctype/jobs_email_settings/README.md rename to erpnext/setup/doctype/jobs_email_settings/README.md diff --git a/setup/doctype/applicable_territory/__init__.py b/erpnext/setup/doctype/jobs_email_settings/__init__.py similarity index 100% rename from setup/doctype/applicable_territory/__init__.py rename to erpnext/setup/doctype/jobs_email_settings/__init__.py diff --git a/setup/doctype/jobs_email_settings/jobs_email_settings.js b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.js similarity index 100% rename from setup/doctype/jobs_email_settings/jobs_email_settings.js rename to erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.js diff --git a/setup/doctype/jobs_email_settings/jobs_email_settings.py b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py similarity index 100% rename from setup/doctype/jobs_email_settings/jobs_email_settings.py rename to erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py diff --git a/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt similarity index 100% rename from setup/doctype/jobs_email_settings/jobs_email_settings.txt rename to erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt diff --git a/setup/doctype/naming_series/README.md b/erpnext/setup/doctype/naming_series/README.md similarity index 100% rename from setup/doctype/naming_series/README.md rename to erpnext/setup/doctype/naming_series/README.md diff --git a/setup/doctype/naming_series/__init__.py b/erpnext/setup/doctype/naming_series/__init__.py similarity index 100% rename from setup/doctype/naming_series/__init__.py rename to erpnext/setup/doctype/naming_series/__init__.py diff --git a/setup/doctype/naming_series/naming_series.js b/erpnext/setup/doctype/naming_series/naming_series.js similarity index 100% rename from setup/doctype/naming_series/naming_series.js rename to erpnext/setup/doctype/naming_series/naming_series.js diff --git a/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py similarity index 97% rename from setup/doctype/naming_series/naming_series.py rename to erpnext/setup/doctype/naming_series/naming_series.py index 3a14d4182d3..092de20a893 100644 --- a/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -83,7 +83,7 @@ class DocType: webnotes.clear_cache(doctype=doctype) def check_duplicate(self): - from core.doctype.doctype.doctype import DocType + from webnotes.core.doctype.doctype.doctype import DocType dt = DocType() parent = list(set( @@ -141,7 +141,7 @@ class DocType: msgprint("Please select prefix first") def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True): - from core.doctype.property_setter.property_setter import make_property_setter + from webnotes.core.doctype.property_setter.property_setter import make_property_setter if naming_series: make_property_setter(doctype, "naming_series", "hidden", 0, "Check") make_property_setter(doctype, "naming_series", "reqd", 1, "Check") diff --git a/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.txt similarity index 100% rename from setup/doctype/naming_series/naming_series.txt rename to erpnext/setup/doctype/naming_series/naming_series.txt diff --git a/setup/doctype/notification_control/README.md b/erpnext/setup/doctype/notification_control/README.md similarity index 100% rename from setup/doctype/notification_control/README.md rename to erpnext/setup/doctype/notification_control/README.md diff --git a/setup/doctype/notification_control/__init__.py b/erpnext/setup/doctype/notification_control/__init__.py similarity index 100% rename from setup/doctype/notification_control/__init__.py rename to erpnext/setup/doctype/notification_control/__init__.py diff --git a/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js similarity index 100% rename from setup/doctype/notification_control/notification_control.js rename to erpnext/setup/doctype/notification_control/notification_control.js diff --git a/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py similarity index 100% rename from setup/doctype/notification_control/notification_control.py rename to erpnext/setup/doctype/notification_control/notification_control.py diff --git a/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.txt similarity index 100% rename from setup/doctype/notification_control/notification_control.txt rename to erpnext/setup/doctype/notification_control/notification_control.txt diff --git a/setup/doctype/print_heading/README.md b/erpnext/setup/doctype/print_heading/README.md similarity index 100% rename from setup/doctype/print_heading/README.md rename to erpnext/setup/doctype/print_heading/README.md diff --git a/setup/doctype/print_heading/__init__.py b/erpnext/setup/doctype/print_heading/__init__.py similarity index 100% rename from setup/doctype/print_heading/__init__.py rename to erpnext/setup/doctype/print_heading/__init__.py diff --git a/setup/doctype/print_heading/print_heading.js b/erpnext/setup/doctype/print_heading/print_heading.js similarity index 100% rename from setup/doctype/print_heading/print_heading.js rename to erpnext/setup/doctype/print_heading/print_heading.js diff --git a/setup/doctype/print_heading/print_heading.py b/erpnext/setup/doctype/print_heading/print_heading.py similarity index 100% rename from setup/doctype/print_heading/print_heading.py rename to erpnext/setup/doctype/print_heading/print_heading.py diff --git a/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.txt similarity index 100% rename from setup/doctype/print_heading/print_heading.txt rename to erpnext/setup/doctype/print_heading/print_heading.txt diff --git a/setup/doctype/print_heading/test_print_heading.py b/erpnext/setup/doctype/print_heading/test_print_heading.py similarity index 100% rename from setup/doctype/print_heading/test_print_heading.py rename to erpnext/setup/doctype/print_heading/test_print_heading.py diff --git a/setup/doctype/quotation_lost_reason/README.md b/erpnext/setup/doctype/quotation_lost_reason/README.md similarity index 100% rename from setup/doctype/quotation_lost_reason/README.md rename to erpnext/setup/doctype/quotation_lost_reason/README.md diff --git a/setup/doctype/quotation_lost_reason/__init__.py b/erpnext/setup/doctype/quotation_lost_reason/__init__.py similarity index 100% rename from setup/doctype/quotation_lost_reason/__init__.py rename to erpnext/setup/doctype/quotation_lost_reason/__init__.py diff --git a/setup/doctype/quotation_lost_reason/quotation_lost_reason.js b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js similarity index 100% rename from setup/doctype/quotation_lost_reason/quotation_lost_reason.js rename to erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js diff --git a/setup/doctype/quotation_lost_reason/quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py similarity index 100% rename from setup/doctype/quotation_lost_reason/quotation_lost_reason.py rename to erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py diff --git a/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt similarity index 100% rename from setup/doctype/quotation_lost_reason/quotation_lost_reason.txt rename to erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt diff --git a/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py similarity index 100% rename from setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py rename to erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py diff --git a/setup/doctype/sales_email_settings/README.md b/erpnext/setup/doctype/sales_email_settings/README.md similarity index 100% rename from setup/doctype/sales_email_settings/README.md rename to erpnext/setup/doctype/sales_email_settings/README.md diff --git a/setup/doctype/backup_manager/__init__.py b/erpnext/setup/doctype/sales_email_settings/__init__.py similarity index 100% rename from setup/doctype/backup_manager/__init__.py rename to erpnext/setup/doctype/sales_email_settings/__init__.py diff --git a/setup/doctype/sales_email_settings/sales_email_settings.js b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.js similarity index 100% rename from setup/doctype/sales_email_settings/sales_email_settings.js rename to erpnext/setup/doctype/sales_email_settings/sales_email_settings.js diff --git a/setup/doctype/sales_email_settings/sales_email_settings.py b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py similarity index 100% rename from setup/doctype/sales_email_settings/sales_email_settings.py rename to erpnext/setup/doctype/sales_email_settings/sales_email_settings.py diff --git a/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt similarity index 100% rename from setup/doctype/sales_email_settings/sales_email_settings.txt rename to erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt diff --git a/setup/doctype/sales_partner/README.md b/erpnext/setup/doctype/sales_partner/README.md similarity index 100% rename from setup/doctype/sales_partner/README.md rename to erpnext/setup/doctype/sales_partner/README.md diff --git a/setup/doctype/sales_partner/__init__.py b/erpnext/setup/doctype/sales_partner/__init__.py similarity index 100% rename from setup/doctype/sales_partner/__init__.py rename to erpnext/setup/doctype/sales_partner/__init__.py diff --git a/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js similarity index 98% rename from setup/doctype/sales_partner/sales_partner.js rename to erpnext/setup/doctype/sales_partner/sales_partner.js index 05768575bc9..57eca345a11 100644 --- a/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/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py similarity index 100% rename from setup/doctype/sales_partner/sales_partner.py rename to erpnext/setup/doctype/sales_partner/sales_partner.py diff --git a/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.txt similarity index 100% rename from setup/doctype/sales_partner/sales_partner.txt rename to erpnext/setup/doctype/sales_partner/sales_partner.txt diff --git a/setup/doctype/company/charts/__init__.py b/erpnext/setup/doctype/sales_partner/templates/__init__.py similarity index 100% rename from setup/doctype/company/charts/__init__.py rename to erpnext/setup/doctype/sales_partner/templates/__init__.py diff --git a/setup/doctype/currency_exchange/__init__.py b/erpnext/setup/doctype/sales_partner/templates/generators/__init__.py similarity index 100% rename from setup/doctype/currency_exchange/__init__.py rename to erpnext/setup/doctype/sales_partner/templates/generators/__init__.py diff --git a/setup/doctype/sales_partner/templates/generators/partner.html b/erpnext/setup/doctype/sales_partner/templates/generators/partner.html similarity index 100% rename from setup/doctype/sales_partner/templates/generators/partner.html rename to erpnext/setup/doctype/sales_partner/templates/generators/partner.html diff --git a/setup/doctype/sales_partner/templates/generators/partner.py b/erpnext/setup/doctype/sales_partner/templates/generators/partner.py similarity index 100% rename from setup/doctype/sales_partner/templates/generators/partner.py rename to erpnext/setup/doctype/sales_partner/templates/generators/partner.py diff --git a/setup/doctype/item_group/templates/__init__.py b/erpnext/setup/doctype/sales_partner/templates/pages/__init__.py similarity index 100% rename from setup/doctype/item_group/templates/__init__.py rename to erpnext/setup/doctype/sales_partner/templates/pages/__init__.py diff --git a/setup/doctype/sales_partner/templates/pages/partners.html b/erpnext/setup/doctype/sales_partner/templates/pages/partners.html similarity index 100% rename from setup/doctype/sales_partner/templates/pages/partners.html rename to erpnext/setup/doctype/sales_partner/templates/pages/partners.html diff --git a/setup/doctype/sales_partner/templates/pages/partners.py b/erpnext/setup/doctype/sales_partner/templates/pages/partners.py similarity index 100% rename from setup/doctype/sales_partner/templates/pages/partners.py rename to erpnext/setup/doctype/sales_partner/templates/pages/partners.py diff --git a/setup/doctype/sales_partner/test_sales_partner.py b/erpnext/setup/doctype/sales_partner/test_sales_partner.py similarity index 100% rename from setup/doctype/sales_partner/test_sales_partner.py rename to erpnext/setup/doctype/sales_partner/test_sales_partner.py diff --git a/setup/doctype/sales_person/README.md b/erpnext/setup/doctype/sales_person/README.md similarity index 100% rename from setup/doctype/sales_person/README.md rename to erpnext/setup/doctype/sales_person/README.md diff --git a/setup/doctype/sales_person/__init__.py b/erpnext/setup/doctype/sales_person/__init__.py similarity index 100% rename from setup/doctype/sales_person/__init__.py rename to erpnext/setup/doctype/sales_person/__init__.py diff --git a/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js similarity index 93% rename from setup/doctype/sales_person/sales_person.js rename to erpnext/setup/doctype/sales_person/sales_person.js index a2db2715745..19c13b18a4f 100644 --- a/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" } } diff --git a/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py similarity index 100% rename from setup/doctype/sales_person/sales_person.py rename to erpnext/setup/doctype/sales_person/sales_person.py diff --git a/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt similarity index 100% rename from setup/doctype/sales_person/sales_person.txt rename to erpnext/setup/doctype/sales_person/sales_person.txt diff --git a/setup/doctype/sales_person/test_sales_person.py b/erpnext/setup/doctype/sales_person/test_sales_person.py similarity index 100% rename from setup/doctype/sales_person/test_sales_person.py rename to erpnext/setup/doctype/sales_person/test_sales_person.py diff --git a/setup/doctype/sms_parameter/README.md b/erpnext/setup/doctype/sms_parameter/README.md similarity index 100% rename from setup/doctype/sms_parameter/README.md rename to erpnext/setup/doctype/sms_parameter/README.md diff --git a/setup/doctype/sms_parameter/__init__.py b/erpnext/setup/doctype/sms_parameter/__init__.py similarity index 100% rename from setup/doctype/sms_parameter/__init__.py rename to erpnext/setup/doctype/sms_parameter/__init__.py diff --git a/setup/doctype/sms_parameter/sms_parameter.py b/erpnext/setup/doctype/sms_parameter/sms_parameter.py similarity index 100% rename from setup/doctype/sms_parameter/sms_parameter.py rename to erpnext/setup/doctype/sms_parameter/sms_parameter.py diff --git a/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt similarity index 100% rename from setup/doctype/sms_parameter/sms_parameter.txt rename to erpnext/setup/doctype/sms_parameter/sms_parameter.txt diff --git a/setup/doctype/sms_settings/README.md b/erpnext/setup/doctype/sms_settings/README.md similarity index 100% rename from setup/doctype/sms_settings/README.md rename to erpnext/setup/doctype/sms_settings/README.md diff --git a/setup/doctype/sms_settings/__init__.py b/erpnext/setup/doctype/sms_settings/__init__.py similarity index 100% rename from setup/doctype/sms_settings/__init__.py rename to erpnext/setup/doctype/sms_settings/__init__.py diff --git a/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py similarity index 100% rename from setup/doctype/sms_settings/sms_settings.py rename to erpnext/setup/doctype/sms_settings/sms_settings.py diff --git a/setup/doctype/sms_settings/sms_settings.txt b/erpnext/setup/doctype/sms_settings/sms_settings.txt similarity index 100% rename from setup/doctype/sms_settings/sms_settings.txt rename to erpnext/setup/doctype/sms_settings/sms_settings.txt diff --git a/setup/doctype/supplier_type/README.md b/erpnext/setup/doctype/supplier_type/README.md similarity index 100% rename from setup/doctype/supplier_type/README.md rename to erpnext/setup/doctype/supplier_type/README.md diff --git a/setup/doctype/supplier_type/__init__.py b/erpnext/setup/doctype/supplier_type/__init__.py similarity index 100% rename from setup/doctype/supplier_type/__init__.py rename to erpnext/setup/doctype/supplier_type/__init__.py diff --git a/setup/doctype/supplier_type/supplier_type.js b/erpnext/setup/doctype/supplier_type/supplier_type.js similarity index 100% rename from setup/doctype/supplier_type/supplier_type.js rename to erpnext/setup/doctype/supplier_type/supplier_type.js diff --git a/setup/doctype/supplier_type/supplier_type.py b/erpnext/setup/doctype/supplier_type/supplier_type.py similarity index 100% rename from setup/doctype/supplier_type/supplier_type.py rename to erpnext/setup/doctype/supplier_type/supplier_type.py diff --git a/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.txt similarity index 100% rename from setup/doctype/supplier_type/supplier_type.txt rename to erpnext/setup/doctype/supplier_type/supplier_type.txt diff --git a/setup/doctype/supplier_type/test_supplier_type.py b/erpnext/setup/doctype/supplier_type/test_supplier_type.py similarity index 100% rename from setup/doctype/supplier_type/test_supplier_type.py rename to erpnext/setup/doctype/supplier_type/test_supplier_type.py diff --git a/setup/doctype/target_detail/README.md b/erpnext/setup/doctype/target_detail/README.md similarity index 100% rename from setup/doctype/target_detail/README.md rename to erpnext/setup/doctype/target_detail/README.md diff --git a/setup/doctype/target_detail/__init__.py b/erpnext/setup/doctype/target_detail/__init__.py similarity index 100% rename from setup/doctype/target_detail/__init__.py rename to erpnext/setup/doctype/target_detail/__init__.py diff --git a/setup/doctype/target_detail/target_detail.py b/erpnext/setup/doctype/target_detail/target_detail.py similarity index 100% rename from setup/doctype/target_detail/target_detail.py rename to erpnext/setup/doctype/target_detail/target_detail.py diff --git a/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.txt similarity index 100% rename from setup/doctype/target_detail/target_detail.txt rename to erpnext/setup/doctype/target_detail/target_detail.txt diff --git a/setup/doctype/terms_and_conditions/README.md b/erpnext/setup/doctype/terms_and_conditions/README.md similarity index 100% rename from setup/doctype/terms_and_conditions/README.md rename to erpnext/setup/doctype/terms_and_conditions/README.md diff --git a/setup/doctype/terms_and_conditions/__init__.py b/erpnext/setup/doctype/terms_and_conditions/__init__.py similarity index 100% rename from setup/doctype/terms_and_conditions/__init__.py rename to erpnext/setup/doctype/terms_and_conditions/__init__.py diff --git a/setup/doctype/terms_and_conditions/terms_and_conditions.js b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.js similarity index 100% rename from setup/doctype/terms_and_conditions/terms_and_conditions.js rename to erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.js diff --git a/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py similarity index 100% rename from setup/doctype/terms_and_conditions/terms_and_conditions.py rename to erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py diff --git a/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt similarity index 100% rename from setup/doctype/terms_and_conditions/terms_and_conditions.txt rename to erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt diff --git a/setup/doctype/terms_and_conditions/test_terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py similarity index 100% rename from setup/doctype/terms_and_conditions/test_terms_and_conditions.py rename to erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py diff --git a/setup/doctype/territory/README.md b/erpnext/setup/doctype/territory/README.md similarity index 100% rename from setup/doctype/territory/README.md rename to erpnext/setup/doctype/territory/README.md diff --git a/setup/doctype/territory/__init__.py b/erpnext/setup/doctype/territory/__init__.py similarity index 100% rename from setup/doctype/territory/__init__.py rename to erpnext/setup/doctype/territory/__init__.py diff --git a/setup/doctype/territory/territory.js b/erpnext/setup/doctype/territory/territory.js similarity index 100% rename from setup/doctype/territory/territory.js rename to erpnext/setup/doctype/territory/territory.js diff --git a/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py similarity index 100% rename from setup/doctype/territory/territory.py rename to erpnext/setup/doctype/territory/territory.py diff --git a/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt similarity index 100% rename from setup/doctype/territory/territory.txt rename to erpnext/setup/doctype/territory/territory.txt diff --git a/setup/doctype/territory/test_territory.py b/erpnext/setup/doctype/territory/test_territory.py similarity index 100% rename from setup/doctype/territory/test_territory.py rename to erpnext/setup/doctype/territory/test_territory.py diff --git a/setup/doctype/uom/README.md b/erpnext/setup/doctype/uom/README.md similarity index 100% rename from setup/doctype/uom/README.md rename to erpnext/setup/doctype/uom/README.md diff --git a/setup/doctype/uom/__init__.py b/erpnext/setup/doctype/uom/__init__.py similarity index 100% rename from setup/doctype/uom/__init__.py rename to erpnext/setup/doctype/uom/__init__.py diff --git a/setup/doctype/uom/test_uom.py b/erpnext/setup/doctype/uom/test_uom.py similarity index 100% rename from setup/doctype/uom/test_uom.py rename to erpnext/setup/doctype/uom/test_uom.py diff --git a/setup/doctype/uom/uom.js b/erpnext/setup/doctype/uom/uom.js similarity index 100% rename from setup/doctype/uom/uom.js rename to erpnext/setup/doctype/uom/uom.js diff --git a/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py similarity index 100% rename from setup/doctype/uom/uom.py rename to erpnext/setup/doctype/uom/uom.py diff --git a/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.txt similarity index 100% rename from setup/doctype/uom/uom.txt rename to erpnext/setup/doctype/uom/uom.txt diff --git a/setup/doctype/website_item_group/README.md b/erpnext/setup/doctype/website_item_group/README.md similarity index 100% rename from setup/doctype/website_item_group/README.md rename to erpnext/setup/doctype/website_item_group/README.md diff --git a/setup/doctype/item_group/templates/generators/__init__.py b/erpnext/setup/doctype/website_item_group/__init__.py similarity index 100% rename from setup/doctype/item_group/templates/generators/__init__.py rename to erpnext/setup/doctype/website_item_group/__init__.py diff --git a/setup/doctype/website_item_group/website_item_group.py b/erpnext/setup/doctype/website_item_group/website_item_group.py similarity index 100% rename from setup/doctype/website_item_group/website_item_group.py rename to erpnext/setup/doctype/website_item_group/website_item_group.py diff --git a/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt similarity index 100% rename from setup/doctype/website_item_group/website_item_group.txt rename to erpnext/setup/doctype/website_item_group/website_item_group.txt diff --git a/startup/install.py b/erpnext/setup/install.py similarity index 96% rename from startup/install.py rename to erpnext/setup/install.py index 94a3f55a1a4..0f18ae5ab79 100644 --- a/startup/install.py +++ b/erpnext/setup/install.py @@ -5,41 +5,15 @@ from __future__ import unicode_literals import webnotes -def post_import(): - webnotes.conn.begin() - - # feature setup +def after_install(): import_defaults() import_country_and_currency() - - # home page webnotes.conn.set_value('Control Panel', None, 'home_page', 'setup-wizard') - - # features feature_setup() - - # all roles to Administrator - from setup.page.setup_wizard.setup_wizard import add_all_roles_to + from erpnext.setup.page.setup_wizard.setup_wizard import add_all_roles_to add_all_roles_to("Administrator") - webnotes.conn.commit() -def feature_setup(): - """save global defaults and features setup""" - bean = webnotes.bean("Features Setup", "Features Setup") - bean.ignore_permissions = True - - # store value as 1 for all these fields - flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode', - 'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details', - 'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts', - 'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras', - 'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality', - 'fs_page_break', 'fs_more_info', 'fs_pos_view' - ] - bean.doc.fields.update(dict(zip(flds, [1]*len(flds)))) - bean.save() - def import_country_and_currency(): from webnotes.country_info import get_all data = get_all() @@ -138,4 +112,20 @@ def import_defaults(): if parent_link_field in bean.doc.fields and not bean.doc.fields.get(parent_link_field): bean.ignore_mandatory = True - bean.insert() \ No newline at end of file + bean.insert() + +def feature_setup(): + """save global defaults and features setup""" + bean = webnotes.bean("Features Setup", "Features Setup") + bean.ignore_permissions = True + + # store value as 1 for all these fields + flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode', + 'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details', + 'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts', + 'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras', + 'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality', + 'fs_page_break', 'fs_more_info', 'fs_pos_view' + ] + bean.doc.fields.update(dict(zip(flds, [1]*len(flds)))) + bean.save() \ No newline at end of file diff --git a/setup/page/__init__.py b/erpnext/setup/page/__init__.py similarity index 100% rename from setup/page/__init__.py rename to erpnext/setup/page/__init__.py diff --git a/setup/page/setup/__init__.py b/erpnext/setup/page/setup/__init__.py similarity index 100% rename from setup/page/setup/__init__.py rename to erpnext/setup/page/setup/__init__.py diff --git a/setup/page/setup/setup.js b/erpnext/setup/page/setup/setup.js similarity index 99% rename from setup/page/setup/setup.js rename to erpnext/setup/page/setup/setup.js index fc6afb4e6e3..fdde6934e52 100644 --- a/setup/page/setup/setup.js +++ b/erpnext/setup/page/setup/setup.js @@ -175,7 +175,7 @@ wn.pages.Setup.make = function(wrapper) { } return wn.call({ - method: "setup.page.setup.setup.get", + method: "erpnext.setup.page.setup.setup.get", callback: function(r) { if(r.message) { body.empty(); diff --git a/setup/page/setup/setup.py b/erpnext/setup/page/setup/setup.py similarity index 100% rename from setup/page/setup/setup.py rename to erpnext/setup/page/setup/setup.py diff --git a/setup/page/setup/setup.txt b/erpnext/setup/page/setup/setup.txt similarity index 100% rename from setup/page/setup/setup.txt rename to erpnext/setup/page/setup/setup.txt diff --git a/setup/doctype/jobs_email_settings/__init__.py b/erpnext/setup/page/setup_wizard/__init__.py similarity index 100% rename from setup/doctype/jobs_email_settings/__init__.py rename to erpnext/setup/page/setup_wizard/__init__.py diff --git a/setup/page/setup_wizard/setup_wizard.css b/erpnext/setup/page/setup_wizard/setup_wizard.css similarity index 100% rename from setup/page/setup_wizard/setup_wizard.css rename to erpnext/setup/page/setup_wizard/setup_wizard.css diff --git a/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js similarity index 53% rename from setup/page/setup_wizard/setup_wizard.js rename to erpnext/setup/page/setup_wizard/setup_wizard.js index 7b4253d510e..4c91727ef87 100644 --- a/setup/page/setup_wizard/setup_wizard.js +++ b/erpnext/setup/page/setup_wizard/setup_wizard.js @@ -6,14 +6,14 @@ wn.pages['setup-wizard'].onload = function(wrapper) { $(".navbar:first").toggle(false); $("body").css({"padding-top":"30px"}); - erpnext.wiz = new wn.wiz.Wizard({ + var wizard_settings = { page_name: "setup-wizard", parent: wrapper, on_complete: function(wiz) { var values = wiz.get_values(); wiz.show_working(); wn.call({ - method: "setup.page.setup_wizard.setup_wizard.setup_account", + method: "erpnext.setup.page.setup_wizard.setup_wizard.setup_account", args: values, callback: function(r) { if(r.exc) { @@ -59,11 +59,16 @@ wn.pages['setup-wizard'].onload = function(wrapper) { title: wn._("The First User: You"), icon: "icon-user", fields: [ - {"fieldname": "first_name", "label": wn._("First Name"), "fieldtype": "Data", reqd:1}, - {"fieldname": "last_name", "label": wn._("Last Name"), "fieldtype": "Data", reqd:1}, - {"fieldname": "email", "label": wn._("Email Id"), "fieldtype": "Data", reqd:1, "description":"Your Login Id"}, - {"fieldname": "password", "label": wn._("Password"), "fieldtype": "Password", reqd:1}, - {fieldtype:"Attach Image", fieldname:"attach_profile", label:"Attach Your Profile..."}, + {"fieldname": "first_name", "label": wn._("First Name"), "fieldtype": "Data", + reqd:1}, + {"fieldname": "last_name", "label": wn._("Last Name"), "fieldtype": "Data", + reqd:1}, + {"fieldname": "email", "label": wn._("Email Id"), "fieldtype": "Data", + reqd:1, "description":"Your Login Id", "options":"Email"}, + {"fieldname": "password", "label": wn._("Password"), "fieldtype": "Password", + reqd:1}, + {fieldtype:"Attach Image", fieldname:"attach_profile", + label:"Attach Your Profile..."}, ], help: wn._('The first user will become the System Manager (you can change that later).'), onload: function(slide) { @@ -72,13 +77,13 @@ wn.pages['setup-wizard'].onload = function(wrapper) { slide.form.fields_dict.email.$wrapper.toggle(false); slide.form.fields_dict.first_name.set_input(wn.boot.profile.first_name); slide.form.fields_dict.last_name.set_input(wn.boot.profile.last_name); - + delete slide.form.fields_dict.email; delete slide.form.fields_dict.password; } } }, - + // Organization { title: wn._("The Organization"), @@ -110,7 +115,7 @@ wn.pages['setup-wizard'].onload = function(wrapper) { }); } }, - + // Country { title: wn._("Country, Timezone and Currency"), @@ -139,7 +144,7 @@ wn.pages['setup-wizard'].onload = function(wrapper) { .add_options([""].concat(erpnext.all_timezones)); } }) - + slide.get_input("country").on("change", function() { var country = slide.get_input("country").val(); var $timezone = slide.get_input("timezone"); @@ -152,11 +157,10 @@ wn.pages['setup-wizard'].onload = function(wrapper) { } // add all timezones at the end, so that user has the option to change it to any timezone $timezone.add_options([""].concat(erpnext.all_timezones)); - }); } }, - + // Logo { icon: "icon-bookmark", @@ -167,25 +171,13 @@ wn.pages['setup-wizard'].onload = function(wrapper) { {fieldtype:"Attach Image", fieldname:"attach_logo", label:"Attach Logo..."}, ], }, - + // Taxes { icon: "icon-money", "title": wn._("Add Taxes"), "help": wn._("List your tax heads (e.g. VAT, Excise) (upto 3) and their standard rates. This will create a standard template, you can edit and add more later."), - "fields": [ - {fieldtype:"Data", fieldname:"tax_1", label:"Tax 1", placeholder:"e.g. VAT"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"tax_rate_1", label:"Rate (%)", placeholder:"e.g. 5"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"tax_2", label:"Tax 2", placeholder:"e.g. Customs Duty"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"tax_rate_2", label:"Rate (%)", placeholder:"e.g. 5"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"tax_3", label:"Tax 3", placeholder:"e.g. Excise"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"tax_rate_3", label:"Rate (%)", placeholder:"e.g. 5"}, - ], + "fields": [], }, // Customers @@ -193,80 +185,15 @@ wn.pages['setup-wizard'].onload = function(wrapper) { icon: "icon-group", "title": wn._("Your Customers"), "help": wn._("List a few of your customers. They could be organizations or individuals."), - "fields": [ - {fieldtype:"Data", fieldname:"customer_1", label:"Customer 1", placeholder:"Customer Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"customer_contact_1", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"customer_2", label:"Customer 2", placeholder:"Customer Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"customer_contact_2", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"customer_3", label:"Customer 3", placeholder:"Customer Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"customer_contact_3", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"customer_4", label:"Customer 4", placeholder:"Customer Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"customer_contact_4", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"customer_5", label:"Customer 5", placeholder:"Customer Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"customer_contact_5", label:"", placeholder:"Contact Name"}, - ], + "fields": [], }, - + // Items to Sell { icon: "icon-barcode", "title": wn._("Your Products or Services"), "help": wn._("List your products or services that you sell to your customers. Make sure to check the Item Group, Unit of Measure and other properties when you start."), - "fields": [ - {fieldtype:"Data", fieldname:"item_1", label:"Item 1", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Attach", fieldname:"item_img_1", label:"Attach Image..."}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_group_1", options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_uom_1", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_2", label:"Item 2", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Attach", fieldname:"item_img_2", label:"Attach Image..."}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_group_2", options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_uom_2", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_3", label:"Item 3", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Attach", fieldname:"item_img_3", label:"Attach Image..."}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_group_3", options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_uom_3", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_4", label:"Item 4", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Attach", fieldname:"item_img_4", label:"Attach Image..."}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_group_4", options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_uom_4", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_5", label:"Item 5", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Attach", fieldname:"item_img_5", label:"Attach Image..."}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_group_5", options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_uom_5", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - ], + "fields": [], }, // Suppliers @@ -274,27 +201,7 @@ wn.pages['setup-wizard'].onload = function(wrapper) { icon: "icon-group", "title": wn._("Your Suppliers"), "help": wn._("List a few of your suppliers. They could be organizations or individuals."), - "fields": [ - {fieldtype:"Data", fieldname:"supplier_1", label:"Supplier 1", placeholder:"Supplier Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"supplier_contact_1", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"supplier_2", label:"Supplier 2", placeholder:"Supplier Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"supplier_contact_2", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"supplier_3", label:"Supplier 3", placeholder:"Supplier Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"supplier_contact_3", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"supplier_4", label:"Supplier 4", placeholder:"Supplier Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"supplier_contact_4", label:"", placeholder:"Contact Name"}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"supplier_5", label:"Supplier 5", placeholder:"Supplier Name"}, - {fieldtype:"Column Break"}, - {fieldtype:"Data", fieldname:"supplier_contact_5", label:"", placeholder:"Contact Name"}, - ], + "fields": [], }, // Items to Buy @@ -302,52 +209,79 @@ wn.pages['setup-wizard'].onload = function(wrapper) { icon: "icon-barcode", "title": wn._("Products or Services You Buy"), "help": wn._("List a few products or services you buy from your suppliers or vendors. If these are same as your products, then do not add them."), - "fields": [ - {fieldtype:"Data", fieldname:"item_buy_1", label:"Item 1", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_group_1", options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_uom_1", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_buy_2", label:"Item 2", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_group_2", options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_uom_2", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_buy_3", label:"Item 3", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_group_3", options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_uom_3", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_buy_4", label:"Item 4", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_group_4", options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_uom_4", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - {fieldtype:"Section Break"}, - {fieldtype:"Data", fieldname:"item_buy_5", label:"Item 5", placeholder:"A Product or Service"}, - {fieldtype:"Column Break"}, - {fieldtype:"Section Break"}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_group_5", options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, - {fieldtype:"Column Break"}, - {fieldtype:"Select", fieldname:"item_buy_uom_5", options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, - ], + "fields": [], }, ] - - }) + } + + // taxes + for(var i=1; i<4; i++) { + wizard_settings.slides[4].fields = wizard_settings.slides[4].fields.concat([ + {fieldtype:"Data", fieldname:"tax_"+ i, label:"Tax " + 1, placeholder:"e.g. VAT"}, + {fieldtype:"Column Break"}, + {fieldtype:"Data", fieldname:"tax_rate_i", label:"Rate (%)", placeholder:"e.g. 5"}, + {fieldtype:"Section Break"}, + ]) + } + + // customers + for(var i=1; i<6; i++) { + wizard_settings.slides[5].fields = wizard_settings.slides[5].fields.concat([ + {fieldtype:"Data", fieldname:"customer_" + i, label:"Customer " + i, + placeholder:"Customer Name"}, + {fieldtype:"Column Break"}, + {fieldtype:"Data", fieldname:"customer_contact_" + i, + label:"Contact", placeholder:"Contact Name"}, + {fieldtype:"Section Break"} + ]) + } + + for(var i=1; i<6; i++) { + wizard_settings.slides[6].fields = wizard_settings.slides[6].fields.concat([ + {fieldtype:"Data", fieldname:"item_" + i, label:"Item " + 1, + placeholder:"A Product or Service"}, + {fieldtype:"Column Break"}, + {fieldtype:"Attach", fieldname:"item_img_" + i, label:"Attach Image..."}, + {fieldtype:"Section Break"}, + {fieldtype:"Column Break"}, + {fieldtype:"Select", label:"Group", fieldname:"item_group_" + i, + options:["Products", "Services", "Raw Material", "Sub Assemblies"]}, + {fieldtype:"Column Break"}, + {fieldtype:"Select", fieldname:"item_uom_" + i, label:"UOM", + options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, + {fieldtype:"Section Break"} + ]) + } + + for(var i=1; i<6; i++) { + wizard_settings.slides[7].fields = wizard_settings.slides[7].fields.concat([ + {fieldtype:"Data", fieldname:"supplier_" + i, label:"Supplier " + i, + placeholder:"Supplier Name"}, + {fieldtype:"Column Break"}, + {fieldtype:"Data", fieldname:"supplier_contact_" + i, + label:"Contact", placeholder:"Contact Name"}, + {fieldtype:"Section Break"} + ]) + } + + for(var i=1; i<6; i++) { + wizard_settings.slides[8].fields = wizard_settings.slides[8].fields.concat([ + {fieldtype:"Data", fieldname:"item_buy_" + i, label:"Item " + i, + placeholder:"A Product or Service"}, + {fieldtype:"Column Break"}, + {fieldtype:"Section Break"}, + {fieldtype:"Column Break"}, + {fieldtype:"Select", fieldname:"item_buy_group_" + i, label: "Group", + options:["Raw Material", "Consumable", "Sub Assemblies", "Services", "Products"]}, + {fieldtype:"Column Break"}, + {fieldtype:"Select", fieldname:"item_buy_uom_" + i, label: "UOM", + options:["Unit", "Nos", "Box", "Pair", "Kg", "Set", "Hour", "Minute"]}, + {fieldtype:"Section Break"}, + ]) + } + + erpnext.wiz = new wn.wiz.Wizard(wizard_settings) } wn.pages['setup-wizard'].onshow = function(wrapper) { @@ -434,7 +368,16 @@ wn.wiz.WizardSlide = Class.extend({ make: function() { var me = this; this.$wrapper = $(repl('%(help)s
\