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('
\ - \ + \
' + brand) .attr("title", brand) .addClass("navbar-icon-home") @@ -27,9 +27,7 @@ wn.ui.misc.about = function() { var d = new wn.ui.Dialog({title: wn._('About ERPNext')}) $(d.body).html(repl("
\ -

"+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

\
\ diff --git a/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js similarity index 100% rename from public/js/controllers/accounts.js rename to erpnext/public/js/controllers/accounts.js diff --git a/public/js/controllers/stock_controller.js b/erpnext/public/js/controllers/stock_controller.js similarity index 100% rename from public/js/controllers/stock_controller.js rename to erpnext/public/js/controllers/stock_controller.js diff --git a/public/js/feature_setup.js b/erpnext/public/js/feature_setup.js similarity index 100% rename from public/js/feature_setup.js rename to erpnext/public/js/feature_setup.js diff --git a/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js similarity index 100% rename from public/js/purchase_trends_filters.js rename to erpnext/public/js/purchase_trends_filters.js diff --git a/public/js/queries.js b/erpnext/public/js/queries.js similarity index 74% rename from public/js/queries.js rename to erpnext/public/js/queries.js index 3c60a9149af..621e340ff7c 100644 --- a/public/js/queries.js +++ b/erpnext/public/js/queries.js @@ -9,27 +9,27 @@ $.extend(erpnext.queries, { }, lead: function() { - return { query: "controllers.queries.lead_query" }; + return { query: "erpnext.controllers.queries.lead_query" }; }, customer: function() { - return { query: "controllers.queries.customer_query" }; + return { query: "erpnext.controllers.queries.customer_query" }; }, supplier: function() { - return { query: "controllers.queries.supplier_query" }; + return { query: "erpnext.controllers.queries.supplier_query" }; }, account: function() { - return { query: "controllers.queries.account_query" }; + return { query: "erpnext.controllers.queries.account_query" }; }, item: function() { - return { query: "controllers.queries.item_query" }; + return { query: "erpnext.controllers.queries.item_query" }; }, bom: function() { - return { query: "controllers.queries.bom" }; + return { query: "erpnext.controllers.queries.bom" }; }, task: function() { diff --git a/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js similarity index 100% rename from public/js/sales_trends_filters.js rename to erpnext/public/js/sales_trends_filters.js diff --git a/public/js/startup.css b/erpnext/public/js/startup.css similarity index 100% rename from public/js/startup.css rename to erpnext/public/js/startup.css diff --git a/public/js/startup.js b/erpnext/public/js/startup.js similarity index 100% rename from public/js/startup.js rename to erpnext/public/js/startup.js diff --git a/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js similarity index 99% rename from public/js/stock_analytics.js rename to erpnext/public/js/stock_analytics.js index 8b68d39e692..48deeb4e4bb 100644 --- a/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/stock_grid_report.js"); +wn.require("assets/erpnext/js/stock_grid_report.js"); erpnext.StockAnalytics = erpnext.StockGridReport.extend({ init: function(wrapper, opts) { diff --git a/public/js/stock_grid_report.js b/erpnext/public/js/stock_grid_report.js similarity index 100% rename from public/js/stock_grid_report.js rename to erpnext/public/js/stock_grid_report.js diff --git a/public/js/toolbar.js b/erpnext/public/js/toolbar.js similarity index 100% rename from public/js/toolbar.js rename to erpnext/public/js/toolbar.js diff --git a/public/js/transaction.js b/erpnext/public/js/transaction.js similarity index 99% rename from public/js/transaction.js rename to erpnext/public/js/transaction.js index 4c4a810ed25..5b48820c9c6 100644 --- a/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt wn.provide("erpnext"); -wn.require("app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); erpnext.TransactionController = erpnext.stock.StockController.extend({ onload: function() { @@ -214,7 +214,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ var fieldname = buying_or_selling.toLowerCase() + "_price_list"; if(this.frm.doc[fieldname]) { return this.frm.call({ - method: "setup.utils.get_price_list_currency", + method: "erpnext.setup.utils.get_price_list_currency", args: { price_list: this.frm.doc[fieldname], }, diff --git a/public/js/utils.js b/erpnext/public/js/utils.js similarity index 100% rename from public/js/utils.js rename to erpnext/public/js/utils.js diff --git a/public/js/website_utils.js b/erpnext/public/js/website_utils.js similarity index 95% rename from public/js/website_utils.js rename to erpnext/public/js/website_utils.js index e752812fd6c..fda30b8af68 100644 --- a/public/js/website_utils.js +++ b/erpnext/public/js/website_utils.js @@ -8,7 +8,7 @@ if(!window.erpnext) erpnext = {}; wn.send_message = function(opts, btn) { return wn.call({ type: "POST", - method: "portal.utils.send_message", + method: "erpnext.portal.utils.send_message", btn: btn, args: opts, callback: opts.callback @@ -46,7 +46,7 @@ $.extend(erpnext.cart, { } else { return wn.call({ type: "POST", - method: "selling.utils.cart.update_cart", + method: "erpnext.selling.utils.cart.update_cart", args: { item_code: opts.item_code, qty: opts.qty, diff --git a/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt similarity index 100% rename from selling/Print Format/Quotation Classic/Quotation Classic.txt rename to erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt diff --git a/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt similarity index 100% rename from selling/Print Format/Quotation Modern/Quotation Modern.txt rename to erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt diff --git a/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt similarity index 100% rename from selling/Print Format/Quotation Spartan/Quotation Spartan.txt rename to erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt diff --git a/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt similarity index 100% rename from selling/Print Format/Sales Order Classic/Sales Order Classic.txt rename to erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt diff --git a/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt similarity index 100% rename from selling/Print Format/Sales Order Modern/Sales Order Modern.txt rename to erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt diff --git a/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt similarity index 100% rename from selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt rename to erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt diff --git a/selling/README.md b/erpnext/selling/README.md similarity index 100% rename from selling/README.md rename to erpnext/selling/README.md diff --git a/projects/doctype/time_log_batch_detail/__init__.py b/erpnext/selling/__init__.py similarity index 100% rename from projects/doctype/time_log_batch_detail/__init__.py rename to erpnext/selling/__init__.py diff --git a/selling/doctype/__init__.py b/erpnext/selling/doctype/__init__.py similarity index 100% rename from selling/doctype/__init__.py rename to erpnext/selling/doctype/__init__.py diff --git a/selling/doctype/campaign/README.md b/erpnext/selling/doctype/campaign/README.md similarity index 100% rename from selling/doctype/campaign/README.md rename to erpnext/selling/doctype/campaign/README.md diff --git a/selling/doctype/campaign/__init__.py b/erpnext/selling/doctype/campaign/__init__.py similarity index 100% rename from selling/doctype/campaign/__init__.py rename to erpnext/selling/doctype/campaign/__init__.py diff --git a/selling/doctype/campaign/campaign.js b/erpnext/selling/doctype/campaign/campaign.js similarity index 100% rename from selling/doctype/campaign/campaign.js rename to erpnext/selling/doctype/campaign/campaign.js diff --git a/selling/doctype/campaign/campaign.py b/erpnext/selling/doctype/campaign/campaign.py similarity index 100% rename from selling/doctype/campaign/campaign.py rename to erpnext/selling/doctype/campaign/campaign.py diff --git a/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.txt similarity index 100% rename from selling/doctype/campaign/campaign.txt rename to erpnext/selling/doctype/campaign/campaign.txt diff --git a/selling/doctype/campaign/test_campaign.py b/erpnext/selling/doctype/campaign/test_campaign.py similarity index 100% rename from selling/doctype/campaign/test_campaign.py rename to erpnext/selling/doctype/campaign/test_campaign.py diff --git a/selling/doctype/customer/README.md b/erpnext/selling/doctype/customer/README.md similarity index 100% rename from selling/doctype/customer/README.md rename to erpnext/selling/doctype/customer/README.md diff --git a/selling/doctype/customer/__init__.py b/erpnext/selling/doctype/customer/__init__.py similarity index 100% rename from selling/doctype/customer/__init__.py rename to erpnext/selling/doctype/customer/__init__.py diff --git a/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js similarity index 95% rename from selling/doctype/customer/customer.js rename to erpnext/selling/doctype/customer/customer.js index 5e0ccc98f24..e8130aec5ee 100644 --- a/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; cur_frm.cscript.onload = function(doc,dt,dn){ cur_frm.cscript.load_defaults(doc, dt, dn); @@ -52,7 +52,7 @@ cur_frm.cscript.setup_dashboard = function(doc) { return wn.call({ type: "GET", - method:"selling.doctype.customer.customer.get_dashboard_info", + method: "erpnext.selling.doctype.customer.customer.get_dashboard_info", args: { customer: cur_frm.doc.name }, @@ -116,7 +116,7 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) { cur_frm.fields_dict.lead_name.get_query = function(doc,cdt,cdn) { return{ - query:"controllers.queries.lead_query" + query: "erpnext.controllers.queries.lead_query" } } diff --git a/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py similarity index 98% rename from selling/doctype/customer/customer.py rename to erpnext/selling/doctype/customer/customer.py index 23312ecd67e..ee54f9319fd 100644 --- a/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -9,7 +9,7 @@ from webnotes import msgprint, _ import webnotes.defaults -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self, doc, doclist=[]): @@ -154,7 +154,7 @@ class DocType(TransactionBase): webnotes.conn.sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name) 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("Customer", olddn, newdn, merge) def after_rename(self, olddn, newdn, merge=False): diff --git a/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt similarity index 98% rename from selling/doctype/customer/customer.txt rename to erpnext/selling/doctype/customer/customer.txt index 92fa62659c8..aaf4b9d6d61 100644 --- a/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-11 14:26:44", "docstatus": 0, - "modified": "2013-12-20 19:24:01", + "modified": "2013-12-25 11:15:05", "modified_by": "Administrator", "owner": "Administrator" }, @@ -16,7 +16,7 @@ "icon": "icon-user", "module": "Selling", "name": "__common__", - "search_fields": "customer_name,customer_group,country,territory" + "search_fields": "customer_name,customer_group,territory" }, { "doctype": "DocField", diff --git a/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py similarity index 100% rename from selling/doctype/customer/test_customer.py rename to erpnext/selling/doctype/customer/test_customer.py diff --git a/projects/report/__init__.py b/erpnext/selling/doctype/customer_discount/__init__.py similarity index 100% rename from projects/report/__init__.py rename to erpnext/selling/doctype/customer_discount/__init__.py diff --git a/selling/doctype/customer_discount/customer_discount.py b/erpnext/selling/doctype/customer_discount/customer_discount.py similarity index 100% rename from selling/doctype/customer_discount/customer_discount.py rename to erpnext/selling/doctype/customer_discount/customer_discount.py diff --git a/selling/doctype/customer_discount/customer_discount.txt b/erpnext/selling/doctype/customer_discount/customer_discount.txt similarity index 100% rename from selling/doctype/customer_discount/customer_discount.txt rename to erpnext/selling/doctype/customer_discount/customer_discount.txt diff --git a/selling/doctype/industry_type/README.md b/erpnext/selling/doctype/industry_type/README.md similarity index 100% rename from selling/doctype/industry_type/README.md rename to erpnext/selling/doctype/industry_type/README.md diff --git a/selling/doctype/industry_type/__init__.py b/erpnext/selling/doctype/industry_type/__init__.py similarity index 100% rename from selling/doctype/industry_type/__init__.py rename to erpnext/selling/doctype/industry_type/__init__.py diff --git a/selling/doctype/industry_type/industry_type.js b/erpnext/selling/doctype/industry_type/industry_type.js similarity index 100% rename from selling/doctype/industry_type/industry_type.js rename to erpnext/selling/doctype/industry_type/industry_type.js diff --git a/selling/doctype/industry_type/industry_type.py b/erpnext/selling/doctype/industry_type/industry_type.py similarity index 100% rename from selling/doctype/industry_type/industry_type.py rename to erpnext/selling/doctype/industry_type/industry_type.py diff --git a/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.txt similarity index 100% rename from selling/doctype/industry_type/industry_type.txt rename to erpnext/selling/doctype/industry_type/industry_type.txt diff --git a/selling/doctype/industry_type/test_industry_type.py b/erpnext/selling/doctype/industry_type/test_industry_type.py similarity index 100% rename from selling/doctype/industry_type/test_industry_type.py rename to erpnext/selling/doctype/industry_type/test_industry_type.py diff --git a/selling/doctype/installation_note/README.md b/erpnext/selling/doctype/installation_note/README.md similarity index 100% rename from selling/doctype/installation_note/README.md rename to erpnext/selling/doctype/installation_note/README.md diff --git a/selling/doctype/installation_note/__init__.py b/erpnext/selling/doctype/installation_note/__init__.py similarity index 100% rename from selling/doctype/installation_note/__init__.py rename to erpnext/selling/doctype/installation_note/__init__.py diff --git a/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js similarity index 94% rename from selling/doctype/installation_note/installation_note.js rename to erpnext/selling/doctype/installation_note/installation_note.js index ea777e0d77d..223bd8d279d 100644 --- a/selling/doctype/installation_note/installation_note.js +++ b/erpnext/selling/doctype/installation_note/installation_note.js @@ -37,7 +37,7 @@ erpnext.selling.InstallationNote = wn.ui.form.Controller.extend({ this.frm.set_query("customer", function() { return { - query: "controllers.queries.customer_query" + query: "erpnext.controllers.queries.customer_query" } }); }, @@ -47,7 +47,7 @@ erpnext.selling.InstallationNote = wn.ui.form.Controller.extend({ cur_frm.add_custom_button(wn._('From Delivery Note'), function() { wn.model.map_current_doc({ - method: "stock.doctype.delivery_note.delivery_note.make_installation_note", + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note", source_doctype: "Delivery Note", get_query_filters: { docstatus: 1, diff --git a/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py similarity index 94% rename from selling/doctype/installation_note/installation_note.py rename to erpnext/selling/doctype/installation_note/installation_note.py index 026d7e11622..253e43ea7b7 100644 --- a/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -7,9 +7,9 @@ import webnotes from webnotes.utils import cstr, getdate from webnotes.model.bean import getlist from webnotes import msgprint -from stock.utils import get_valid_serial_nos +from erpnext.stock.utils import get_valid_serial_nos -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self, doc, doclist=[]): @@ -36,11 +36,11 @@ class DocType(TransactionBase): self.validate_installation_date() self.check_item_table() - from controllers.selling_controller import check_active_sales_items + from erpnext.controllers.selling_controller import check_active_sales_items check_active_sales_items(self) 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.inst_date, self.doc.fiscal_year, "Installation Date") def is_serial_no_added(self, item_code, serial_no): diff --git a/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.txt similarity index 100% rename from selling/doctype/installation_note/installation_note.txt rename to erpnext/selling/doctype/installation_note/installation_note.txt diff --git a/selling/doctype/installation_note_item/README.md b/erpnext/selling/doctype/installation_note_item/README.md similarity index 100% rename from selling/doctype/installation_note_item/README.md rename to erpnext/selling/doctype/installation_note_item/README.md diff --git a/selling/doctype/installation_note_item/__init__.py b/erpnext/selling/doctype/installation_note_item/__init__.py similarity index 100% rename from selling/doctype/installation_note_item/__init__.py rename to erpnext/selling/doctype/installation_note_item/__init__.py diff --git a/selling/doctype/installation_note_item/installation_note_item.py b/erpnext/selling/doctype/installation_note_item/installation_note_item.py similarity index 100% rename from selling/doctype/installation_note_item/installation_note_item.py rename to erpnext/selling/doctype/installation_note_item/installation_note_item.py diff --git a/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt similarity index 100% rename from selling/doctype/installation_note_item/installation_note_item.txt rename to erpnext/selling/doctype/installation_note_item/installation_note_item.txt diff --git a/selling/doctype/lead/README.md b/erpnext/selling/doctype/lead/README.md similarity index 100% rename from selling/doctype/lead/README.md rename to erpnext/selling/doctype/lead/README.md diff --git a/selling/doctype/lead/__init__.py b/erpnext/selling/doctype/lead/__init__.py similarity index 100% rename from selling/doctype/lead/__init__.py rename to erpnext/selling/doctype/lead/__init__.py diff --git a/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py similarity index 96% rename from selling/doctype/lead/get_leads.py rename to erpnext/selling/doctype/lead/get_leads.py index 7bc691f4588..898ee0e9dc6 100644 --- a/selling/doctype/lead/get_leads.py +++ b/erpnext/selling/doctype/lead/get_leads.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 def add_sales_communication(subject, content, sender, real_name, mail=None, status="Open", date=None): diff --git a/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js similarity index 90% rename from selling/doctype/lead/lead.js rename to erpnext/selling/doctype/lead/lead.js index 54a249fbe16..4ab1067089e 100644 --- a/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -1,14 +1,14 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/setup/doctype/contact_control/contact_control.js'); +{% include 'setup/doctype/contact_control/contact_control.js' %}; +{% include 'utilities/doctype/sms_control/sms_control.js' %} wn.provide("erpnext"); erpnext.LeadController = wn.ui.form.Controller.extend({ setup: function() { this.frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return { query:"controllers.queries.customer_query" } } + return { query: "erpnext.controllers.queries.customer_query" } } }, onload: function() { @@ -77,14 +77,14 @@ erpnext.LeadController = wn.ui.form.Controller.extend({ create_customer: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.lead.lead.make_customer", + method: "erpnext.selling.doctype.lead.lead.make_customer", source_name: cur_frm.doc.name }) }, create_opportunity: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.lead.lead.make_opportunity", + method: "erpnext.selling.doctype.lead.lead.make_opportunity", source_name: cur_frm.doc.name }) } diff --git a/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py similarity index 98% rename from selling/doctype/lead/lead.py rename to erpnext/selling/doctype/lead/lead.py index 26c06bb5e6a..e5f2b623334 100644 --- a/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -8,7 +8,7 @@ from webnotes.utils import cstr, validate_email_add, cint, extract_email_id from webnotes import session, msgprint -from controllers.selling_controller import SellingController +from erpnext.controllers.selling_controller import SellingController class DocType(SellingController): def __init__(self, doc, doclist): diff --git a/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt similarity index 100% rename from selling/doctype/lead/lead.txt rename to erpnext/selling/doctype/lead/lead.txt diff --git a/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py similarity index 94% rename from selling/doctype/lead/test_lead.py rename to erpnext/selling/doctype/lead/test_lead.py index ec18ff7d6f9..d3f6f03d06e 100644 --- a/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -19,7 +19,7 @@ import unittest class TestLead(unittest.TestCase): def test_make_customer(self): - from selling.doctype.lead.lead import make_customer + from erpnext.selling.doctype.lead.lead import make_customer customer = make_customer("_T-Lead-00001") self.assertEquals(customer[0]["doctype"], "Customer") diff --git a/selling/doctype/opportunity/README.md b/erpnext/selling/doctype/opportunity/README.md similarity index 100% rename from selling/doctype/opportunity/README.md rename to erpnext/selling/doctype/opportunity/README.md diff --git a/selling/doctype/opportunity/__init__.py b/erpnext/selling/doctype/opportunity/__init__.py similarity index 100% rename from selling/doctype/opportunity/__init__.py rename to erpnext/selling/doctype/opportunity/__init__.py diff --git a/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js similarity index 96% rename from selling/doctype/opportunity/opportunity.js rename to erpnext/selling/doctype/opportunity/opportunity.js index 05970fc350f..396def8b0ef 100644 --- a/selling/doctype/opportunity/opportunity.js +++ b/erpnext/selling/doctype/opportunity/opportunity.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require('app/utilities/doctype/sms_control/sms_control.js'); +{% include 'utilities/doctype/sms_control/sms_control.js' %}; wn.provide("erpnext.selling"); // TODO commonify this code @@ -60,7 +60,7 @@ erpnext.selling.Opportunity = wn.ui.form.Controller.extend({ this.frm.set_query("item_code", "enquiry_details", function() { return { - query: "controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters: me.frm.doc.enquiry_type === "Maintenance" ? {"is_service_item": "Yes"} : {"is_sales_item": "Yes"} }; @@ -91,7 +91,7 @@ erpnext.selling.Opportunity = wn.ui.form.Controller.extend({ create_quotation: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.opportunity.opportunity.make_quotation", + method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation", source_name: cur_frm.doc.name }) } @@ -162,7 +162,7 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) { cur_frm.toggle_display("contact_info", doc.customer || doc.lead); wn.model.map_current_doc({ - method: "selling.doctype.lead.lead.make_opportunity", + method: "erpnext.selling.doctype.lead.lead.make_opportunity", source_name: cur_frm.doc.lead }) diff --git a/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py similarity index 97% rename from selling/doctype/opportunity/opportunity.py rename to erpnext/selling/doctype/opportunity/opportunity.py index e6c0afeb35e..00a447f9565 100644 --- a/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -9,7 +9,7 @@ from webnotes.model.bean import getlist from webnotes import msgprint, _ -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self,doc,doclist): @@ -104,7 +104,7 @@ class DocType(TransactionBase): self.validate_uom_is_integer("uom", "qty") self.validate_lead_cust() - from accounts.utils import validate_fiscal_year + from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.doc.transaction_date, self.doc.fiscal_year, "Opportunity Date") def on_submit(self): diff --git a/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt similarity index 100% rename from selling/doctype/opportunity/opportunity.txt rename to erpnext/selling/doctype/opportunity/opportunity.txt diff --git a/selling/doctype/opportunity_item/README.md b/erpnext/selling/doctype/opportunity_item/README.md similarity index 100% rename from selling/doctype/opportunity_item/README.md rename to erpnext/selling/doctype/opportunity_item/README.md diff --git a/selling/doctype/opportunity_item/__init__.py b/erpnext/selling/doctype/opportunity_item/__init__.py similarity index 100% rename from selling/doctype/opportunity_item/__init__.py rename to erpnext/selling/doctype/opportunity_item/__init__.py diff --git a/selling/doctype/opportunity_item/opportunity_item.py b/erpnext/selling/doctype/opportunity_item/opportunity_item.py similarity index 100% rename from selling/doctype/opportunity_item/opportunity_item.py rename to erpnext/selling/doctype/opportunity_item/opportunity_item.py diff --git a/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt similarity index 100% rename from selling/doctype/opportunity_item/opportunity_item.txt rename to erpnext/selling/doctype/opportunity_item/opportunity_item.txt diff --git a/selling/doctype/quotation/README.md b/erpnext/selling/doctype/quotation/README.md similarity index 100% rename from selling/doctype/quotation/README.md rename to erpnext/selling/doctype/quotation/README.md diff --git a/selling/doctype/quotation/__init__.py b/erpnext/selling/doctype/quotation/__init__.py similarity index 100% rename from selling/doctype/quotation/__init__.py rename to erpnext/selling/doctype/quotation/__init__.py diff --git a/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js similarity index 89% rename from selling/doctype/quotation/quotation.js rename to erpnext/selling/doctype/quotation/quotation.js index c7bf44718fa..bb2ce8ca6ae 100644 --- a/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -8,10 +8,10 @@ cur_frm.cscript.fname = "quotation_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %} +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ onload: function(doc, dt, dn) { @@ -39,7 +39,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ cur_frm.add_custom_button(wn._('From Opportunity'), function() { wn.model.map_current_doc({ - method: "selling.doctype.opportunity.opportunity.make_quotation", + method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation", source_doctype: "Opportunity", get_query_filters: { docstatus: 1, @@ -90,7 +90,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ cur_frm.script_manager.make(erpnext.selling.QuotationController); cur_frm.fields_dict.lead.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.lead_query" } } + return{ query: "erpnext.controllers.queries.lead_query" } } cur_frm.cscript.lead = function(doc, cdt, cdn) { if(doc.lead) { @@ -112,7 +112,7 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) { // ===================================================================================== cur_frm.cscript['Make Sales Order'] = function() { wn.model.open_mapped_doc({ - method: "selling.doctype.quotation.quotation.make_sales_order", + method: "erpnext.selling.doctype.quotation.quotation.make_sales_order", source_name: cur_frm.doc.name }) } diff --git a/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py similarity index 97% rename from selling/doctype/quotation/quotation.py rename to erpnext/selling/doctype/quotation/quotation.py index f2546b9cfac..6a030b99f90 100644 --- a/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -11,7 +11,7 @@ from webnotes import _, msgprint -from controllers.selling_controller import SellingController +from erpnext.controllers.selling_controller import SellingController class DocType(SellingController): def __init__(self, doc, doclist=[]): @@ -150,7 +150,7 @@ def _make_customer(source_name, ignore_permissions=False): lead_name = quotation[0] customer_name = webnotes.conn.get_value("Customer", {"lead_name": lead_name}) if not customer_name: - from selling.doctype.lead.lead import _make_customer + from erpnext.selling.doctype.lead.lead import _make_customer customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions) customer = webnotes.bean(customer_doclist) customer.ignore_permissions = ignore_permissions diff --git a/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt similarity index 100% rename from selling/doctype/quotation/quotation.txt rename to erpnext/selling/doctype/quotation/quotation.txt diff --git a/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py similarity index 96% rename from selling/doctype/quotation/test_quotation.py rename to erpnext/selling/doctype/quotation/test_quotation.py index 8f0e644cb93..00cbd6cd9eb 100644 --- a/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -9,7 +9,7 @@ test_dependencies = ["Sales BOM"] class TestQuotation(unittest.TestCase): def test_make_sales_order(self): - from selling.doctype.quotation.quotation import make_sales_order + from erpnext.selling.doctype.quotation.quotation import make_sales_order quotation = webnotes.bean(copy=test_records[0]) quotation.insert() diff --git a/selling/doctype/quotation_item/README.md b/erpnext/selling/doctype/quotation_item/README.md similarity index 100% rename from selling/doctype/quotation_item/README.md rename to erpnext/selling/doctype/quotation_item/README.md diff --git a/selling/doctype/quotation_item/__init__.py b/erpnext/selling/doctype/quotation_item/__init__.py similarity index 100% rename from selling/doctype/quotation_item/__init__.py rename to erpnext/selling/doctype/quotation_item/__init__.py diff --git a/selling/doctype/quotation_item/quotation_item.py b/erpnext/selling/doctype/quotation_item/quotation_item.py similarity index 100% rename from selling/doctype/quotation_item/quotation_item.py rename to erpnext/selling/doctype/quotation_item/quotation_item.py diff --git a/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt similarity index 100% rename from selling/doctype/quotation_item/quotation_item.txt rename to erpnext/selling/doctype/quotation_item/quotation_item.txt diff --git a/selling/doctype/sales_bom/__init__.py b/erpnext/selling/doctype/sales_bom/__init__.py similarity index 100% rename from selling/doctype/sales_bom/__init__.py rename to erpnext/selling/doctype/sales_bom/__init__.py diff --git a/selling/doctype/sales_bom/sales_bom.js b/erpnext/selling/doctype/sales_bom/sales_bom.js similarity index 100% rename from selling/doctype/sales_bom/sales_bom.js rename to erpnext/selling/doctype/sales_bom/sales_bom.js diff --git a/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py similarity index 91% rename from selling/doctype/sales_bom/sales_bom.py rename to erpnext/selling/doctype/sales_bom/sales_bom.py index f6cfafa41df..2f47be33347 100644 --- a/selling/doctype/sales_bom/sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/sales_bom.py @@ -14,7 +14,7 @@ class DocType: def validate(self): 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, "uom", "qty") def validate_main_item(self): @@ -33,7 +33,7 @@ class DocType: } def get_new_item_code(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, item_name, description from tabItem where is_stock_item="No" and is_sales_item="Yes" diff --git a/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.txt similarity index 100% rename from selling/doctype/sales_bom/sales_bom.txt rename to erpnext/selling/doctype/sales_bom/sales_bom.txt diff --git a/selling/doctype/sales_bom/test_sales_bom.py b/erpnext/selling/doctype/sales_bom/test_sales_bom.py similarity index 100% rename from selling/doctype/sales_bom/test_sales_bom.py rename to erpnext/selling/doctype/sales_bom/test_sales_bom.py diff --git a/selling/doctype/sales_bom_item/__init__.py b/erpnext/selling/doctype/sales_bom_item/__init__.py similarity index 100% rename from selling/doctype/sales_bom_item/__init__.py rename to erpnext/selling/doctype/sales_bom_item/__init__.py diff --git a/selling/doctype/sales_bom_item/sales_bom_item.py b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py similarity index 100% rename from selling/doctype/sales_bom_item/sales_bom_item.py rename to erpnext/selling/doctype/sales_bom_item/sales_bom_item.py diff --git a/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt similarity index 100% rename from selling/doctype/sales_bom_item/sales_bom_item.txt rename to erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt diff --git a/selling/doctype/sales_order/README.md b/erpnext/selling/doctype/sales_order/README.md similarity index 100% rename from selling/doctype/sales_order/README.md rename to erpnext/selling/doctype/sales_order/README.md diff --git a/selling/doctype/sales_order/__init__.py b/erpnext/selling/doctype/sales_order/__init__.py similarity index 100% rename from selling/doctype/sales_order/__init__.py rename to erpnext/selling/doctype/sales_order/__init__.py diff --git a/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js similarity index 85% rename from selling/doctype/sales_order/sales_order.js rename to erpnext/selling/doctype/sales_order/sales_order.js index e4b3caf486d..f39394527e9 100644 --- a/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -8,11 +8,10 @@ cur_frm.cscript.fname = "sales_order_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; - -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %} +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({ refresh: function(doc, dt, dn) { @@ -62,7 +61,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( cur_frm.add_custom_button(wn._('From Quotation'), function() { wn.model.map_current_doc({ - method: "selling.doctype.quotation.quotation.make_sales_order", + method: "erpnext.selling.doctype.quotation.quotation.make_sales_order", source_doctype: "Quotation", get_query_filters: { docstatus: 1, @@ -90,7 +89,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( var item = wn.model.get_doc(cdt, cdn); if(item.item_code && item.reserved_warehouse) { return this.frm.call({ - method: "selling.utils.get_available_qty", + method: "erpnext.selling.utils.get_available_qty", child: item, args: { item_code: item.item_code, @@ -102,35 +101,35 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( make_material_request: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.sales_order.sales_order.make_material_request", + method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request", source_name: cur_frm.doc.name }) }, make_delivery_note: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.sales_order.sales_order.make_delivery_note", + method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note", source_name: cur_frm.doc.name }) }, make_sales_invoice: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.sales_order.sales_order.make_sales_invoice", + method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", source_name: cur_frm.doc.name }) }, make_maintenance_schedule: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.sales_order.sales_order.make_maintenance_schedule", + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule", source_name: cur_frm.doc.name }) }, make_maintenance_visit: function() { wn.model.open_mapped_doc({ - method: "selling.doctype.sales_order.sales_order.make_maintenance_visit", + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit", source_name: cur_frm.doc.name }) }, @@ -148,7 +147,7 @@ cur_frm.cscript.new_contact = function(){ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { return { - query: "controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project_name", filters: { 'customer': doc.customer } diff --git a/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py similarity index 97% rename from selling/doctype/sales_order/sales_order.py rename to erpnext/selling/doctype/sales_order/sales_order.py index d760baf36e8..8e7a89da3e7 100644 --- a/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -11,7 +11,7 @@ from webnotes.model.code import get_obj from webnotes import msgprint from webnotes.model.mapper import get_mapped_doclist -from controllers.selling_controller import SellingController +from erpnext.controllers.selling_controller import SellingController class DocType(SellingController): def __init__(self, doc, doclist=None): @@ -110,8 +110,9 @@ class DocType(SellingController): self.validate_uom_is_integer("stock_uom", "qty") self.validate_for_items() self.validate_warehouse() - - from stock.doctype.packed_item.packed_item import make_packing_list + + from erpnext.stock.doctype.packed_item.packed_item import make_packing_list + self.doclist = make_packing_list(self,'sales_order_details') self.validate_with_previous_doc() @@ -119,15 +120,15 @@ class DocType(SellingController): 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"]) if not self.doc.billing_status: self.doc.billing_status = 'Not Billed' if not self.doc.delivery_status: self.doc.delivery_status = 'Not Delivered' def validate_warehouse(self): - from stock.utils import validate_warehouse_company + from erpnext.stock.utils import validate_warehouse_company warehouses = list(set([d.reserved_warehouse for d in self.doclist.get({"doctype": self.tname}) if d.reserved_warehouse])) @@ -229,7 +230,7 @@ class DocType(SellingController): def update_stock_ledger(self, update_stock): - from stock.utils import update_bin + from erpnext.stock.utils import update_bin for d in self.get_item_list(): if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes": args = { diff --git a/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt similarity index 100% rename from selling/doctype/sales_order/sales_order.txt rename to erpnext/selling/doctype/sales_order/sales_order.txt diff --git a/projects/report/daily_time_log_summary/__init__.py b/erpnext/selling/doctype/sales_order/templates/__init__.py similarity index 100% rename from projects/report/daily_time_log_summary/__init__.py rename to erpnext/selling/doctype/sales_order/templates/__init__.py diff --git a/projects/report/project_wise_stock_tracking/__init__.py b/erpnext/selling/doctype/sales_order/templates/pages/__init__.py similarity index 100% rename from projects/report/project_wise_stock_tracking/__init__.py rename to erpnext/selling/doctype/sales_order/templates/pages/__init__.py diff --git a/selling/doctype/sales_order/templates/pages/order.html b/erpnext/selling/doctype/sales_order/templates/pages/order.html similarity index 64% rename from selling/doctype/sales_order/templates/pages/order.html rename to erpnext/selling/doctype/sales_order/templates/pages/order.html index db6e009f891..45867eabdf5 100644 --- a/selling/doctype/sales_order/templates/pages/order.html +++ b/erpnext/selling/doctype/sales_order/templates/pages/order.html @@ -1,4 +1,4 @@ -{% extends "app/portal/templates/sale.html" %} +{% extends "templates/sale.html" %} {% block status -%} {% if doc.status %}{{ doc.status }}{% endif %} diff --git a/selling/doctype/sales_order/templates/pages/order.py b/erpnext/selling/doctype/sales_order/templates/pages/order.py similarity index 94% rename from selling/doctype/sales_order/templates/pages/order.py rename to erpnext/selling/doctype/sales_order/templates/pages/order.py index d53a8b0f6fa..e172c095078 100644 --- a/selling/doctype/sales_order/templates/pages/order.py +++ b/erpnext/selling/doctype/sales_order/templates/pages/order.py @@ -8,7 +8,7 @@ from webnotes import _ no_cache = True def get_context(): - from portal.utils import get_transaction_context + from erpnext.templates.utils import get_transaction_context context = get_transaction_context("Sales Order", webnotes.form_dict.name) modify_status(context.get("doc")) context.update({ diff --git a/erpnext/selling/doctype/sales_order/templates/pages/orders.html b/erpnext/selling/doctype/sales_order/templates/pages/orders.html new file mode 100644 index 00000000000..0467f34ae62 --- /dev/null +++ b/erpnext/selling/doctype/sales_order/templates/pages/orders.html @@ -0,0 +1 @@ +{% extends "templates/sales_transactions.html" %} \ No newline at end of file diff --git a/selling/doctype/sales_order/templates/pages/orders.py b/erpnext/selling/doctype/sales_order/templates/pages/orders.py similarity index 76% rename from selling/doctype/sales_order/templates/pages/orders.py rename to erpnext/selling/doctype/sales_order/templates/pages/orders.py index d7f83dc806d..5d28d5bf6da 100644 --- a/selling/doctype/sales_order/templates/pages/orders.py +++ b/erpnext/selling/doctype/sales_order/templates/pages/orders.py @@ -7,7 +7,7 @@ import webnotes no_cache = True def get_context(): - from portal.utils import get_currency_context + from erpnext.templates.utils import get_currency_context context = get_currency_context() context.update({ "title": "My Orders", @@ -20,8 +20,8 @@ def get_context(): @webnotes.whitelist() def get_orders(start=0): - from portal.utils import get_transaction_list - from selling.doctype.sales_order.templates.pages.order import modify_status + from erpnext.templates.utils import get_transaction_list + from erpnext.selling.doctype.sales_order.templates.pages.order import modify_status orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"]) for d in orders: modify_status(d) diff --git a/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py similarity index 94% rename from selling/doctype/sales_order/test_sales_order.py rename to erpnext/selling/doctype/sales_order/test_sales_order.py index 808adbafb45..68e6775b490 100644 --- a/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -10,7 +10,7 @@ class TestSalesOrder(unittest.TestCase): webnotes.set_user("Administrator") def test_make_material_request(self): - from selling.doctype.sales_order.sales_order import make_material_request + from erpnext.selling.doctype.sales_order.sales_order import make_material_request so = webnotes.bean(copy=test_records[0]).insert() @@ -25,7 +25,7 @@ class TestSalesOrder(unittest.TestCase): self.assertEquals(len(mr), len(sales_order.doclist)) def test_make_delivery_note(self): - from selling.doctype.sales_order.sales_order import make_delivery_note + from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note so = webnotes.bean(copy=test_records[0]).insert() @@ -40,7 +40,7 @@ class TestSalesOrder(unittest.TestCase): self.assertEquals(len(dn), len(sales_order.doclist)) def test_make_sales_invoice(self): - from selling.doctype.sales_order.sales_order import make_sales_invoice + from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice so = webnotes.bean(copy=test_records[0]).insert() @@ -74,8 +74,8 @@ class TestSalesOrder(unittest.TestCase): return w def create_dn_against_so(self, so, delivered_qty=0): - from stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records - from stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt + from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records + from erpnext.stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt _insert_purchase_receipt(so.doclist[1].item_code) @@ -167,7 +167,7 @@ class TestSalesOrder(unittest.TestCase): self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].reserved_warehouse, 10.0) def test_reserved_qty_for_so_with_packing_list(self): - from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records + from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records # change item in test so record test_record = test_records[0][:] @@ -194,7 +194,7 @@ class TestSalesOrder(unittest.TestCase): so.doclist[1].reserved_warehouse, 0.0) def test_reserved_qty_for_partial_delivery_with_packing_list(self): - from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records + from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records # change item in test so record @@ -244,7 +244,7 @@ class TestSalesOrder(unittest.TestCase): so.doclist[1].reserved_warehouse, 20.0) def test_reserved_qty_for_over_delivery_with_packing_list(self): - from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records + from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records # change item in test so record test_record = webnotes.copy_doclist(test_records[0]) diff --git a/selling/doctype/sales_order_item/README.md b/erpnext/selling/doctype/sales_order_item/README.md similarity index 100% rename from selling/doctype/sales_order_item/README.md rename to erpnext/selling/doctype/sales_order_item/README.md diff --git a/selling/doctype/sales_order_item/__init__.py b/erpnext/selling/doctype/sales_order_item/__init__.py similarity index 100% rename from selling/doctype/sales_order_item/__init__.py rename to erpnext/selling/doctype/sales_order_item/__init__.py diff --git a/selling/doctype/sales_order_item/sales_order_item.py b/erpnext/selling/doctype/sales_order_item/sales_order_item.py similarity index 100% rename from selling/doctype/sales_order_item/sales_order_item.py rename to erpnext/selling/doctype/sales_order_item/sales_order_item.py diff --git a/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt similarity index 100% rename from selling/doctype/sales_order_item/sales_order_item.txt rename to erpnext/selling/doctype/sales_order_item/sales_order_item.txt diff --git a/selling/doctype/sales_team/README.md b/erpnext/selling/doctype/sales_team/README.md similarity index 100% rename from selling/doctype/sales_team/README.md rename to erpnext/selling/doctype/sales_team/README.md diff --git a/selling/doctype/sales_team/__init__.py b/erpnext/selling/doctype/sales_team/__init__.py similarity index 100% rename from selling/doctype/sales_team/__init__.py rename to erpnext/selling/doctype/sales_team/__init__.py diff --git a/selling/doctype/sales_team/sales_team.py b/erpnext/selling/doctype/sales_team/sales_team.py similarity index 100% rename from selling/doctype/sales_team/sales_team.py rename to erpnext/selling/doctype/sales_team/sales_team.py diff --git a/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt similarity index 100% rename from selling/doctype/sales_team/sales_team.txt rename to erpnext/selling/doctype/sales_team/sales_team.txt diff --git a/selling/__init__.py b/erpnext/selling/doctype/selling_settings/__init__.py similarity index 100% rename from selling/__init__.py rename to erpnext/selling/doctype/selling_settings/__init__.py diff --git a/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py similarity index 88% rename from selling/doctype/selling_settings/selling_settings.py rename to erpnext/selling/doctype/selling_settings/selling_settings.py index 0895e3f7b8d..c28061932e0 100644 --- a/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -15,6 +15,6 @@ class DocType: "editable_price_list_rate", "selling_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("Customer", "customer_name", self.doc.get("cust_master_name")=="Naming Series", hide_name_field=False) diff --git a/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.txt similarity index 100% rename from selling/doctype/selling_settings/selling_settings.txt rename to erpnext/selling/doctype/selling_settings/selling_settings.txt diff --git a/selling/doctype/customer_discount/__init__.py b/erpnext/selling/doctype/shopping_cart_price_list/__init__.py similarity index 100% rename from selling/doctype/customer_discount/__init__.py rename to erpnext/selling/doctype/shopping_cart_price_list/__init__.py diff --git a/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py similarity index 100% rename from selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py rename to erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py diff --git a/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt similarity index 100% rename from selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt rename to erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt diff --git a/selling/doctype/sales_order/templates/__init__.py b/erpnext/selling/doctype/shopping_cart_settings/__init__.py similarity index 100% rename from selling/doctype/sales_order/templates/__init__.py rename to erpnext/selling/doctype/shopping_cart_settings/__init__.py diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.js b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.js similarity index 100% rename from selling/doctype/shopping_cart_settings/shopping_cart_settings.js rename to erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.js diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py similarity index 98% rename from selling/doctype/shopping_cart_settings/shopping_cart_settings.py rename to erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py index 6912ac5635f..923936e8a52 100644 --- a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -47,7 +47,7 @@ class DocType(DocListController): # validate that a Shopping Cart Price List exists for the root territory # as a catch all! - from setup.utils import get_root_of + from erpnext.setup.utils import get_root_of root_territory = get_root_of("Territory") if root_territory not in territory_name_map.keys(): @@ -143,7 +143,7 @@ class DocType(DocListController): return self.get_name_from_territory(shipping_territory, "shipping_rules", "shipping_rule") def get_territory_ancestry(self, territory): - from setup.utils import get_ancestors_of + from erpnext.setup.utils import get_ancestors_of if not hasattr(self, "_territory_ancestry"): self._territory_ancestry = {} diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt similarity index 100% rename from selling/doctype/shopping_cart_settings/shopping_cart_settings.txt rename to erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt diff --git a/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py similarity index 93% rename from selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py rename to erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py index 6055c61f394..be67f6fe83c 100644 --- a/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py +++ b/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import webnotes import unittest -from selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError +from erpnext.selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError class TestShoppingCartSettings(unittest.TestCase): def setUp(self): @@ -74,7 +74,7 @@ class TestShoppingCartSettings(unittest.TestCase): controller = cart_settings.make_controller() self.assertRaises(ShoppingCartSetupError, controller.validate_exchange_rates_exist) - from setup.doctype.currency_exchange.test_currency_exchange import test_records as \ + from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records as \ currency_exchange_records webnotes.bean(currency_exchange_records[0]).insert() controller.validate_exchange_rates_exist() diff --git a/selling/doctype/sales_order/templates/pages/__init__.py b/erpnext/selling/doctype/shopping_cart_shipping_rule/__init__.py similarity index 100% rename from selling/doctype/sales_order/templates/pages/__init__.py rename to erpnext/selling/doctype/shopping_cart_shipping_rule/__init__.py diff --git a/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py similarity index 100% rename from selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py rename to erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py diff --git a/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt similarity index 100% rename from selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt rename to erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt diff --git a/selling/doctype/selling_settings/__init__.py b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py similarity index 100% rename from selling/doctype/selling_settings/__init__.py rename to erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py diff --git a/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py similarity index 100% rename from selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py rename to erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py diff --git a/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt similarity index 100% rename from selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt rename to erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt diff --git a/selling/doctype/sms_center/README.md b/erpnext/selling/doctype/sms_center/README.md similarity index 100% rename from selling/doctype/sms_center/README.md rename to erpnext/selling/doctype/sms_center/README.md diff --git a/selling/doctype/sms_center/__init__.py b/erpnext/selling/doctype/sms_center/__init__.py similarity index 100% rename from selling/doctype/sms_center/__init__.py rename to erpnext/selling/doctype/sms_center/__init__.py diff --git a/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py similarity index 100% rename from selling/doctype/sms_center/sms_center.py rename to erpnext/selling/doctype/sms_center/sms_center.py diff --git a/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.txt similarity index 100% rename from selling/doctype/sms_center/sms_center.txt rename to erpnext/selling/doctype/sms_center/sms_center.txt diff --git a/selling/page/__init__.py b/erpnext/selling/page/__init__.py similarity index 100% rename from selling/page/__init__.py rename to erpnext/selling/page/__init__.py diff --git a/selling/page/sales_analytics/README.md b/erpnext/selling/page/sales_analytics/README.md similarity index 100% rename from selling/page/sales_analytics/README.md rename to erpnext/selling/page/sales_analytics/README.md diff --git a/selling/page/sales_analytics/__init__.py b/erpnext/selling/page/sales_analytics/__init__.py similarity index 100% rename from selling/page/sales_analytics/__init__.py rename to erpnext/selling/page/sales_analytics/__init__.py diff --git a/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js similarity index 100% rename from selling/page/sales_analytics/sales_analytics.js rename to erpnext/selling/page/sales_analytics/sales_analytics.js diff --git a/selling/page/sales_analytics/sales_analytics.txt b/erpnext/selling/page/sales_analytics/sales_analytics.txt similarity index 100% rename from selling/page/sales_analytics/sales_analytics.txt rename to erpnext/selling/page/sales_analytics/sales_analytics.txt diff --git a/selling/page/sales_browser/README.md b/erpnext/selling/page/sales_browser/README.md similarity index 100% rename from selling/page/sales_browser/README.md rename to erpnext/selling/page/sales_browser/README.md diff --git a/selling/page/sales_browser/__init__.py b/erpnext/selling/page/sales_browser/__init__.py similarity index 100% rename from selling/page/sales_browser/__init__.py rename to erpnext/selling/page/sales_browser/__init__.py diff --git a/selling/page/sales_browser/sales_browser.css b/erpnext/selling/page/sales_browser/sales_browser.css similarity index 100% rename from selling/page/sales_browser/sales_browser.css rename to erpnext/selling/page/sales_browser/sales_browser.css diff --git a/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js similarity index 95% rename from selling/page/sales_browser/sales_browser.js rename to erpnext/selling/page/sales_browser/sales_browser.js index 58a3b1f837d..1b7d9aa52aa 100644 --- a/selling/page/sales_browser/sales_browser.js +++ b/erpnext/selling/page/sales_browser/sales_browser.js @@ -22,7 +22,7 @@ pscript['onload_Sales Browser'] = function(wrapper){ wrapper.make_tree = function() { var ctype = wn.get_route()[1] || 'Territory'; return wn.call({ - method: 'selling.page.sales_browser.sales_browser.get_children', + method: 'erpnext.selling.page.sales_browser.sales_browser.get_children', args: {ctype: ctype}, callback: function(r) { var root = r.message[0]["value"]; @@ -60,7 +60,7 @@ erpnext.SalesChart = Class.extend({ parent: $(parent), label: root, args: {ctype: ctype}, - method: 'selling.page.sales_browser.sales_browser.get_children', + method: 'erpnext.selling.page.sales_browser.sales_browser.get_children', click: function(link) { if(me.cur_toolbar) $(me.cur_toolbar).toggle(false); @@ -144,7 +144,7 @@ erpnext.SalesChart = Class.extend({ v.ctype = me.ctype; return wn.call({ - method: 'selling.page.sales_browser.sales_browser.add_node', + method: 'erpnext.selling.page.sales_browser.sales_browser.add_node', args: v, callback: function() { $(btn).done_working(); diff --git a/selling/page/sales_browser/sales_browser.py b/erpnext/selling/page/sales_browser/sales_browser.py similarity index 100% rename from selling/page/sales_browser/sales_browser.py rename to erpnext/selling/page/sales_browser/sales_browser.py diff --git a/selling/page/sales_browser/sales_browser.txt b/erpnext/selling/page/sales_browser/sales_browser.txt similarity index 100% rename from selling/page/sales_browser/sales_browser.txt rename to erpnext/selling/page/sales_browser/sales_browser.txt diff --git a/selling/doctype/shopping_cart_price_list/__init__.py b/erpnext/selling/page/sales_funnel/__init__.py similarity index 100% rename from selling/doctype/shopping_cart_price_list/__init__.py rename to erpnext/selling/page/sales_funnel/__init__.py diff --git a/selling/page/sales_funnel/sales_funnel.css b/erpnext/selling/page/sales_funnel/sales_funnel.css similarity index 100% rename from selling/page/sales_funnel/sales_funnel.css rename to erpnext/selling/page/sales_funnel/sales_funnel.css diff --git a/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js similarity index 100% rename from selling/page/sales_funnel/sales_funnel.js rename to erpnext/selling/page/sales_funnel/sales_funnel.js diff --git a/selling/page/sales_funnel/sales_funnel.py b/erpnext/selling/page/sales_funnel/sales_funnel.py similarity index 100% rename from selling/page/sales_funnel/sales_funnel.py rename to erpnext/selling/page/sales_funnel/sales_funnel.py diff --git a/selling/page/sales_funnel/sales_funnel.txt b/erpnext/selling/page/sales_funnel/sales_funnel.txt similarity index 100% rename from selling/page/sales_funnel/sales_funnel.txt rename to erpnext/selling/page/sales_funnel/sales_funnel.txt diff --git a/selling/page/selling_home/__init__.py b/erpnext/selling/page/selling_home/__init__.py similarity index 100% rename from selling/page/selling_home/__init__.py rename to erpnext/selling/page/selling_home/__init__.py diff --git a/selling/page/selling_home/selling_home.js b/erpnext/selling/page/selling_home/selling_home.js similarity index 100% rename from selling/page/selling_home/selling_home.js rename to erpnext/selling/page/selling_home/selling_home.js diff --git a/selling/page/selling_home/selling_home.txt b/erpnext/selling/page/selling_home/selling_home.txt similarity index 100% rename from selling/page/selling_home/selling_home.txt rename to erpnext/selling/page/selling_home/selling_home.txt diff --git a/selling/doctype/shopping_cart_settings/__init__.py b/erpnext/selling/report/__init__.py similarity index 100% rename from selling/doctype/shopping_cart_settings/__init__.py rename to erpnext/selling/report/__init__.py diff --git a/selling/doctype/shopping_cart_shipping_rule/__init__.py b/erpnext/selling/report/available_stock_for_packing_items/__init__.py similarity index 100% rename from selling/doctype/shopping_cart_shipping_rule/__init__.py rename to erpnext/selling/report/available_stock_for_packing_items/__init__.py diff --git a/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py similarity index 100% rename from selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py rename to erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py diff --git a/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt similarity index 100% rename from selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt rename to erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt diff --git a/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py b/erpnext/selling/report/customer_acquisition_and_loyalty/__init__.py similarity index 100% rename from selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py rename to erpnext/selling/report/customer_acquisition_and_loyalty/__init__.py diff --git a/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js similarity index 100% rename from selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js rename to erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js diff --git a/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py similarity index 100% rename from selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py rename to erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py diff --git a/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt similarity index 100% rename from selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt rename to erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt diff --git a/selling/page/sales_funnel/__init__.py b/erpnext/selling/report/customer_addresses_and_contacts/__init__.py similarity index 100% rename from selling/page/sales_funnel/__init__.py rename to erpnext/selling/report/customer_addresses_and_contacts/__init__.py diff --git a/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt similarity index 100% rename from selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt rename to erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt diff --git a/selling/report/__init__.py b/erpnext/selling/report/customers_not_buying_since_long_time/__init__.py similarity index 100% rename from selling/report/__init__.py rename to erpnext/selling/report/customers_not_buying_since_long_time/__init__.py diff --git a/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.js b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.js similarity index 100% rename from selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.js rename to erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.js diff --git a/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py similarity index 100% rename from selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py rename to erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py diff --git a/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt similarity index 100% rename from selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt rename to erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt diff --git a/selling/report/available_stock_for_packing_items/__init__.py b/erpnext/selling/report/item_wise_sales_history/__init__.py similarity index 100% rename from selling/report/available_stock_for_packing_items/__init__.py rename to erpnext/selling/report/item_wise_sales_history/__init__.py diff --git a/selling/report/item_wise_sales_history/item_wise_sales_history.txt b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt similarity index 100% rename from selling/report/item_wise_sales_history/item_wise_sales_history.txt rename to erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt diff --git a/selling/report/customer_acquisition_and_loyalty/__init__.py b/erpnext/selling/report/lead_details/__init__.py similarity index 100% rename from selling/report/customer_acquisition_and_loyalty/__init__.py rename to erpnext/selling/report/lead_details/__init__.py diff --git a/selling/report/lead_details/lead_details.txt b/erpnext/selling/report/lead_details/lead_details.txt similarity index 100% rename from selling/report/lead_details/lead_details.txt rename to erpnext/selling/report/lead_details/lead_details.txt diff --git a/selling/report/customer_addresses_and_contacts/__init__.py b/erpnext/selling/report/pending_so_items_for_purchase_request/__init__.py similarity index 100% rename from selling/report/customer_addresses_and_contacts/__init__.py rename to erpnext/selling/report/pending_so_items_for_purchase_request/__init__.py diff --git a/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt similarity index 100% rename from selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt rename to erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt diff --git a/selling/report/customers_not_buying_since_long_time/__init__.py b/erpnext/selling/report/quotation_trends/__init__.py similarity index 100% rename from selling/report/customers_not_buying_since_long_time/__init__.py rename to erpnext/selling/report/quotation_trends/__init__.py diff --git a/selling/report/quotation_trends/quotation_trends.js b/erpnext/selling/report/quotation_trends/quotation_trends.js similarity index 77% rename from selling/report/quotation_trends/quotation_trends.js rename to erpnext/selling/report/quotation_trends/quotation_trends.js index f26e873497f..59f8b469a29 100644 --- a/selling/report/quotation_trends/quotation_trends.js +++ b/erpnext/selling/report/quotation_trends/quotation_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Quotation Trends"] = { filters: get_filters() diff --git a/selling/report/quotation_trends/quotation_trends.py b/erpnext/selling/report/quotation_trends/quotation_trends.py similarity index 86% rename from selling/report/quotation_trends/quotation_trends.py rename to erpnext/selling/report/quotation_trends/quotation_trends.py index f7c023f10fc..ea0d3db8f6e 100644 --- a/selling/report/quotation_trends/quotation_trends.py +++ b/erpnext/selling/report/quotation_trends/quotation_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/selling/report/quotation_trends/quotation_trends.txt b/erpnext/selling/report/quotation_trends/quotation_trends.txt similarity index 100% rename from selling/report/quotation_trends/quotation_trends.txt rename to erpnext/selling/report/quotation_trends/quotation_trends.txt diff --git a/selling/report/item_wise_sales_history/__init__.py b/erpnext/selling/report/sales_order_trends/__init__.py similarity index 100% rename from selling/report/item_wise_sales_history/__init__.py rename to erpnext/selling/report/sales_order_trends/__init__.py diff --git a/selling/report/sales_order_trends/sales_order_trends.js b/erpnext/selling/report/sales_order_trends/sales_order_trends.js similarity index 78% rename from selling/report/sales_order_trends/sales_order_trends.js rename to erpnext/selling/report/sales_order_trends/sales_order_trends.js index 62684009ecd..6ff31a21d66 100644 --- a/selling/report/sales_order_trends/sales_order_trends.js +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Sales Order Trends"] = { filters: get_filters() diff --git a/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py similarity index 86% rename from selling/report/sales_order_trends/sales_order_trends.py rename to erpnext/selling/report/sales_order_trends/sales_order_trends.py index d407be09dac..e9354e61848 100644 --- a/selling/report/sales_order_trends/sales_order_trends.py +++ b/erpnext/selling/report/sales_order_trends/sales_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/selling/report/sales_order_trends/sales_order_trends.txt b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt similarity index 100% rename from selling/report/sales_order_trends/sales_order_trends.txt rename to erpnext/selling/report/sales_order_trends/sales_order_trends.txt diff --git a/selling/report/lead_details/__init__.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/__init__.py similarity index 100% rename from selling/report/lead_details/__init__.py rename to erpnext/selling/report/sales_person_target_variance_item_group_wise/__init__.py diff --git a/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.js b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.js similarity index 100% rename from selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.js rename to erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.js diff --git a/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py similarity index 97% rename from selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py rename to erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py index ca189366d42..3e500dc0e3b 100644 --- a/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.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 from webnotes.model.meta import get_field_precision def execute(filters=None): diff --git a/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt similarity index 100% rename from selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt rename to erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt diff --git a/selling/report/pending_so_items_for_purchase_request/__init__.py b/erpnext/selling/report/sales_person_wise_transaction_summary/__init__.py similarity index 100% rename from selling/report/pending_so_items_for_purchase_request/__init__.py rename to erpnext/selling/report/sales_person_wise_transaction_summary/__init__.py diff --git a/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js similarity index 100% rename from selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js rename to erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js diff --git a/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py similarity index 100% rename from selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py rename to erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py diff --git a/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt similarity index 100% rename from selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt rename to erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt diff --git a/selling/report/quotation_trends/__init__.py b/erpnext/selling/report/territory_target_variance_item_group_wise/__init__.py similarity index 100% rename from selling/report/quotation_trends/__init__.py rename to erpnext/selling/report/territory_target_variance_item_group_wise/__init__.py diff --git a/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.js b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.js similarity index 100% rename from selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.js rename to erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.js diff --git a/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py similarity index 97% rename from selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py rename to erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py index 08240a7806e..d55e21016b3 100644 --- a/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py +++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.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/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt similarity index 100% rename from selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt rename to erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt diff --git a/selling/sales_common.js b/erpnext/selling/sales_common.js similarity index 98% rename from selling/sales_common.js rename to erpnext/selling/sales_common.js index dddc2b568db..1c8aed35533 100644 --- a/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -5,12 +5,12 @@ // ------ // cur_frm.cscript.tname - Details table name // cur_frm.cscript.fname - Details fieldname -// cur_frm.cscript.other_fname - wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); fieldname +// cur_frm.cscript.other_fname - fieldname // cur_frm.cscript.sales_team_fname - Sales Team fieldname wn.provide("erpnext.selling"); -wn.require("app/js/transaction.js"); -wn.require("app/js/controllers/accounts.js"); +wn.require("assets/erpnext/js/transaction.js"); +{% include "public/js/controllers/accounts.js" %} erpnext.selling.SellingController = erpnext.TransactionController.extend({ onload: function() { @@ -59,7 +59,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ if(this.frm.fields_dict[this.fname].grid.get_field('item_code')) { this.frm.set_query("item_code", this.fname, function() { return { - query: "controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters: (me.frm.doc.order_type === "Maintenance" ? {'is_service_item': 'Yes'}: {'is_sales_item': 'Yes' }) @@ -158,7 +158,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove(); } else { return this.frm.call({ - method: "selling.utils.get_item_details", + method: "erpnext.selling.utils.get_item_details", child: item, args: { args: { @@ -268,7 +268,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var item = wn.model.get_doc(cdt, cdn); if(item.item_code && item.warehouse) { return this.frm.call({ - method: "selling.utils.get_available_qty", + method: "erpnext.selling.utils.get_available_qty", child: item, args: { item_code: item.item_code, diff --git a/selling/utils/__init__.py b/erpnext/selling/utils/__init__.py similarity index 98% rename from selling/utils/__init__.py rename to erpnext/selling/utils/__init__.py index 5974da7d8bc..c73d76ea468 100644 --- a/selling/utils/__init__.py +++ b/erpnext/selling/utils/__init__.py @@ -105,7 +105,7 @@ def _get_item_code(barcode=None, serial_no=None): return item_code[0] 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 sales item or service item @@ -154,7 +154,7 @@ def _get_price_list_rate(args, item_bean, meta): return {} # found price list rate - now we can validate - from utilities.transaction_base import validate_currency + from erpnext.utilities.transaction_base import validate_currency validate_currency(args, item_bean.doc, meta) return {"ref_rate": flt(ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)} diff --git a/selling/utils/cart.py b/erpnext/selling/utils/cart.py similarity index 98% rename from selling/utils/cart.py rename to erpnext/selling/utils/cart.py index 3cd7b3c9f17..f23a5716a2c 100644 --- a/selling/utils/cart.py +++ b/erpnext/selling/utils/cart.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import webnotes +import webnotes, json from webnotes import msgprint, _ import webnotes.defaults from webnotes.utils import flt, get_fullname, fmt_money, cstr @@ -42,7 +42,7 @@ def place_order(): quotation.ignore_permissions = True quotation.submit() - from selling.doctype.quotation.quotation import _make_sales_order + from erpnext.selling.doctype.quotation.quotation import _make_sales_order sales_order = webnotes.bean(_make_sales_order(quotation.doc.name, ignore_permissions=True)) sales_order.ignore_permissions = True sales_order.insert() @@ -92,7 +92,7 @@ def update_cart(item_code, qty, with_doclist=0): @webnotes.whitelist() def update_cart_address(address_fieldname, address_name): - from utilities.transaction_base import get_address_display + from erpnext.utilities.transaction_base import get_address_display quotation = _get_cart_quotation() address_display = get_address_display(webnotes.doc("Address", address_name).fields) @@ -123,7 +123,7 @@ def get_addresses(): @webnotes.whitelist() def save_address(fields, address_fieldname=None): party = get_lead_or_customer() - fields = webnotes.load_json(fields) + fields = json.loads(fields) if fields.get("name"): bean = webnotes.bean("Address", fields.get("name")) @@ -147,7 +147,7 @@ def save_address(fields, address_fieldname=None): def get_address_docs(party=None): from webnotes.model.doclist import objectify - from utilities.transaction_base import get_address_display + from erpnext.utilities.transaction_base import get_address_display if not party: party = get_lead_or_customer() diff --git a/selling/utils/product.py b/erpnext/selling/utils/product.py similarity index 93% rename from selling/utils/product.py rename to erpnext/selling/utils/product.py index 32ff85ad120..dda56e52e16 100644 --- a/selling/utils/product.py +++ b/erpnext/selling/utils/product.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, cint, fmt_money, get_base_path from webnotes.webutils import delete_page_cache -from selling.utils.cart import _get_cart_quotation +from erpnext.selling.utils.cart import _get_cart_quotation @webnotes.whitelist(allow_guest=True) def get_product_info(item_code): @@ -107,11 +107,7 @@ def get_group_item_count(item_group): where item_group in (%s))) """ % (child_groups, child_groups))[0][0] def get_item_for_list_in_html(context): - from jinja2 import Environment, FileSystemLoader - scrub_item_for_list(context) - jenv = Environment(loader = FileSystemLoader(get_base_path())) - template = jenv.get_template("app/stock/doctype/item/templates/includes/product_in_grid.html") - return template.render(context) + return webnotes.get_template("templates/includes/product_in_grid.html").render(context) def scrub_item_for_list(r): if not r.website_description: diff --git a/selling/report/sales_order_trends/__init__.py b/erpnext/setup/__init__.py similarity index 100% rename from selling/report/sales_order_trends/__init__.py rename to erpnext/setup/__init__.py diff --git a/setup/doctype/__init__.py b/erpnext/setup/doctype/__init__.py similarity index 100% rename from setup/doctype/__init__.py rename to erpnext/setup/doctype/__init__.py diff --git a/selling/report/sales_person_target_variance_item_group_wise/__init__.py b/erpnext/setup/doctype/applicable_territory/__init__.py similarity index 100% rename from selling/report/sales_person_target_variance_item_group_wise/__init__.py rename to erpnext/setup/doctype/applicable_territory/__init__.py diff --git a/setup/doctype/applicable_territory/applicable_territory.py b/erpnext/setup/doctype/applicable_territory/applicable_territory.py similarity index 100% rename from setup/doctype/applicable_territory/applicable_territory.py rename to erpnext/setup/doctype/applicable_territory/applicable_territory.py diff --git a/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt similarity index 100% rename from setup/doctype/applicable_territory/applicable_territory.txt rename to erpnext/setup/doctype/applicable_territory/applicable_territory.txt diff --git a/setup/doctype/authorization_control/README.md b/erpnext/setup/doctype/authorization_control/README.md similarity index 100% rename from setup/doctype/authorization_control/README.md rename to erpnext/setup/doctype/authorization_control/README.md diff --git a/setup/doctype/authorization_control/__init__.py b/erpnext/setup/doctype/authorization_control/__init__.py similarity index 100% rename from setup/doctype/authorization_control/__init__.py rename to erpnext/setup/doctype/authorization_control/__init__.py diff --git a/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py similarity index 98% rename from setup/doctype/authorization_control/authorization_control.py rename to erpnext/setup/doctype/authorization_control/authorization_control.py index 8c8900a52e3..6df09150b8a 100644 --- a/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -7,10 +7,10 @@ import webnotes from webnotes.utils import cstr, flt, has_common, make_esc from webnotes.model.bean import getlist from webnotes import session, 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, d, dl): diff --git a/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.txt similarity index 100% rename from setup/doctype/authorization_control/authorization_control.txt rename to erpnext/setup/doctype/authorization_control/authorization_control.txt diff --git a/setup/doctype/authorization_rule/README.md b/erpnext/setup/doctype/authorization_rule/README.md similarity index 100% rename from setup/doctype/authorization_rule/README.md rename to erpnext/setup/doctype/authorization_rule/README.md diff --git a/setup/doctype/authorization_rule/__init__.py b/erpnext/setup/doctype/authorization_rule/__init__.py similarity index 100% rename from setup/doctype/authorization_rule/__init__.py rename to erpnext/setup/doctype/authorization_rule/__init__.py diff --git a/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js similarity index 96% rename from setup/doctype/authorization_rule/authorization_rule.js rename to erpnext/setup/doctype/authorization_rule/authorization_rule.js index cdf8ef0ec98..bd42618c536 100644 --- a/setup/doctype/authorization_rule/authorization_rule.js +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js @@ -100,7 +100,7 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){ else if(doc.based_on == 'Itemwise Discount') return { doctype: "Item", - query: "controllers.queries.item_query" + query: "erpnext.controllers.queries.item_query" } else return { @@ -111,4 +111,4 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){ } cur_frm.fields_dict.to_emp.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.employee_query" } } \ No newline at end of file + return{ query: "erpnext.controllers.queries.employee_query" } } \ No newline at end of file diff --git a/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py similarity index 100% rename from setup/doctype/authorization_rule/authorization_rule.py rename to erpnext/setup/doctype/authorization_rule/authorization_rule.py diff --git a/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt similarity index 100% rename from setup/doctype/authorization_rule/authorization_rule.txt rename to erpnext/setup/doctype/authorization_rule/authorization_rule.txt diff --git a/setup/doctype/backup_manager/README.md b/erpnext/setup/doctype/backup_manager/README.md similarity index 100% rename from setup/doctype/backup_manager/README.md rename to erpnext/setup/doctype/backup_manager/README.md diff --git a/selling/report/sales_person_wise_transaction_summary/__init__.py b/erpnext/setup/doctype/backup_manager/__init__.py similarity index 100% rename from selling/report/sales_person_wise_transaction_summary/__init__.py rename to erpnext/setup/doctype/backup_manager/__init__.py diff --git a/setup/doctype/backup_manager/backup_dropbox.py b/erpnext/setup/doctype/backup_manager/backup_dropbox.py similarity index 99% rename from setup/doctype/backup_manager/backup_dropbox.py rename to erpnext/setup/doctype/backup_manager/backup_dropbox.py index 1583f7ebd65..9c1decf27ac 100644 --- a/setup/doctype/backup_manager/backup_dropbox.py +++ b/erpnext/setup/doctype/backup_manager/backup_dropbox.py @@ -110,7 +110,7 @@ def backup_to_dropbox(): upload_file_to_dropbox(filepath, "/files", dropbox_client) except Exception: did_not_upload.append(filename) - error_log.append(webnotes.getTraceback()) + error_log.append(webnotes.get_traceback()) webnotes.connect() return did_not_upload, list(set(error_log)) diff --git a/setup/doctype/backup_manager/backup_googledrive.py b/erpnext/setup/doctype/backup_manager/backup_googledrive.py similarity index 100% rename from setup/doctype/backup_manager/backup_googledrive.py rename to erpnext/setup/doctype/backup_manager/backup_googledrive.py diff --git a/setup/doctype/backup_manager/backup_manager.js b/erpnext/setup/doctype/backup_manager/backup_manager.js similarity index 89% rename from setup/doctype/backup_manager/backup_manager.js rename to erpnext/setup/doctype/backup_manager/backup_manager.js index 6fdb9e4f625..dfe6bd56614 100644 --- a/setup/doctype/backup_manager/backup_manager.js +++ b/erpnext/setup/doctype/backup_manager/backup_manager.js @@ -47,7 +47,7 @@ $.extend(cur_frm.cscript, { allow_dropbox_access: function() { if(cur_frm.cscript.validate_send_notifications_to()) { return wn.call({ - method: "setup.doctype.backup_manager.backup_dropbox.get_dropbox_authorize_url", + method: "erpnext.setup.doctype.backup_manager.backup_dropbox.get_dropbox_authorize_url", callback: function(r) { if(!r.exc) { cur_frm.set_value("dropbox_access_secret", r.message.secret); @@ -64,7 +64,7 @@ $.extend(cur_frm.cscript, { allow_gdrive_access: function() { if(cur_frm.cscript.validate_send_notifications_to()) { return wn.call({ - method: "setup.doctype.backup_manager.backup_googledrive.get_gdrive_authorize_url", + method: "erpnext.setup.doctype.backup_manager.backup_googledrive.get_gdrive_authorize_url", callback: function(r) { if(!r.exc) { window.open(r.message.authorize_url); @@ -76,7 +76,7 @@ $.extend(cur_frm.cscript, { validate_gdrive: function() { return wn.call({ - method: "setup.doctype.backup_manager.backup_googledrive.gdrive_callback", + method: "erpnext.setup.doctype.backup_manager.backup_googledrive.gdrive_callback", args: { verification_code: cur_frm.doc.verification_code }, diff --git a/setup/doctype/backup_manager/backup_manager.py b/erpnext/setup/doctype/backup_manager/backup_manager.py similarity index 92% rename from setup/doctype/backup_manager/backup_manager.py rename to erpnext/setup/doctype/backup_manager/backup_manager.py index b09446485eb..b6a5ace57e7 100644 --- a/setup/doctype/backup_manager/backup_manager.py +++ b/erpnext/setup/doctype/backup_manager/backup_manager.py @@ -28,14 +28,14 @@ def take_backups_if(freq): def take_backups_dropbox(): did_not_upload, error_log = [], [] try: - from setup.doctype.backup_manager.backup_dropbox import backup_to_dropbox + from erpnext.setup.doctype.backup_manager.backup_dropbox import backup_to_dropbox did_not_upload, error_log = backup_to_dropbox() if did_not_upload: raise Exception send_email(True, "Dropbox") except Exception: file_and_error = [" - ".join(f) for f in zip(did_not_upload, error_log)] - error_message = ("\n".join(file_and_error) + "\n" + webnotes.getTraceback()) + error_message = ("\n".join(file_and_error) + "\n" + webnotes.get_traceback()) webnotes.errprint(error_message) send_email(False, "Dropbox", error_message) @@ -44,14 +44,14 @@ def take_backups_dropbox(): def take_backups_gdrive(): did_not_upload, error_log = [], [] try: - from setup.doctype.backup_manager.backup_googledrive import backup_to_gdrive + from erpnext.setup.doctype.backup_manager.backup_googledrive import backup_to_gdrive did_not_upload, error_log = backup_to_gdrive() if did_not_upload: raise Exception send_email(True, "Google Drive") except Exception: file_and_error = [" - ".join(f) for f in zip(did_not_upload, error_log)] - error_message = ("\n".join(file_and_error) + "\n" + webnotes.getTraceback()) + error_message = ("\n".join(file_and_error) + "\n" + webnotes.get_traceback()) webnotes.errprint(error_message) send_email(False, "Google Drive", error_message) diff --git a/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.txt similarity index 100% rename from setup/doctype/backup_manager/backup_manager.txt rename to erpnext/setup/doctype/backup_manager/backup_manager.txt diff --git a/setup/doctype/brand/README.md b/erpnext/setup/doctype/brand/README.md similarity index 100% rename from setup/doctype/brand/README.md rename to erpnext/setup/doctype/brand/README.md diff --git a/setup/doctype/brand/__init__.py b/erpnext/setup/doctype/brand/__init__.py similarity index 100% rename from setup/doctype/brand/__init__.py rename to erpnext/setup/doctype/brand/__init__.py diff --git a/setup/doctype/brand/brand.js b/erpnext/setup/doctype/brand/brand.js similarity index 100% rename from setup/doctype/brand/brand.js rename to erpnext/setup/doctype/brand/brand.js diff --git a/setup/doctype/brand/brand.py b/erpnext/setup/doctype/brand/brand.py similarity index 100% rename from setup/doctype/brand/brand.py rename to erpnext/setup/doctype/brand/brand.py diff --git a/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.txt similarity index 100% rename from setup/doctype/brand/brand.txt rename to erpnext/setup/doctype/brand/brand.txt diff --git a/setup/doctype/brand/test_brand.py b/erpnext/setup/doctype/brand/test_brand.py similarity index 100% rename from setup/doctype/brand/test_brand.py rename to erpnext/setup/doctype/brand/test_brand.py diff --git a/setup/doctype/company/README.md b/erpnext/setup/doctype/company/README.md similarity index 100% rename from setup/doctype/company/README.md rename to erpnext/setup/doctype/company/README.md diff --git a/setup/doctype/company/__init__.py b/erpnext/setup/doctype/company/__init__.py similarity index 100% rename from setup/doctype/company/__init__.py rename to erpnext/setup/doctype/company/__init__.py diff --git a/selling/report/territory_target_variance_item_group_wise/__init__.py b/erpnext/setup/doctype/company/charts/__init__.py similarity index 100% rename from selling/report/territory_target_variance_item_group_wise/__init__.py rename to erpnext/setup/doctype/company/charts/__init__.py diff --git a/setup/doctype/company/charts/ar_ar_chart_template.json b/erpnext/setup/doctype/company/charts/ar_ar_chart_template.json similarity index 100% rename from setup/doctype/company/charts/ar_ar_chart_template.json rename to erpnext/setup/doctype/company/charts/ar_ar_chart_template.json diff --git a/setup/doctype/company/charts/at_austria_chart_template.json b/erpnext/setup/doctype/company/charts/at_austria_chart_template.json similarity index 100% rename from setup/doctype/company/charts/at_austria_chart_template.json rename to erpnext/setup/doctype/company/charts/at_austria_chart_template.json diff --git a/setup/doctype/company/charts/be_l10nbe_chart_template.json b/erpnext/setup/doctype/company/charts/be_l10nbe_chart_template.json similarity index 100% rename from setup/doctype/company/charts/be_l10nbe_chart_template.json rename to erpnext/setup/doctype/company/charts/be_l10nbe_chart_template.json diff --git a/setup/doctype/company/charts/bo_bo_chart_template.json b/erpnext/setup/doctype/company/charts/bo_bo_chart_template.json similarity index 100% rename from setup/doctype/company/charts/bo_bo_chart_template.json rename to erpnext/setup/doctype/company/charts/bo_bo_chart_template.json diff --git a/setup/doctype/company/charts/ca_ca_en_chart_template_en.json b/erpnext/setup/doctype/company/charts/ca_ca_en_chart_template_en.json similarity index 100% rename from setup/doctype/company/charts/ca_ca_en_chart_template_en.json rename to erpnext/setup/doctype/company/charts/ca_ca_en_chart_template_en.json diff --git a/setup/doctype/company/charts/ca_ca_fr_chart_template_fr.json b/erpnext/setup/doctype/company/charts/ca_ca_fr_chart_template_fr.json similarity index 100% rename from setup/doctype/company/charts/ca_ca_fr_chart_template_fr.json rename to erpnext/setup/doctype/company/charts/ca_ca_fr_chart_template_fr.json diff --git a/setup/doctype/company/charts/cl_cl_chart_template.json b/erpnext/setup/doctype/company/charts/cl_cl_chart_template.json similarity index 100% rename from setup/doctype/company/charts/cl_cl_chart_template.json rename to erpnext/setup/doctype/company/charts/cl_cl_chart_template.json diff --git a/setup/doctype/company/charts/cn_l10n_chart_china.json b/erpnext/setup/doctype/company/charts/cn_l10n_chart_china.json similarity index 100% rename from setup/doctype/company/charts/cn_l10n_chart_china.json rename to erpnext/setup/doctype/company/charts/cn_l10n_chart_china.json diff --git a/setup/doctype/company/charts/de_l10n_chart_de_skr04.json b/erpnext/setup/doctype/company/charts/de_l10n_chart_de_skr04.json similarity index 100% rename from setup/doctype/company/charts/de_l10n_chart_de_skr04.json rename to erpnext/setup/doctype/company/charts/de_l10n_chart_de_skr04.json diff --git a/setup/doctype/company/charts/de_l10n_de_chart_template.json b/erpnext/setup/doctype/company/charts/de_l10n_de_chart_template.json similarity index 100% rename from setup/doctype/company/charts/de_l10n_de_chart_template.json rename to erpnext/setup/doctype/company/charts/de_l10n_de_chart_template.json diff --git a/setup/doctype/company/charts/ec_ec_chart_template.json b/erpnext/setup/doctype/company/charts/ec_ec_chart_template.json similarity index 100% rename from setup/doctype/company/charts/ec_ec_chart_template.json rename to erpnext/setup/doctype/company/charts/ec_ec_chart_template.json diff --git a/setup/doctype/company/charts/es_l10nES_chart_template.json b/erpnext/setup/doctype/company/charts/es_l10nES_chart_template.json similarity index 100% rename from setup/doctype/company/charts/es_l10nES_chart_template.json rename to erpnext/setup/doctype/company/charts/es_l10nES_chart_template.json diff --git a/setup/doctype/company/charts/es_l10nES_chart_template_assoc.json b/erpnext/setup/doctype/company/charts/es_l10nES_chart_template_assoc.json similarity index 100% rename from setup/doctype/company/charts/es_l10nES_chart_template_assoc.json rename to erpnext/setup/doctype/company/charts/es_l10nES_chart_template_assoc.json diff --git a/setup/doctype/company/charts/es_l10nES_chart_template_pymes.json b/erpnext/setup/doctype/company/charts/es_l10nES_chart_template_pymes.json similarity index 100% rename from setup/doctype/company/charts/es_l10nES_chart_template_pymes.json rename to erpnext/setup/doctype/company/charts/es_l10nES_chart_template_pymes.json diff --git a/setup/doctype/company/charts/fr_l10n_fr_pcg_chart_template.json b/erpnext/setup/doctype/company/charts/fr_l10n_fr_pcg_chart_template.json similarity index 100% rename from setup/doctype/company/charts/fr_l10n_fr_pcg_chart_template.json rename to erpnext/setup/doctype/company/charts/fr_l10n_fr_pcg_chart_template.json diff --git a/setup/doctype/company/charts/gr_l10n_gr_chart_template.json b/erpnext/setup/doctype/company/charts/gr_l10n_gr_chart_template.json similarity index 100% rename from setup/doctype/company/charts/gr_l10n_gr_chart_template.json rename to erpnext/setup/doctype/company/charts/gr_l10n_gr_chart_template.json diff --git a/setup/doctype/company/charts/hn_cuentas_plantilla.json b/erpnext/setup/doctype/company/charts/hn_cuentas_plantilla.json similarity index 100% rename from setup/doctype/company/charts/hn_cuentas_plantilla.json rename to erpnext/setup/doctype/company/charts/hn_cuentas_plantilla.json diff --git a/setup/doctype/company/charts/import_from_openerp.py b/erpnext/setup/doctype/company/charts/import_from_openerp.py similarity index 100% rename from setup/doctype/company/charts/import_from_openerp.py rename to erpnext/setup/doctype/company/charts/import_from_openerp.py diff --git a/setup/doctype/company/charts/in_indian_chart_template_private.json b/erpnext/setup/doctype/company/charts/in_indian_chart_template_private.json similarity index 100% rename from setup/doctype/company/charts/in_indian_chart_template_private.json rename to erpnext/setup/doctype/company/charts/in_indian_chart_template_private.json diff --git a/setup/doctype/company/charts/in_indian_chart_template_public.json b/erpnext/setup/doctype/company/charts/in_indian_chart_template_public.json similarity index 100% rename from setup/doctype/company/charts/in_indian_chart_template_public.json rename to erpnext/setup/doctype/company/charts/in_indian_chart_template_public.json diff --git a/setup/doctype/company/charts/it_l10n_it_chart_template_generic.json b/erpnext/setup/doctype/company/charts/it_l10n_it_chart_template_generic.json similarity index 100% rename from setup/doctype/company/charts/it_l10n_it_chart_template_generic.json rename to erpnext/setup/doctype/company/charts/it_l10n_it_chart_template_generic.json diff --git a/setup/doctype/company/charts/lu_lu_2011_chart_1.json b/erpnext/setup/doctype/company/charts/lu_lu_2011_chart_1.json similarity index 100% rename from setup/doctype/company/charts/lu_lu_2011_chart_1.json rename to erpnext/setup/doctype/company/charts/lu_lu_2011_chart_1.json diff --git a/setup/doctype/company/charts/ma_l10n_kzc_temp_chart.json b/erpnext/setup/doctype/company/charts/ma_l10n_kzc_temp_chart.json similarity index 100% rename from setup/doctype/company/charts/ma_l10n_kzc_temp_chart.json rename to erpnext/setup/doctype/company/charts/ma_l10n_kzc_temp_chart.json diff --git a/setup/doctype/company/charts/nl_l10nnl_chart_template.json b/erpnext/setup/doctype/company/charts/nl_l10nnl_chart_template.json similarity index 100% rename from setup/doctype/company/charts/nl_l10nnl_chart_template.json rename to erpnext/setup/doctype/company/charts/nl_l10nnl_chart_template.json diff --git a/setup/doctype/company/charts/pa_l10npa_chart_template.json b/erpnext/setup/doctype/company/charts/pa_l10npa_chart_template.json similarity index 100% rename from setup/doctype/company/charts/pa_l10npa_chart_template.json rename to erpnext/setup/doctype/company/charts/pa_l10npa_chart_template.json diff --git a/setup/doctype/company/charts/pe_pe_chart_template.json b/erpnext/setup/doctype/company/charts/pe_pe_chart_template.json similarity index 100% rename from setup/doctype/company/charts/pe_pe_chart_template.json rename to erpnext/setup/doctype/company/charts/pe_pe_chart_template.json diff --git a/setup/doctype/company/charts/pl_pl_chart_template.json b/erpnext/setup/doctype/company/charts/pl_pl_chart_template.json similarity index 100% rename from setup/doctype/company/charts/pl_pl_chart_template.json rename to erpnext/setup/doctype/company/charts/pl_pl_chart_template.json diff --git a/setup/doctype/company/charts/pt_pt_chart_template.json b/erpnext/setup/doctype/company/charts/pt_pt_chart_template.json similarity index 100% rename from setup/doctype/company/charts/pt_pt_chart_template.json rename to erpnext/setup/doctype/company/charts/pt_pt_chart_template.json diff --git a/setup/doctype/company/charts/ro_romania_chart_template.json b/erpnext/setup/doctype/company/charts/ro_romania_chart_template.json similarity index 100% rename from setup/doctype/company/charts/ro_romania_chart_template.json rename to erpnext/setup/doctype/company/charts/ro_romania_chart_template.json diff --git a/setup/doctype/company/charts/syscohada_syscohada_chart_template.json b/erpnext/setup/doctype/company/charts/syscohada_syscohada_chart_template.json similarity index 100% rename from setup/doctype/company/charts/syscohada_syscohada_chart_template.json rename to erpnext/setup/doctype/company/charts/syscohada_syscohada_chart_template.json diff --git a/setup/doctype/company/charts/th_chart.json b/erpnext/setup/doctype/company/charts/th_chart.json similarity index 100% rename from setup/doctype/company/charts/th_chart.json rename to erpnext/setup/doctype/company/charts/th_chart.json diff --git a/setup/doctype/company/charts/tr_l10ntr_tek_duzen_hesap.json b/erpnext/setup/doctype/company/charts/tr_l10ntr_tek_duzen_hesap.json similarity index 100% rename from setup/doctype/company/charts/tr_l10ntr_tek_duzen_hesap.json rename to erpnext/setup/doctype/company/charts/tr_l10ntr_tek_duzen_hesap.json diff --git a/setup/doctype/company/charts/us_account_chart_template_basic.json b/erpnext/setup/doctype/company/charts/us_account_chart_template_basic.json similarity index 100% rename from setup/doctype/company/charts/us_account_chart_template_basic.json rename to erpnext/setup/doctype/company/charts/us_account_chart_template_basic.json diff --git a/setup/doctype/company/charts/uy_uy_chart_template.json b/erpnext/setup/doctype/company/charts/uy_uy_chart_template.json similarity index 100% rename from setup/doctype/company/charts/uy_uy_chart_template.json rename to erpnext/setup/doctype/company/charts/uy_uy_chart_template.json diff --git a/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js similarity index 98% rename from setup/doctype/company/company.js rename to erpnext/setup/doctype/company/company.js index 856d5e1f368..e047c97cdeb 100644 --- a/setup/doctype/company/company.js +++ b/erpnext/setup/doctype/company/company.js @@ -27,7 +27,7 @@ cur_frm.cscript.replace_abbr = function() { args = dialog.get_values(); if(!args) return; return wn.call({ - method: "setup.doctype.company.company.replace_abbr", + method: "erpnext.setup.doctype.company.company.replace_abbr", args: { "company": cur_frm.doc.name, "old": cur_frm.doc.abbr, diff --git a/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py similarity index 100% rename from setup/doctype/company/company.py rename to erpnext/setup/doctype/company/company.py diff --git a/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.txt similarity index 100% rename from setup/doctype/company/company.txt rename to erpnext/setup/doctype/company/company.txt diff --git a/setup/doctype/company/sample_home_page.html b/erpnext/setup/doctype/company/sample_home_page.html similarity index 100% rename from setup/doctype/company/sample_home_page.html rename to erpnext/setup/doctype/company/sample_home_page.html diff --git a/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py similarity index 100% rename from setup/doctype/company/test_company.py rename to erpnext/setup/doctype/company/test_company.py diff --git a/setup/doctype/contact_control/README.md b/erpnext/setup/doctype/contact_control/README.md similarity index 100% rename from setup/doctype/contact_control/README.md rename to erpnext/setup/doctype/contact_control/README.md diff --git a/setup/doctype/contact_control/__init__.py b/erpnext/setup/doctype/contact_control/__init__.py similarity index 100% rename from setup/doctype/contact_control/__init__.py rename to erpnext/setup/doctype/contact_control/__init__.py diff --git a/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js similarity index 100% rename from setup/doctype/contact_control/contact_control.js rename to erpnext/setup/doctype/contact_control/contact_control.js diff --git a/setup/doctype/contact_control/contact_control.py b/erpnext/setup/doctype/contact_control/contact_control.py similarity index 100% rename from setup/doctype/contact_control/contact_control.py rename to erpnext/setup/doctype/contact_control/contact_control.py diff --git a/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.txt similarity index 100% rename from setup/doctype/contact_control/contact_control.txt rename to erpnext/setup/doctype/contact_control/contact_control.txt diff --git a/setup/doctype/country/README.md b/erpnext/setup/doctype/country/README.md similarity index 100% rename from setup/doctype/country/README.md rename to erpnext/setup/doctype/country/README.md diff --git a/setup/doctype/country/__init__.py b/erpnext/setup/doctype/country/__init__.py similarity index 100% rename from setup/doctype/country/__init__.py rename to erpnext/setup/doctype/country/__init__.py diff --git a/setup/doctype/country/country.py b/erpnext/setup/doctype/country/country.py similarity index 100% rename from setup/doctype/country/country.py rename to erpnext/setup/doctype/country/country.py diff --git a/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.txt similarity index 100% rename from setup/doctype/country/country.txt rename to erpnext/setup/doctype/country/country.txt diff --git a/setup/doctype/country/test_country.py b/erpnext/setup/doctype/country/test_country.py similarity index 100% rename from setup/doctype/country/test_country.py rename to erpnext/setup/doctype/country/test_country.py diff --git a/setup/doctype/currency/README.md b/erpnext/setup/doctype/currency/README.md similarity index 100% rename from setup/doctype/currency/README.md rename to erpnext/setup/doctype/currency/README.md diff --git a/setup/doctype/currency/__init__.py b/erpnext/setup/doctype/currency/__init__.py similarity index 100% rename from setup/doctype/currency/__init__.py rename to erpnext/setup/doctype/currency/__init__.py diff --git a/setup/doctype/currency/currency.js b/erpnext/setup/doctype/currency/currency.js similarity index 100% rename from setup/doctype/currency/currency.js rename to erpnext/setup/doctype/currency/currency.js diff --git a/setup/doctype/currency/currency.py b/erpnext/setup/doctype/currency/currency.py similarity index 100% rename from setup/doctype/currency/currency.py rename to erpnext/setup/doctype/currency/currency.py diff --git a/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.txt similarity index 100% rename from setup/doctype/currency/currency.txt rename to erpnext/setup/doctype/currency/currency.txt diff --git a/setup/doctype/currency/test_currency.py b/erpnext/setup/doctype/currency/test_currency.py similarity index 100% rename from setup/doctype/currency/test_currency.py rename to erpnext/setup/doctype/currency/test_currency.py diff --git a/setup/__init__.py b/erpnext/setup/doctype/currency_exchange/__init__.py similarity index 100% rename from setup/__init__.py rename to erpnext/setup/doctype/currency_exchange/__init__.py diff --git a/setup/doctype/currency_exchange/currency_exchange.js b/erpnext/setup/doctype/currency_exchange/currency_exchange.js similarity index 100% rename from setup/doctype/currency_exchange/currency_exchange.js rename to erpnext/setup/doctype/currency_exchange/currency_exchange.js diff --git a/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py similarity index 100% rename from setup/doctype/currency_exchange/currency_exchange.py rename to erpnext/setup/doctype/currency_exchange/currency_exchange.py diff --git a/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt similarity index 100% rename from setup/doctype/currency_exchange/currency_exchange.txt rename to erpnext/setup/doctype/currency_exchange/currency_exchange.txt diff --git a/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py similarity index 100% rename from setup/doctype/currency_exchange/test_currency_exchange.py rename to erpnext/setup/doctype/currency_exchange/test_currency_exchange.py diff --git a/setup/doctype/customer_group/README.md b/erpnext/setup/doctype/customer_group/README.md similarity index 100% rename from setup/doctype/customer_group/README.md rename to erpnext/setup/doctype/customer_group/README.md diff --git a/setup/doctype/customer_group/__init__.py b/erpnext/setup/doctype/customer_group/__init__.py similarity index 100% rename from setup/doctype/customer_group/__init__.py rename to erpnext/setup/doctype/customer_group/__init__.py diff --git a/setup/doctype/customer_group/customer_group.js b/erpnext/setup/doctype/customer_group/customer_group.js similarity index 100% rename from setup/doctype/customer_group/customer_group.js rename to erpnext/setup/doctype/customer_group/customer_group.js diff --git a/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py similarity index 100% rename from setup/doctype/customer_group/customer_group.py rename to erpnext/setup/doctype/customer_group/customer_group.py diff --git a/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt similarity index 100% rename from setup/doctype/customer_group/customer_group.txt rename to erpnext/setup/doctype/customer_group/customer_group.txt diff --git a/setup/doctype/customer_group/test_customer_group.py b/erpnext/setup/doctype/customer_group/test_customer_group.py similarity index 100% rename from setup/doctype/customer_group/test_customer_group.py rename to erpnext/setup/doctype/customer_group/test_customer_group.py diff --git a/setup/doctype/email_digest/README.md b/erpnext/setup/doctype/email_digest/README.md similarity index 100% rename from setup/doctype/email_digest/README.md rename to erpnext/setup/doctype/email_digest/README.md diff --git a/setup/doctype/email_digest/__init__.py b/erpnext/setup/doctype/email_digest/__init__.py similarity index 100% rename from setup/doctype/email_digest/__init__.py rename to erpnext/setup/doctype/email_digest/__init__.py diff --git a/setup/doctype/email_digest/email_digest.css b/erpnext/setup/doctype/email_digest/email_digest.css similarity index 100% rename from setup/doctype/email_digest/email_digest.css rename to erpnext/setup/doctype/email_digest/email_digest.css diff --git a/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js similarity index 100% rename from setup/doctype/email_digest/email_digest.js rename to erpnext/setup/doctype/email_digest/email_digest.js diff --git a/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py similarity index 99% rename from setup/doctype/email_digest/email_digest.py rename to erpnext/setup/doctype/email_digest/email_digest.py index f01c8a84891..b9125c90578 100644 --- a/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -293,7 +293,7 @@ class DocType(DocListController): filter_by_company=False) def get_calendar_events(self, user_id): - from core.doctype.event.event import get_events + from webnotes.core.doctype.event.event import get_events events = get_events(self.future_from_date.strftime("%Y-%m-%d"), self.future_to_date.strftime("%Y-%m-%d")) html = "" @@ -314,7 +314,7 @@ class DocType(DocListController): return 0, "

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('
\ -
%(main_title)s: Step %(step)s
\ +
\ +
\ +
\ + %(title)s
\ + \ +
\ +
\
\
\
\ @@ -443,7 +386,6 @@ wn.wiz.WizardSlide = Class.extend({
\
\
\ -

%(title)s


\

%(help)s

\
\
\ @@ -468,30 +410,28 @@ wn.wiz.WizardSlide = Class.extend({ } if(this.id > 0) { - this.$prev = $("") + this.$prev = this.$wrapper.find('.prev-btn').removeClass("hide") .click(function() { wn.set_route(me.wiz.page_name, me.id-1 + ""); }) - .appendTo(this.$wrapper.find(".footer")) - .css({"margin-right": "5px"}); + .css({"margin-right": "10px"}); } if(this.id+1 < this.wiz.slides.length) { - this.$next = $("") + this.$next = this.$wrapper.find('.next-btn').removeClass("hide") .click(function() { me.values = me.form.get_values(); if(me.values===null) return; wn.set_route(me.wiz.page_name, me.id+1 + ""); }) - .appendTo(this.$wrapper.find(".footer")); } else { - this.$complete = $("") + this.$complete = this.$wrapper.find('.complete-btn').removeClass("hide") .click(function() { me.values = me.form.get_values(); if(me.values===null) return; me.wiz.on_complete(me.wiz); - }).appendTo(this.$wrapper.find(".footer")); + }) } if(this.onload) { diff --git a/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py similarity index 98% rename from setup/page/setup_wizard/setup_wizard.py rename to erpnext/setup/page/setup_wizard/setup_wizard.py index c1d3571ea57..62989736c78 100644 --- a/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -169,8 +169,8 @@ def set_defaults(args): def create_feed_and_todo(): """update activty feed and create todo for creation of item, customer, vendor""" - import home - home.make_feed('Comment', 'ToDo', '', webnotes.session['user'], + from erpnext.home import make_feed + make_feed('Comment', 'ToDo', '', webnotes.session['user'], 'ERNext Setup Complete!', '#6B24B3') def create_email_digest(): @@ -342,7 +342,7 @@ def add_all_roles_to(name): def create_territories(): """create two default territories, one for home country and one named Rest of the World""" - from setup.utils import get_root_of + from erpnext.setup.utils import get_root_of country = webnotes.conn.get_value("Control Panel", None, "country") root_territory = get_root_of("Territory") for name in (country, "Rest Of The World"): diff --git a/setup/page/setup_wizard/setup_wizard.txt b/erpnext/setup/page/setup_wizard/setup_wizard.txt similarity index 100% rename from setup/page/setup_wizard/setup_wizard.txt rename to erpnext/setup/page/setup_wizard/setup_wizard.txt diff --git a/setup/page/setup_wizard/test_setup_data.py b/erpnext/setup/page/setup_wizard/test_setup_data.py similarity index 100% rename from setup/page/setup_wizard/test_setup_data.py rename to erpnext/setup/page/setup_wizard/test_setup_data.py diff --git a/setup/page/setup_wizard/test_setup_wizard.py b/erpnext/setup/page/setup_wizard/test_setup_wizard.py similarity index 68% rename from setup/page/setup_wizard/test_setup_wizard.py rename to erpnext/setup/page/setup_wizard/test_setup_wizard.py index fe0904d5ac5..a4e5c29f8d5 100644 --- a/setup/page/setup_wizard/test_setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/test_setup_wizard.py @@ -4,8 +4,8 @@ from __future__ import unicode_literals import webnotes -from setup.page.setup_wizard.test_setup_data import args -from setup.page.setup_wizard.setup_wizard import setup_account +from erpnext.setup.page.setup_wizard.test_setup_data import args +from erpnext.setup.page.setup_wizard.setup_wizard import setup_account if __name__=="__main__": webnotes.connect() diff --git a/setup/doctype/sales_email_settings/__init__.py b/erpnext/setup/report/__init__.py similarity index 100% rename from setup/doctype/sales_email_settings/__init__.py rename to erpnext/setup/report/__init__.py diff --git a/setup/doctype/sales_partner/templates/__init__.py b/erpnext/setup/report/item_wise_price_list_rate/__init__.py similarity index 100% rename from setup/doctype/sales_partner/templates/__init__.py rename to erpnext/setup/report/item_wise_price_list_rate/__init__.py diff --git a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/erpnext/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt similarity index 100% rename from setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt rename to erpnext/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt diff --git a/setup/utils.py b/erpnext/setup/utils.py similarity index 100% rename from setup/utils.py rename to erpnext/setup/utils.py diff --git a/startup/__init__.py b/erpnext/startup/__init__.py similarity index 100% rename from startup/__init__.py rename to erpnext/startup/__init__.py diff --git a/startup/boot.py b/erpnext/startup/boot.py similarity index 97% rename from startup/boot.py rename to erpnext/startup/boot.py index a8dbf81a908..e28e5baa410 100644 --- a/startup/boot.py +++ b/erpnext/startup/boot.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import webnotes -import home def boot_session(bootinfo): """boot session - send website info if guest""" @@ -48,7 +47,6 @@ def load_country_and_currency(bootinfo): where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"}) def get_letter_heads(): - """load letter heads with startup""" import webnotes ret = webnotes.conn.sql("""select name, content from `tabLetter Head` where ifnull(disabled,0)=0""") diff --git a/startup/event_handlers.py b/erpnext/startup/event_handlers.py similarity index 81% rename from startup/event_handlers.py rename to erpnext/startup/event_handlers.py index f0323ea36a7..262771dd4af 100644 --- a/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -4,9 +4,8 @@ from __future__ import unicode_literals import webnotes -import home -def on_login_post_session(login_manager): +def on_session_creation(login_manager): """ called after login update login_from and delete parallel sessions @@ -25,13 +24,13 @@ def on_login_post_session(login_manager): from webnotes.utils import nowtime from webnotes.profile import get_user_fullname webnotes.conn.begin() - home.make_feed('Login', 'Profile', login_manager.user, login_manager.user, + make_feed('Login', 'Profile', login_manager.user, login_manager.user, '%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()), login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D') webnotes.conn.commit() if webnotes.conn.get_value("Profile", webnotes.session.user, "user_type") == "Website User": - from selling.utils.cart import set_cart_count + from erpnext.selling.utils.cart import set_cart_count set_cart_count() def on_logout(login_manager): @@ -62,14 +61,4 @@ def check_if_expired(): webnotes.msgprint(msg) webnotes.response['message'] = 'Account Expired' - raise webnotes.AuthenticationError - -def on_build(): - from home.page.latest_updates import latest_updates - latest_updates.make() - -def comment_added(doc): - """add comment to feed""" - home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by, - '"' + doc.comment + '"', '#6B24B3') - + raise webnotes.AuthenticationError diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py new file mode 100644 index 00000000000..d4cb4fad195 --- /dev/null +++ b/erpnext/startup/notifications.py @@ -0,0 +1,35 @@ +# 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 get_notification_config(): + return { "for_doctype": + { + "Support Ticket": {"status":"Open"}, + "Customer Issue": {"status":"Open"}, + "Task": {"status":"Open"}, + "Lead": {"status":"Open"}, + "Contact": {"status":"Open"}, + "Opportunity": {"docstatus":0}, + "Quotation": {"docstatus":0}, + "Sales Order": {"docstatus":0}, + "Journal Voucher": {"docstatus":0}, + "Sales Invoice": {"docstatus":0}, + "Purchase Invoice": {"docstatus":0}, + "Leave Application": {"status":"Open"}, + "Expense Claim": {"approval_status":"Draft"}, + "Job Applicant": {"status":"Open"}, + "Purchase Receipt": {"docstatus":0}, + "Delivery Note": {"docstatus":0}, + "Stock Entry": {"docstatus":0}, + "Material Request": {"docstatus":0}, + "Purchase Order": {"docstatus":0}, + "Production Order": {"docstatus":0}, + "BOM": {"docstatus":0}, + "Timesheet": {"docstatus":0}, + "Time Log": {"status":"Draft"}, + "Time Log Batch": {"status":"Draft"}, + } + } \ No newline at end of file diff --git a/startup/report_data_map.py b/erpnext/startup/report_data_map.py similarity index 100% rename from startup/report_data_map.py rename to erpnext/startup/report_data_map.py diff --git a/startup/webutils.py b/erpnext/startup/webutils.py similarity index 96% rename from startup/webutils.py rename to erpnext/startup/webutils.py index 9e18d4eaadf..ef8c88b397f 100644 --- a/startup/webutils.py +++ b/erpnext/startup/webutils.py @@ -4,7 +4,7 @@ import webnotes from webnotes.utils import cint -def get_website_settings(context): +def update_website_context(context): post_login = [] cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled")) if cart_enabled: diff --git a/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt similarity index 100% rename from stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt rename to erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt diff --git a/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt similarity index 100% rename from stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt rename to erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt diff --git a/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt similarity index 100% rename from stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt rename to erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt diff --git a/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt similarity index 100% rename from stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt rename to erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt diff --git a/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt b/erpnext/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt similarity index 100% rename from stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt rename to erpnext/stock/Print Format/Purchase Receipt Format/Purchase Receipt Format.txt diff --git a/stock/README.md b/erpnext/stock/README.md similarity index 100% rename from stock/README.md rename to erpnext/stock/README.md diff --git a/stock/__init__.py b/erpnext/stock/__init__.py similarity index 100% rename from stock/__init__.py rename to erpnext/stock/__init__.py diff --git a/stock/doctype/__init__.py b/erpnext/stock/doctype/__init__.py similarity index 100% rename from stock/doctype/__init__.py rename to erpnext/stock/doctype/__init__.py diff --git a/stock/doctype/batch/README.md b/erpnext/stock/doctype/batch/README.md similarity index 100% rename from stock/doctype/batch/README.md rename to erpnext/stock/doctype/batch/README.md diff --git a/stock/doctype/batch/__init__.py b/erpnext/stock/doctype/batch/__init__.py similarity index 100% rename from stock/doctype/batch/__init__.py rename to erpnext/stock/doctype/batch/__init__.py diff --git a/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js similarity index 83% rename from stock/doctype/batch/batch.js rename to erpnext/stock/doctype/batch/batch.js index 51e747029c6..cc142ed5663 100644 --- a/stock/doctype/batch/batch.js +++ b/erpnext/stock/doctype/batch/batch.js @@ -3,7 +3,7 @@ cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) { return { - query:"controllers.queries.item_query", + query: "erpnext.controllers.queries.item_query", filters:{ 'is_stock_item': 'Yes' } diff --git a/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py similarity index 100% rename from stock/doctype/batch/batch.py rename to erpnext/stock/doctype/batch/batch.py diff --git a/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.txt similarity index 100% rename from stock/doctype/batch/batch.txt rename to erpnext/stock/doctype/batch/batch.txt diff --git a/stock/doctype/bin/README.md b/erpnext/stock/doctype/bin/README.md similarity index 100% rename from stock/doctype/bin/README.md rename to erpnext/stock/doctype/bin/README.md diff --git a/stock/doctype/bin/__init__.py b/erpnext/stock/doctype/bin/__init__.py similarity index 100% rename from stock/doctype/bin/__init__.py rename to erpnext/stock/doctype/bin/__init__.py diff --git a/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py similarity index 97% rename from stock/doctype/bin/bin.py rename to erpnext/stock/doctype/bin/bin.py index 73b1cacc355..1acb3aa5565 100644 --- a/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -33,7 +33,7 @@ class DocType: self.update_qty(args) if args.get("actual_qty"): - from stock.stock_ledger import update_entries_after + from erpnext.stock.stock_ledger import update_entries_after if not args.get("posting_date"): args["posting_date"] = nowdate() diff --git a/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.txt similarity index 100% rename from stock/doctype/bin/bin.txt rename to erpnext/stock/doctype/bin/bin.txt diff --git a/stock/doctype/delivery_note/README.md b/erpnext/stock/doctype/delivery_note/README.md similarity index 100% rename from stock/doctype/delivery_note/README.md rename to erpnext/stock/doctype/delivery_note/README.md diff --git a/stock/doctype/delivery_note/__init__.py b/erpnext/stock/doctype/delivery_note/__init__.py similarity index 100% rename from stock/doctype/delivery_note/__init__.py rename to erpnext/stock/doctype/delivery_note/__init__.py diff --git a/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js similarity index 92% rename from stock/doctype/delivery_note/delivery_note.js rename to erpnext/stock/doctype/delivery_note/delivery_note.js index 7376f3c60f4..56329a11a04 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -7,10 +7,10 @@ cur_frm.cscript.fname = "delivery_note_details"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; -wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/selling/sales_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'selling/sales_common.js' %}; +{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} wn.provide("erpnext.stock"); erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({ @@ -52,7 +52,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( cur_frm.add_custom_button(wn._('From Sales Order'), function() { wn.model.map_current_doc({ - method: "selling.doctype.sales_order.sales_order.make_delivery_note", + method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note", source_doctype: "Sales Order", get_query_filters: { docstatus: 1, @@ -70,14 +70,14 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( make_sales_invoice: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice", + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", source_name: cur_frm.doc.name }) }, make_installation_note: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.delivery_note.delivery_note.make_installation_note", + method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note", source_name: cur_frm.doc.name }); }, @@ -106,7 +106,7 @@ cur_frm.cscript.new_contact = function(){ // ***************** Get project name ***************** cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { return { - query: "controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project_name", filters: { 'customer': doc.customer } diff --git a/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py similarity index 97% rename from stock/doctype/delivery_note/delivery_note.py rename to erpnext/stock/doctype/delivery_note/delivery_note.py index b2149b1be84..be0b95f945f 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -10,8 +10,8 @@ from webnotes.model.code import get_obj from webnotes import msgprint, _ import webnotes.defaults from webnotes.model.mapper import get_mapped_doclist -from stock.utils import update_bin -from controllers.selling_controller import SellingController +from erpnext.stock.utils import update_bin +from erpnext.controllers.selling_controller import SellingController class DocType(SellingController): def __init__(self, doc, doclist=[]): @@ -61,8 +61,8 @@ class DocType(SellingController): def validate(self): super(DocType, self).validate() - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) self.so_required() self.validate_proj_cust() @@ -73,7 +73,7 @@ class DocType(SellingController): self.update_current_stock() self.validate_with_previous_doc() - from stock.doctype.packed_item.packed_item import make_packing_list + from erpnext.stock.doctype.packed_item.packed_item import make_packing_list self.doclist = make_packing_list(self, 'delivery_note_details') self.doc.status = 'Draft' diff --git a/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt similarity index 100% rename from stock/doctype/delivery_note/delivery_note.txt rename to erpnext/stock/doctype/delivery_note/delivery_note.txt diff --git a/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py similarity index 91% rename from stock/doctype/delivery_note/test_delivery_note.py rename to erpnext/stock/doctype/delivery_note/test_delivery_note.py index ae69db6b54f..4213d19e054 100644 --- a/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -7,7 +7,7 @@ import unittest import webnotes import webnotes.defaults from webnotes.utils import cint -from stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries, set_perpetual_inventory, test_records as pr_test_records +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries, set_perpetual_inventory, test_records as pr_test_records def _insert_purchase_receipt(item_code=None): if not item_code: @@ -23,7 +23,7 @@ class TestDeliveryNote(unittest.TestCase): self.clear_stock_account_balance() _insert_purchase_receipt() - from stock.doctype.delivery_note.delivery_note import make_sales_invoice + from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice _insert_purchase_receipt() dn = webnotes.bean(copy=test_records[0]).insert() @@ -75,7 +75,7 @@ class TestDeliveryNote(unittest.TestCase): stock_in_hand_account = webnotes.conn.get_value("Account", {"master_name": dn.doclist[1].warehouse}) - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) dn.insert() @@ -130,7 +130,7 @@ class TestDeliveryNote(unittest.TestCase): stock_in_hand_account = webnotes.conn.get_value("Account", {"master_name": dn.doclist[1].warehouse}) - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) dn.insert() @@ -156,8 +156,8 @@ class TestDeliveryNote(unittest.TestCase): set_perpetual_inventory(0) 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) @@ -177,7 +177,7 @@ class TestDeliveryNote(unittest.TestCase): return dn 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 dn = self.test_serialized() dn.cancel() @@ -189,8 +189,8 @@ class TestDeliveryNote(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/stock/doctype/delivery_note_item/README.md b/erpnext/stock/doctype/delivery_note_item/README.md similarity index 100% rename from stock/doctype/delivery_note_item/README.md rename to erpnext/stock/doctype/delivery_note_item/README.md diff --git a/stock/doctype/delivery_note_item/__init__.py b/erpnext/stock/doctype/delivery_note_item/__init__.py similarity index 100% rename from stock/doctype/delivery_note_item/__init__.py rename to erpnext/stock/doctype/delivery_note_item/__init__.py diff --git a/stock/doctype/delivery_note_item/delivery_note_item.py b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py similarity index 100% rename from stock/doctype/delivery_note_item/delivery_note_item.py rename to erpnext/stock/doctype/delivery_note_item/delivery_note_item.py diff --git a/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt similarity index 100% rename from stock/doctype/delivery_note_item/delivery_note_item.txt rename to erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt diff --git a/stock/doctype/item/README.md b/erpnext/stock/doctype/item/README.md similarity index 100% rename from stock/doctype/item/README.md rename to erpnext/stock/doctype/item/README.md diff --git a/stock/doctype/item/__init__.py b/erpnext/stock/doctype/item/__init__.py similarity index 100% rename from stock/doctype/item/__init__.py rename to erpnext/stock/doctype/item/__init__.py diff --git a/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js similarity index 97% rename from stock/doctype/item/item.js rename to erpnext/stock/doctype/item/item.js index c9aa75e7b71..1ee5e049e44 100644 --- a/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -151,11 +151,11 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.supplier_query" } } + return{ query: "erpnext.controllers.queries.supplier_query" } } cur_frm.cscript.copy_from_item_group = function(doc) { wn.model.with_doc("Item Group", doc.item_group, function() { diff --git a/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py similarity index 93% rename from stock/doctype/item/item.py rename to erpnext/stock/doctype/item/item.py index 4ebf9c49d93..f9763cdf539 100644 --- a/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -90,9 +90,7 @@ class DocType(DocListController, WebsiteGenerator): (self.doc.stock_uom, self.doc.name)) if not matched: - webnotes.throw(_("Default Unit of Measure can not be changed directly \ - because you have already made some transaction(s) with another UOM.\n \ - To change default UOM, use 'UOM Replace Utility' tool under Stock module.")) + webnotes.throw(_("Default Unit of Measure can not be changed directly because you have already made some transaction(s) with another UOM. To change default UOM, use 'UOM Replace Utility' tool under Stock module.")) def validate_conversion_factor(self): check_list = [] @@ -104,12 +102,10 @@ class DocType(DocListController, WebsiteGenerator): check_list.append(cstr(d.uom)) if d.uom and cstr(d.uom) == cstr(self.doc.stock_uom) and flt(d.conversion_factor) != 1: - msgprint(_("""Conversion Factor of UOM: %s should be equal to 1. - As UOM: %s is Stock UOM of Item: %s.""" % + msgprint(_("""Conversion Factor of UOM: %s should be equal to 1. As UOM: %s is Stock UOM of Item: %s.""" % (d.uom, d.uom, self.doc.name)), raise_exception=1) elif d.uom and cstr(d.uom)!= self.doc.stock_uom and flt(d.conversion_factor) == 1: - msgprint(_("""Conversion Factor of UOM: %s should not be equal to 1. - As UOM: %s is not Stock UOM of Item: %s""" % + msgprint(_("""Conversion Factor of UOM: %s should not be equal to 1. As UOM: %s is not Stock UOM of Item: %s""" % (d.uom, d.uom, self.doc.name)), raise_exception=1) def validate_item_type(self): @@ -180,9 +176,7 @@ class DocType(DocListController, WebsiteGenerator): vals.has_serial_no != self.doc.has_serial_no or cstr(vals.valuation_method) != cstr(self.doc.valuation_method)): if self.check_if_sle_exists() == "exists": - webnotes.msgprint(_("As there are existing stock transactions for this \ - item, you can not change the values of 'Has Serial No', \ - 'Is Stock Item' and 'Valuation Method'"), raise_exception=1) + webnotes.throw(_("As there are existing stock transactions for this item, you can not change the values of 'Has Serial No', 'Is Stock Item' and 'Valuation Method'")) def validate_item_type_for_reorder(self): if self.doc.re_order_level or len(self.doclist.get({"parentfield": "item_reorder", @@ -204,7 +198,7 @@ class DocType(DocListController, WebsiteGenerator): self.doc.name, raise_exception=1) def update_website(self): - from selling.utils.product import invalidate_cache_for + from erpnext.selling.utils.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in \ self.doclist.get({"doctype":"Website Item Group"})] @@ -228,12 +222,12 @@ class DocType(DocListController, WebsiteGenerator): return { "tax_rate": webnotes.conn.get_value("Account", tax_type, "tax_rate") } def get_context(self): - from selling.utils.product import get_parent_item_groups + from erpnext.selling.utils.product import get_parent_item_groups self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}] self.doc.title = self.doc.item_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) def get_file_details(self, arg = ''): @@ -278,12 +272,12 @@ class DocType(DocListController, WebsiteGenerator): clear_cache(self.doc.page_name) def set_last_purchase_rate(self, newdn): - from buying.utils import get_last_purchase_details + from erpnext.buying.utils import get_last_purchase_details last_purchase_rate = get_last_purchase_details(newdn).get("purchase_rate", 0) webnotes.conn.set_value("Item", newdn, "last_purchase_rate", last_purchase_rate) def recalculate_bin_qty(self, newdn): - from utilities.repost_stock import repost_stock + from erpnext.utilities.repost_stock import repost_stock webnotes.conn.auto_commit_on_many_writes = 1 webnotes.conn.set_default("allow_negative_stock", 1) diff --git a/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt similarity index 100% rename from stock/doctype/item/item.txt rename to erpnext/stock/doctype/item/item.txt diff --git a/setup/doctype/sales_partner/templates/generators/__init__.py b/erpnext/stock/doctype/item/templates/__init__.py similarity index 100% rename from setup/doctype/sales_partner/templates/generators/__init__.py rename to erpnext/stock/doctype/item/templates/__init__.py diff --git a/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py similarity index 99% rename from stock/doctype/item/test_item.py rename to erpnext/stock/doctype/item/test_item.py index b8f6f9e2467..3cf1d5ecf69 100644 --- a/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -10,7 +10,7 @@ test_dependencies = ["Warehouse"] class TestItem(unittest.TestCase): def test_default_warehouse(self): - from stock.doctype.item.item import WarehouseNotSet + from erpnext.stock.doctype.item.item import WarehouseNotSet item = webnotes.bean(copy=test_records[0]) item.doc.is_stock_item = "Yes" item.doc.default_warehouse = None diff --git a/stock/doctype/item_customer_detail/README.md b/erpnext/stock/doctype/item_customer_detail/README.md similarity index 100% rename from stock/doctype/item_customer_detail/README.md rename to erpnext/stock/doctype/item_customer_detail/README.md diff --git a/stock/doctype/item_customer_detail/__init__.py b/erpnext/stock/doctype/item_customer_detail/__init__.py similarity index 100% rename from stock/doctype/item_customer_detail/__init__.py rename to erpnext/stock/doctype/item_customer_detail/__init__.py diff --git a/stock/doctype/item_customer_detail/item_customer_detail.py b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py similarity index 100% rename from stock/doctype/item_customer_detail/item_customer_detail.py rename to erpnext/stock/doctype/item_customer_detail/item_customer_detail.py diff --git a/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt similarity index 100% rename from stock/doctype/item_customer_detail/item_customer_detail.txt rename to erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt diff --git a/stock/doctype/item_price/README.md b/erpnext/stock/doctype/item_price/README.md similarity index 100% rename from stock/doctype/item_price/README.md rename to erpnext/stock/doctype/item_price/README.md diff --git a/stock/doctype/item_price/__init__.py b/erpnext/stock/doctype/item_price/__init__.py similarity index 100% rename from stock/doctype/item_price/__init__.py rename to erpnext/stock/doctype/item_price/__init__.py diff --git a/stock/doctype/item_price/item_price.js b/erpnext/stock/doctype/item_price/item_price.js similarity index 100% rename from stock/doctype/item_price/item_price.js rename to erpnext/stock/doctype/item_price/item_price.js diff --git a/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py similarity index 100% rename from stock/doctype/item_price/item_price.py rename to erpnext/stock/doctype/item_price/item_price.py diff --git a/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.txt similarity index 100% rename from stock/doctype/item_price/item_price.txt rename to erpnext/stock/doctype/item_price/item_price.txt diff --git a/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py similarity index 86% rename from stock/doctype/item_price/test_item_price.py rename to erpnext/stock/doctype/item_price/test_item_price.py index 583b3debad3..bc695ea3a9f 100644 --- a/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -7,7 +7,7 @@ import webnotes class TestItem(unittest.TestCase): def test_duplicate_item(self): - from stock.doctype.item_price.item_price import ItemPriceDuplicateItem + from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem bean = webnotes.bean(copy=test_records[0]) self.assertRaises(ItemPriceDuplicateItem, bean.insert) diff --git a/stock/doctype/item_quality_inspection_parameter/README.md b/erpnext/stock/doctype/item_quality_inspection_parameter/README.md similarity index 100% rename from stock/doctype/item_quality_inspection_parameter/README.md rename to erpnext/stock/doctype/item_quality_inspection_parameter/README.md diff --git a/stock/doctype/item_quality_inspection_parameter/__init__.py b/erpnext/stock/doctype/item_quality_inspection_parameter/__init__.py similarity index 100% rename from stock/doctype/item_quality_inspection_parameter/__init__.py rename to erpnext/stock/doctype/item_quality_inspection_parameter/__init__.py diff --git a/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py similarity index 100% rename from stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py rename to erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py diff --git a/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt similarity index 100% rename from stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt rename to erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt diff --git a/stock/doctype/item_reorder/README.md b/erpnext/stock/doctype/item_reorder/README.md similarity index 100% rename from stock/doctype/item_reorder/README.md rename to erpnext/stock/doctype/item_reorder/README.md diff --git a/setup/doctype/sales_partner/templates/pages/__init__.py b/erpnext/stock/doctype/item_reorder/__init__.py similarity index 100% rename from setup/doctype/sales_partner/templates/pages/__init__.py rename to erpnext/stock/doctype/item_reorder/__init__.py diff --git a/stock/doctype/item_reorder/item_reorder.py b/erpnext/stock/doctype/item_reorder/item_reorder.py similarity index 100% rename from stock/doctype/item_reorder/item_reorder.py rename to erpnext/stock/doctype/item_reorder/item_reorder.py diff --git a/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.txt similarity index 100% rename from stock/doctype/item_reorder/item_reorder.txt rename to erpnext/stock/doctype/item_reorder/item_reorder.txt diff --git a/stock/doctype/item_supplier/README.md b/erpnext/stock/doctype/item_supplier/README.md similarity index 100% rename from stock/doctype/item_supplier/README.md rename to erpnext/stock/doctype/item_supplier/README.md diff --git a/stock/doctype/item_supplier/__init__.py b/erpnext/stock/doctype/item_supplier/__init__.py similarity index 100% rename from stock/doctype/item_supplier/__init__.py rename to erpnext/stock/doctype/item_supplier/__init__.py diff --git a/stock/doctype/item_supplier/item_supplier.py b/erpnext/stock/doctype/item_supplier/item_supplier.py similarity index 100% rename from stock/doctype/item_supplier/item_supplier.py rename to erpnext/stock/doctype/item_supplier/item_supplier.py diff --git a/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.txt similarity index 100% rename from stock/doctype/item_supplier/item_supplier.txt rename to erpnext/stock/doctype/item_supplier/item_supplier.txt diff --git a/stock/doctype/item_tax/README.md b/erpnext/stock/doctype/item_tax/README.md similarity index 100% rename from stock/doctype/item_tax/README.md rename to erpnext/stock/doctype/item_tax/README.md diff --git a/stock/doctype/item_tax/__init__.py b/erpnext/stock/doctype/item_tax/__init__.py similarity index 100% rename from stock/doctype/item_tax/__init__.py rename to erpnext/stock/doctype/item_tax/__init__.py diff --git a/stock/doctype/item_tax/item_tax.py b/erpnext/stock/doctype/item_tax/item_tax.py similarity index 100% rename from stock/doctype/item_tax/item_tax.py rename to erpnext/stock/doctype/item_tax/item_tax.py diff --git a/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.txt similarity index 100% rename from stock/doctype/item_tax/item_tax.txt rename to erpnext/stock/doctype/item_tax/item_tax.txt diff --git a/stock/doctype/item_website_specification/README.md b/erpnext/stock/doctype/item_website_specification/README.md similarity index 100% rename from stock/doctype/item_website_specification/README.md rename to erpnext/stock/doctype/item_website_specification/README.md diff --git a/setup/doctype/website_item_group/__init__.py b/erpnext/stock/doctype/item_website_specification/__init__.py similarity index 100% rename from setup/doctype/website_item_group/__init__.py rename to erpnext/stock/doctype/item_website_specification/__init__.py diff --git a/stock/doctype/item_website_specification/item_website_specification.py b/erpnext/stock/doctype/item_website_specification/item_website_specification.py similarity index 100% rename from stock/doctype/item_website_specification/item_website_specification.py rename to erpnext/stock/doctype/item_website_specification/item_website_specification.py diff --git a/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt similarity index 100% rename from stock/doctype/item_website_specification/item_website_specification.txt rename to erpnext/stock/doctype/item_website_specification/item_website_specification.txt diff --git a/stock/doctype/landed_cost_item/README.md b/erpnext/stock/doctype/landed_cost_item/README.md similarity index 100% rename from stock/doctype/landed_cost_item/README.md rename to erpnext/stock/doctype/landed_cost_item/README.md diff --git a/stock/doctype/landed_cost_item/__init__.py b/erpnext/stock/doctype/landed_cost_item/__init__.py similarity index 100% rename from stock/doctype/landed_cost_item/__init__.py rename to erpnext/stock/doctype/landed_cost_item/__init__.py diff --git a/stock/doctype/landed_cost_item/landed_cost_item.py b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py similarity index 100% rename from stock/doctype/landed_cost_item/landed_cost_item.py rename to erpnext/stock/doctype/landed_cost_item/landed_cost_item.py diff --git a/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt similarity index 100% rename from stock/doctype/landed_cost_item/landed_cost_item.txt rename to erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt diff --git a/stock/doctype/landed_cost_purchase_receipt/README.md b/erpnext/stock/doctype/landed_cost_purchase_receipt/README.md similarity index 100% rename from stock/doctype/landed_cost_purchase_receipt/README.md rename to erpnext/stock/doctype/landed_cost_purchase_receipt/README.md diff --git a/stock/doctype/landed_cost_purchase_receipt/__init__.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/__init__.py similarity index 100% rename from stock/doctype/landed_cost_purchase_receipt/__init__.py rename to erpnext/stock/doctype/landed_cost_purchase_receipt/__init__.py diff --git a/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py similarity index 100% rename from stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py rename to erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py diff --git a/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt similarity index 100% rename from stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt rename to erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt diff --git a/stock/doctype/landed_cost_wizard/README.md b/erpnext/stock/doctype/landed_cost_wizard/README.md similarity index 100% rename from stock/doctype/landed_cost_wizard/README.md rename to erpnext/stock/doctype/landed_cost_wizard/README.md diff --git a/stock/doctype/landed_cost_wizard/__init__.py b/erpnext/stock/doctype/landed_cost_wizard/__init__.py similarity index 100% rename from stock/doctype/landed_cost_wizard/__init__.py rename to erpnext/stock/doctype/landed_cost_wizard/__init__.py diff --git a/stock/doctype/landed_cost_wizard/landed_cost_wizard.js b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js similarity index 95% rename from stock/doctype/landed_cost_wizard/landed_cost_wizard.js rename to erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js index 68f1bd07a71..86b34c03fea 100644 --- a/stock/doctype/landed_cost_wizard/landed_cost_wizard.js +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js @@ -3,7 +3,7 @@ wn.provide("erpnext.stock"); -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); erpnext.stock.LandedCostWizard = erpnext.stock.StockController.extend({ setup: function() { diff --git a/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py similarity index 100% rename from stock/doctype/landed_cost_wizard/landed_cost_wizard.py rename to erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py diff --git a/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt similarity index 100% rename from stock/doctype/landed_cost_wizard/landed_cost_wizard.txt rename to erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt diff --git a/stock/doctype/material_request/README.md b/erpnext/stock/doctype/material_request/README.md similarity index 100% rename from stock/doctype/material_request/README.md rename to erpnext/stock/doctype/material_request/README.md diff --git a/setup/page/setup_wizard/__init__.py b/erpnext/stock/doctype/material_request/__init__.py similarity index 100% rename from setup/page/setup_wizard/__init__.py rename to erpnext/stock/doctype/material_request/__init__.py diff --git a/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js similarity index 90% rename from stock/doctype/material_request/material_request.js rename to erpnext/stock/doctype/material_request/material_request.js index 3ca95a41c2b..31a57530357 100644 --- a/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -4,8 +4,8 @@ cur_frm.cscript.tname = "Material Request Item"; cur_frm.cscript.fname = "indent_details"; -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'utilities/doctype/sms_control/sms_control.js' %} erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({ refresh: function(doc) { @@ -49,7 +49,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten cur_frm.add_custom_button(wn._('From Sales Order'), function() { wn.model.map_current_doc({ - method: "selling.doctype.sales_order.sales_order.make_material_request", + method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request", source_doctype: "Sales Order", get_query_filters: { docstatus: 1, @@ -95,7 +95,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten if(!values) return; wn.call({ - method:"manufacturing.doctype.bom.bom.get_bom_items", + method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items", args: values, callback: function(r) { $.each(r.message, function(i, item) { @@ -128,21 +128,21 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten make_purchase_order: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.material_request.material_request.make_purchase_order", + method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order", source_name: cur_frm.doc.name }) }, make_supplier_quotation: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.material_request.material_request.make_supplier_quotation", + method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation", source_name: cur_frm.doc.name }) }, make_stock_entry: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.material_request.material_request.make_stock_entry", + method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry", source_name: cur_frm.doc.name }) } diff --git a/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py similarity index 97% rename from stock/doctype/material_request/material_request.py rename to erpnext/stock/doctype/material_request/material_request.py index 50661a316ae..28ec5084e0b 100644 --- a/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -12,7 +12,7 @@ from webnotes.model.utils import getlist 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 @@ -68,8 +68,8 @@ class DocType(BuyingController): if not self.doc.status: self.doc.status = "Draft" - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) self.validate_value("material_request_type", "in", ["Purchase", "Transfer"]) @@ -81,7 +81,7 @@ class DocType(BuyingController): def update_bin(self, is_submit, is_stopped): """ Update Quantity Requested for Purchase in Bin for Material Request of type 'Purchase'""" - from stock.utils import update_bin + from erpnext.stock.utils import update_bin for d in getlist(self.doclist, 'indent_details'): if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes": if not d.warehouse: @@ -194,7 +194,7 @@ def update_completed_qty(controller, caller_method): def _update_requested_qty(controller, mr_obj, mr_items): """update requested qty (before ordered_qty is updated)""" - from stock.utils import update_bin + from erpnext.stock.utils import update_bin for mr_item_name in mr_items: mr_item = mr_obj.doclist.getone({"parentfield": "indent_details", "name": mr_item_name}) se_detail = controller.doclist.getone({"parentfield": "mtn_details", diff --git a/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.txt similarity index 100% rename from stock/doctype/material_request/material_request.txt rename to erpnext/stock/doctype/material_request/material_request.txt diff --git a/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py similarity index 93% rename from stock/doctype/material_request/test_material_request.py rename to erpnext/stock/doctype/material_request/test_material_request.py index c19bfd39289..5266f49257d 100644 --- a/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -13,7 +13,7 @@ class TestMaterialRequest(unittest.TestCase): webnotes.defaults.set_global_default("auto_accounting_for_stock", 0) def test_make_purchase_order(self): - from stock.doctype.material_request.material_request import make_purchase_order + from erpnext.stock.doctype.material_request.material_request import make_purchase_order mr = webnotes.bean(copy=test_records[0]).insert() @@ -28,7 +28,7 @@ class TestMaterialRequest(unittest.TestCase): self.assertEquals(len(po), len(mr.doclist)) def test_make_supplier_quotation(self): - from stock.doctype.material_request.material_request import make_supplier_quotation + from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation mr = webnotes.bean(copy=test_records[0]).insert() @@ -44,7 +44,7 @@ class TestMaterialRequest(unittest.TestCase): def test_make_stock_entry(self): - from stock.doctype.material_request.material_request import make_stock_entry + from erpnext.stock.doctype.material_request.material_request import make_stock_entry mr = webnotes.bean(copy=test_records[0]).insert() @@ -122,7 +122,7 @@ class TestMaterialRequest(unittest.TestCase): self._test_requested_qty(54.0, 3.0) # map a purchase order - from stock.doctype.material_request.material_request import make_purchase_order + from erpnext.stock.doctype.material_request.material_request import make_purchase_order po_doclist = make_purchase_order(mr.doc.name) po_doclist[0].supplier = "_Test Supplier" po_doclist[1].qty = 27.0 @@ -169,7 +169,7 @@ class TestMaterialRequest(unittest.TestCase): self._test_requested_qty(54.0, 3.0) - from stock.doctype.material_request.material_request import make_stock_entry + from erpnext.stock.doctype.material_request.material_request import make_stock_entry # map a stock entry se_doclist = make_stock_entry(mr.doc.name) @@ -233,7 +233,7 @@ class TestMaterialRequest(unittest.TestCase): self._test_requested_qty(54.0, 3.0) # map a stock entry - from stock.doctype.material_request.material_request import make_stock_entry + from erpnext.stock.doctype.material_request.material_request import make_stock_entry se_doclist = make_stock_entry(mr.doc.name) se_doclist[0].update({ @@ -288,7 +288,7 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # map a stock entry - from stock.doctype.material_request.material_request import make_stock_entry + from erpnext.stock.doctype.material_request.material_request import make_stock_entry se_doclist = make_stock_entry(mr.doc.name) se_doclist[0].update({ @@ -315,7 +315,7 @@ class TestMaterialRequest(unittest.TestCase): self.assertRaises(webnotes.MappingMismatchError, se.insert) def test_warehouse_company_validation(self): - from stock.utils import InvalidWarehouseCompany + from erpnext.stock.utils import InvalidWarehouseCompany mr = webnotes.bean(copy=test_records[0]) mr.doc.company = "_Test Company 1" self.assertRaises(InvalidWarehouseCompany, mr.insert) diff --git a/stock/doctype/material_request_item/README.md b/erpnext/stock/doctype/material_request_item/README.md similarity index 100% rename from stock/doctype/material_request_item/README.md rename to erpnext/stock/doctype/material_request_item/README.md diff --git a/setup/report/__init__.py b/erpnext/stock/doctype/material_request_item/__init__.py similarity index 100% rename from setup/report/__init__.py rename to erpnext/stock/doctype/material_request_item/__init__.py diff --git a/stock/doctype/material_request_item/material_request_item.py b/erpnext/stock/doctype/material_request_item/material_request_item.py similarity index 100% rename from stock/doctype/material_request_item/material_request_item.py rename to erpnext/stock/doctype/material_request_item/material_request_item.py diff --git a/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt similarity index 100% rename from stock/doctype/material_request_item/material_request_item.txt rename to erpnext/stock/doctype/material_request_item/material_request_item.txt diff --git a/setup/report/item_wise_price_list_rate/__init__.py b/erpnext/stock/doctype/packed_item/__init__.py similarity index 100% rename from setup/report/item_wise_price_list_rate/__init__.py rename to erpnext/stock/doctype/packed_item/__init__.py diff --git a/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py similarity index 100% rename from stock/doctype/packed_item/packed_item.py rename to erpnext/stock/doctype/packed_item/packed_item.py diff --git a/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.txt similarity index 100% rename from stock/doctype/packed_item/packed_item.txt rename to erpnext/stock/doctype/packed_item/packed_item.txt diff --git a/stock/doctype/packing_slip/README.md b/erpnext/stock/doctype/packing_slip/README.md similarity index 100% rename from stock/doctype/packing_slip/README.md rename to erpnext/stock/doctype/packing_slip/README.md diff --git a/stock/doctype/packing_slip/__init__.py b/erpnext/stock/doctype/packing_slip/__init__.py similarity index 100% rename from stock/doctype/packing_slip/__init__.py rename to erpnext/stock/doctype/packing_slip/__init__.py diff --git a/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js similarity index 100% rename from stock/doctype/packing_slip/packing_slip.js rename to erpnext/stock/doctype/packing_slip/packing_slip.js diff --git a/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py similarity index 96% rename from stock/doctype/packing_slip/packing_slip.py rename to erpnext/stock/doctype/packing_slip/packing_slip.py index 8501b2b4f3f..de97a7e9f86 100644 --- a/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -24,7 +24,7 @@ class DocType: self.validate_case_nos() self.validate_qty() - 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") validate_uom_is_integer(self.doclist, "weight_uom", "net_weight") @@ -33,8 +33,7 @@ class DocType: Validates if delivery note has status as draft """ if cint(webnotes.conn.get_value("Delivery Note", self.doc.delivery_note, "docstatus")) != 0: - msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in - draft state. Please rectify and try again."""), raise_exception=1) + msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in draft state. Please rectify and try again."""), raise_exception=1) def validate_items_mandatory(self): rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})] @@ -165,7 +164,7 @@ class DocType: self.update_item_details() def item_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 name, item_name, description from `tabItem` where name in ( select item_code FROM `tabDelivery Note Item` where parent= %s diff --git a/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt similarity index 100% rename from stock/doctype/packing_slip/packing_slip.txt rename to erpnext/stock/doctype/packing_slip/packing_slip.txt diff --git a/stock/doctype/packing_slip_item/README.md b/erpnext/stock/doctype/packing_slip_item/README.md similarity index 100% rename from stock/doctype/packing_slip_item/README.md rename to erpnext/stock/doctype/packing_slip_item/README.md diff --git a/stock/doctype/packing_slip_item/__init__.py b/erpnext/stock/doctype/packing_slip_item/__init__.py similarity index 100% rename from stock/doctype/packing_slip_item/__init__.py rename to erpnext/stock/doctype/packing_slip_item/__init__.py diff --git a/stock/doctype/packing_slip_item/packing_slip_item.py b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py similarity index 100% rename from stock/doctype/packing_slip_item/packing_slip_item.py rename to erpnext/stock/doctype/packing_slip_item/packing_slip_item.py diff --git a/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt similarity index 100% rename from stock/doctype/packing_slip_item/packing_slip_item.txt rename to erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt diff --git a/stock/doctype/price_list/README.md b/erpnext/stock/doctype/price_list/README.md similarity index 100% rename from stock/doctype/price_list/README.md rename to erpnext/stock/doctype/price_list/README.md diff --git a/stock/doctype/price_list/__init__.py b/erpnext/stock/doctype/price_list/__init__.py similarity index 100% rename from stock/doctype/price_list/__init__.py rename to erpnext/stock/doctype/price_list/__init__.py diff --git a/stock/doctype/price_list/price_list.css b/erpnext/stock/doctype/price_list/price_list.css similarity index 100% rename from stock/doctype/price_list/price_list.css rename to erpnext/stock/doctype/price_list/price_list.css diff --git a/stock/doctype/price_list/price_list.js b/erpnext/stock/doctype/price_list/price_list.js similarity index 100% rename from stock/doctype/price_list/price_list.js rename to erpnext/stock/doctype/price_list/price_list.js diff --git a/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py similarity index 100% rename from stock/doctype/price_list/price_list.py rename to erpnext/stock/doctype/price_list/price_list.py diff --git a/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.txt similarity index 100% rename from stock/doctype/price_list/price_list.txt rename to erpnext/stock/doctype/price_list/price_list.txt diff --git a/stock/doctype/price_list/test_price_list.py b/erpnext/stock/doctype/price_list/test_price_list.py similarity index 100% rename from stock/doctype/price_list/test_price_list.py rename to erpnext/stock/doctype/price_list/test_price_list.py diff --git a/stock/doctype/purchase_receipt/README.md b/erpnext/stock/doctype/purchase_receipt/README.md similarity index 100% rename from stock/doctype/purchase_receipt/README.md rename to erpnext/stock/doctype/purchase_receipt/README.md diff --git a/stock/doctype/purchase_receipt/__init__.py b/erpnext/stock/doctype/purchase_receipt/__init__.py similarity index 100% rename from stock/doctype/purchase_receipt/__init__.py rename to erpnext/stock/doctype/purchase_receipt/__init__.py diff --git a/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js similarity index 90% rename from stock/doctype/purchase_receipt/purchase_receipt.js rename to erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index c6473055d8a..5151c0090b6 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -5,10 +5,10 @@ cur_frm.cscript.tname = "Purchase Receipt Item"; cur_frm.cscript.fname = "purchase_receipt_details"; cur_frm.cscript.other_fname = "purchase_tax_details"; -wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); -wn.require('app/utilities/doctype/sms_control/sms_control.js'); -wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -wn.require('app/accounts/doctype/sales_invoice/pos.js'); +{% include 'buying/doctype/purchase_common/purchase_common.js' %}; +{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} +{% include 'utilities/doctype/sms_control/sms_control.js' %} +{% include 'accounts/doctype/sales_invoice/pos.js' %} wn.provide("erpnext.stock"); erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({ @@ -28,7 +28,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend cur_frm.add_custom_button(wn._(wn._('From Purchase Order')), function() { wn.model.map_current_doc({ - method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt", + method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt", source_doctype: "Purchase Order", get_query_filters: { supplier: cur_frm.doc.supplier || undefined, @@ -91,7 +91,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend make_purchase_invoice: function() { wn.model.open_mapped_doc({ - method: "stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice", + method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice", source_name: cur_frm.doc.name }) }, diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py similarity index 97% rename from stock/doctype/purchase_receipt/purchase_receipt.py rename to erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index f8173bf6720..7a33971542e 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -9,9 +9,9 @@ from webnotes.model.bean import getlist from webnotes.model.code import get_obj from webnotes import msgprint, _ import webnotes.defaults -from stock.utils import update_bin +from erpnext.stock.utils import update_bin -from controllers.buying_controller import BuyingController +from erpnext.controllers.buying_controller import BuyingController class DocType(BuyingController): def __init__(self, doc, doclist=[]): self.doc = doc @@ -46,8 +46,8 @@ class DocType(BuyingController): if not self.doc.status: self.doc.status = "Draft" - import utilities - utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) + from erpnext.utilities import validate_status + validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) self.validate_with_previous_doc() self.validate_rejected_warehouse() @@ -240,7 +240,7 @@ class DocType(BuyingController): self.update_stock() - from stock.doctype.serial_no.serial_no import update_serial_nos_after_submit + from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit update_serial_nos_after_submit(self, "purchase_receipt_details") purchase_controller.update_last_purchase_rate(self, 1) diff --git a/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt similarity index 100% rename from stock/doctype/purchase_receipt/purchase_receipt.txt rename to erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt diff --git a/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py similarity index 98% rename from stock/doctype/purchase_receipt/test_purchase_receipt.py rename to erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 96d1a13ba12..89e77cee817 100644 --- a/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -12,7 +12,7 @@ class TestPurchaseReceipt(unittest.TestCase): def test_make_purchase_invoice(self): self._clear_stock_account_balance() set_perpetual_inventory(0) - from stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice + from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice pr = webnotes.bean(copy=test_records[0]).insert() diff --git a/stock/doctype/purchase_receipt_item/README.md b/erpnext/stock/doctype/purchase_receipt_item/README.md similarity index 100% rename from stock/doctype/purchase_receipt_item/README.md rename to erpnext/stock/doctype/purchase_receipt_item/README.md diff --git a/stock/doctype/purchase_receipt_item/__init__.py b/erpnext/stock/doctype/purchase_receipt_item/__init__.py similarity index 100% rename from stock/doctype/purchase_receipt_item/__init__.py rename to erpnext/stock/doctype/purchase_receipt_item/__init__.py diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.py b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py similarity index 100% rename from stock/doctype/purchase_receipt_item/purchase_receipt_item.py rename to erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt similarity index 100% rename from stock/doctype/purchase_receipt_item/purchase_receipt_item.txt rename to erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt diff --git a/stock/doctype/sales_bom/README.md b/erpnext/stock/doctype/sales_bom/README.md similarity index 100% rename from stock/doctype/sales_bom/README.md rename to erpnext/stock/doctype/sales_bom/README.md diff --git a/stock/doctype/sales_bom_item/README.md b/erpnext/stock/doctype/sales_bom_item/README.md similarity index 100% rename from stock/doctype/sales_bom_item/README.md rename to erpnext/stock/doctype/sales_bom_item/README.md diff --git a/stock/doctype/serial_no/README.md b/erpnext/stock/doctype/serial_no/README.md similarity index 100% rename from stock/doctype/serial_no/README.md rename to erpnext/stock/doctype/serial_no/README.md diff --git a/stock/doctype/serial_no/__init__.py b/erpnext/stock/doctype/serial_no/__init__.py similarity index 100% rename from stock/doctype/serial_no/__init__.py rename to erpnext/stock/doctype/serial_no/__init__.py diff --git a/stock/doctype/serial_no/serial_no.js b/erpnext/stock/doctype/serial_no/serial_no.js similarity index 100% rename from stock/doctype/serial_no/serial_no.js rename to erpnext/stock/doctype/serial_no/serial_no.js diff --git a/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py similarity index 99% rename from stock/doctype/serial_no/serial_no.py rename to erpnext/stock/doctype/serial_no/serial_no.py index bd2704d8ac0..9c1da65e9e9 100644 --- a/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -8,7 +8,7 @@ from webnotes.utils import cint, getdate, cstr, flt, add_days import datetime from webnotes import _, ValidationError -from controllers.stock_controller import StockController +from erpnext.controllers.stock_controller import StockController class SerialNoCannotCreateDirectError(ValidationError): pass class SerialNoCannotCannotChangeError(ValidationError): pass diff --git a/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.txt similarity index 100% rename from stock/doctype/serial_no/serial_no.txt rename to erpnext/stock/doctype/serial_no/serial_no.txt diff --git a/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py similarity index 93% rename from stock/doctype/serial_no/test_serial_no.py rename to erpnext/stock/doctype/serial_no/test_serial_no.py index 8ce36cdc4b8..fb2336147a6 100644 --- a/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -10,7 +10,7 @@ import webnotes, unittest test_dependencies = ["Item"] test_records = [] -from stock.doctype.serial_no.serial_no import * +from erpnext.stock.doctype.serial_no.serial_no import * class TestSerialNo(unittest.TestCase): def test_cannot_create_direct(self): diff --git a/stock/doctype/stock_entry/README.md b/erpnext/stock/doctype/stock_entry/README.md similarity index 100% rename from stock/doctype/stock_entry/README.md rename to erpnext/stock/doctype/stock_entry/README.md diff --git a/stock/doctype/stock_entry/__init__.py b/erpnext/stock/doctype/stock_entry/__init__.py similarity index 100% rename from stock/doctype/stock_entry/__init__.py rename to erpnext/stock/doctype/stock_entry/__init__.py diff --git a/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js similarity index 97% rename from stock/doctype/stock_entry/stock_entry.js rename to erpnext/stock/doctype/stock_entry/stock_entry.js index 73fd441f766..ec46685059e 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -4,7 +4,7 @@ cur_frm.cscript.tname = "Stock Entry Detail"; cur_frm.cscript.fname = "mtn_details"; -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); wn.provide("erpnext.stock"); erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ @@ -99,7 +99,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ account_for = "stock_received_but_not_billed"; return this.frm.call({ - method: "accounts.utils.get_company_default", + method: "erpnext.accounts.utils.get_company_default", args: { "fieldname": account_for, "company": this.frm.doc.company @@ -167,8 +167,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ if(this.frm.doc.purpose === "Sales Return") { if(this.frm.doc.delivery_note_no && this.frm.doc.sales_invoice_no) { // both specified - msgprint(wn._("You can not enter both Delivery Note No and Sales Invoice No. \ - Please enter any one.")); + msgprint(wn._("You can not enter both Delivery Note No and Sales Invoice No. Please enter any one.")); } else if(!(this.frm.doc.delivery_note_no || this.frm.doc.sales_invoice_no)) { // none specified @@ -386,9 +385,9 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) { - return{ query:"controllers.queries.customer_query" } + return{ query: "erpnext.controllers.queries.customer_query" } } cur_frm.fields_dict.supplier.get_query = function(doc, cdt, cdn) { - return{ query:"controllers.queries.supplier_query" } + return{ query: "erpnext.controllers.queries.supplier_query" } } diff --git a/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py similarity index 96% rename from stock/doctype/stock_entry/stock_entry.py rename to erpnext/stock/doctype/stock_entry/stock_entry.py index ba0e72478ce..078b8f57d88 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -10,9 +10,9 @@ from webnotes.model.doc import addchild from webnotes.model.bean import getlist from webnotes.model.code import get_obj from webnotes import msgprint, _ -from stock.utils import get_incoming_rate -from stock.stock_ledger import get_previous_sle -from controllers.queries import get_match_cond +from erpnext.stock.utils import get_incoming_rate +from erpnext.stock.stock_ledger import get_previous_sle +from erpnext.controllers.queries import get_match_cond import json @@ -22,7 +22,7 @@ class IncorrectValuationRateError(webnotes.ValidationError): pass class DuplicateEntryForProductionOrderError(webnotes.ValidationError): pass class StockOverProductionError(webnotes.ValidationError): pass -from controllers.stock_controller import StockController +from erpnext.controllers.stock_controller import StockController class DocType(StockController): def __init__(self, doc, doclist=None): @@ -53,7 +53,7 @@ class DocType(StockController): def on_submit(self): self.update_stock_ledger() - from stock.doctype.serial_no.serial_no import update_serial_nos_after_submit + from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit update_serial_nos_after_submit(self, "mtn_details") self.update_production_order() self.make_gl_entries() @@ -64,8 +64,8 @@ class DocType(StockController): self.make_cancel_gl_entries() def validate_fiscal_year(self): - import accounts.utils - accounts.utils.validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, + from erpnext.accounts.utils import validate_fiscal_year + validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, self.meta.get_label("posting_date")) def validate_purpose(self): @@ -243,9 +243,7 @@ class DocType(StockController): for d in getlist(self.doclist, 'mtn_details'): if d.bom_no and flt(d.transfer_qty) != flt(self.doc.fg_completed_qty): msgprint(_("Row #") + " %s: " % d.idx - + _("Quantity should be equal to Manufacturing Quantity. ") - + _("To fetch items again, click on 'Get Items' button \ - or update the Quantity manually."), raise_exception=1) + + _("Quantity should be equal to Manufacturing Quantity. To fetch items again, click on 'Get Items' button or update the Quantity manually."), raise_exception=1) def validate_return_reference_doc(self): """validate item with reference doc""" @@ -287,9 +285,15 @@ class DocType(StockController): # validate quantity <= ref item's qty - qty already returned ref_item = ref.doclist.getone({"item_code": item.item_code}) returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code)) - self.validate_value("transfer_qty", "<=", returnable_qty, item, - raise_exception=StockOverReturnError) - + if not returnable_qty: + webnotes.throw("{item}: {item_code} {returned}".format( + item=_("Item"), item_code=item.item_code, + returned=_("already returned though some other documents")), StockOverReturnError) + elif item.transfer_qty > returnable_qty: + webnotes.throw("{item}: {item_code}, {returned}: {qty}".format( + item=_("Item"), item_code=item.item_code, + returned=_("Max Returnable Qty"), qty=returnable_qty)) + def get_already_returned_item_qty(self, ref_fieldname): return dict(webnotes.conn.sql("""select item_code, sum(transfer_qty) as qty from `tabStock Entry Detail` where parent in ( @@ -356,7 +360,7 @@ class DocType(StockController): where name=%s""", (status, produced_qty, self.doc.production_order)) def update_planned_qty(self, pro_bean): - from stock.utils import update_bin + from erpnext.stock.utils import update_bin update_bin({ "item_code": pro_bean.doc.production_item, "warehouse": pro_bean.doc.fg_warehouse, @@ -495,7 +499,7 @@ class DocType(StockController): self.get_stock_and_rate() def get_bom_raw_materials(self, qty): - from manufacturing.doctype.bom.bom import get_bom_items_as_dict + from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict # item dict = { item_code: {qty, description, stock_uom} } item_dict = get_bom_items_as_dict(self.doc.bom_no, qty=qty, fetch_exploded = self.doc.use_multi_level_bom) @@ -601,7 +605,7 @@ class DocType(StockController): return result and result[0] or {} def get_cust_addr(self): - from utilities.transaction_base import get_default_address, get_address_display + from erpnext.utilities.transaction_base import get_default_address, get_address_display res = webnotes.conn.sql("select customer_name from `tabCustomer` where name = '%s'"%self.doc.customer) address_display = None customer_address = get_default_address("customer", self.doc.customer) @@ -622,7 +626,7 @@ class DocType(StockController): return result and result[0] or {} def get_supp_addr(self): - from utilities.transaction_base import get_default_address, get_address_display + from erpnext.utilities.transaction_base import get_default_address, get_address_display res = webnotes.conn.sql("""select supplier_name from `tabSupplier` where name=%s""", self.doc.supplier) address_display = None @@ -811,7 +815,7 @@ def make_return_jv(stock_entry): "company": se.doc.company }] - from accounts.utils import get_balance_on + from erpnext.accounts.utils import get_balance_on for r in result: jv_list.append({ "__islocal": 1, diff --git a/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt similarity index 100% rename from stock/doctype/stock_entry/stock_entry.txt rename to erpnext/stock/doctype/stock_entry/stock_entry.txt diff --git a/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py similarity index 95% rename from stock/doctype/stock_entry/test_stock_entry.py rename to erpnext/stock/doctype/stock_entry/test_stock_entry.py index 781fca44550..1d7c2e444dc 100644 --- a/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -4,8 +4,8 @@ from __future__ import unicode_literals import webnotes, unittest from webnotes.utils import flt -from stock.doctype.serial_no.serial_no import * -from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory +from erpnext.stock.doctype.serial_no.serial_no import * +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory class TestStockEntry(unittest.TestCase): def tearDown(self): @@ -29,7 +29,7 @@ class TestStockEntry(unittest.TestCase): st2.insert() st2.submit() - from stock.utils import reorder_item + from erpnext.stock.utils import reorder_item reorder_item() mr_name = webnotes.conn.sql("""select parent from `tabMaterial Request Item` @@ -232,9 +232,9 @@ class TestStockEntry(unittest.TestCase): "warehouse": "_Test Warehouse - _TC"}, "actual_qty")) def _test_sales_invoice_return(self, item_code, delivered_qty, returned_qty): - from stock.doctype.stock_entry.stock_entry import NotUpdateStockError + from erpnext.stock.doctype.stock_entry.stock_entry import NotUpdateStockError - from accounts.doctype.sales_invoice.test_sales_invoice \ + from erpnext.accounts.doctype.sales_invoice.test_sales_invoice \ import test_records as sales_invoice_test_records # invalid sales invoice as update stock not checked @@ -312,10 +312,10 @@ class TestStockEntry(unittest.TestCase): def _test_delivery_note_return(self, item_code, delivered_qty, returned_qty): self._insert_material_receipt() - from stock.doctype.delivery_note.test_delivery_note \ + from erpnext.stock.doctype.delivery_note.test_delivery_note \ import test_records as delivery_note_test_records - from stock.doctype.delivery_note.delivery_note import make_sales_invoice + from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice actual_qty_0 = self._get_actual_qty() # make a delivery note based on this invoice @@ -364,7 +364,7 @@ class TestStockEntry(unittest.TestCase): self._test_delivery_note_return("_Test Sales BOM Item", 25, 20) def _test_sales_return_jv(self, se): - from stock.doctype.stock_entry.stock_entry import make_return_jv + from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv jv_list = make_return_jv(se.doc.name) self.assertEqual(len(jv_list), 3) @@ -403,8 +403,8 @@ class TestStockEntry(unittest.TestCase): def _test_delivery_note_return_against_sales_order(self, item_code, delivered_qty, returned_qty): self._insert_material_receipt() - from selling.doctype.sales_order.test_sales_order import test_records as sales_order_test_records - from selling.doctype.sales_order.sales_order import make_sales_invoice, make_delivery_note + from erpnext.selling.doctype.sales_order.test_sales_order import test_records as sales_order_test_records + from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice, make_delivery_note actual_qty_0 = self._get_actual_qty() @@ -458,10 +458,10 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() - from stock.doctype.purchase_receipt.test_purchase_receipt \ + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \ import test_records as purchase_receipt_test_records - from stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice + from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice # submit purchase receipt pr = webnotes.bean(copy=purchase_receipt_test_records[0]) @@ -509,7 +509,7 @@ class TestStockEntry(unittest.TestCase): return se, pr.doc.name def test_over_stock_return(self): - from stock.doctype.stock_entry.stock_entry import StockOverReturnError + from erpnext.stock.doctype.stock_entry.stock_entry import StockOverReturnError self._clear_stock_account_balance() # out of 10, 5 gets returned @@ -527,7 +527,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(StockOverReturnError, se.insert) def _test_purchase_return_jv(self, se): - from stock.doctype.stock_entry.stock_entry import make_return_jv + from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv jv_list = make_return_jv(se.doc.name) self.assertEqual(len(jv_list), 3) @@ -550,10 +550,10 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() - from buying.doctype.purchase_order.test_purchase_order \ + from erpnext.buying.doctype.purchase_order.test_purchase_order \ import test_records as purchase_order_test_records - from buying.doctype.purchase_order.purchase_order import \ + from erpnext.buying.doctype.purchase_order.purchase_order import \ make_purchase_receipt, make_purchase_invoice # submit purchase receipt @@ -767,7 +767,7 @@ class TestStockEntry(unittest.TestCase): .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") webnotes.set_user("test2@example.com") - from stock.utils import InvalidWarehouseCompany + from erpnext.stock.utils import InvalidWarehouseCompany st1 = webnotes.bean(copy=test_records[0]) st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() diff --git a/stock/doctype/stock_entry_detail/README.md b/erpnext/stock/doctype/stock_entry_detail/README.md similarity index 100% rename from stock/doctype/stock_entry_detail/README.md rename to erpnext/stock/doctype/stock_entry_detail/README.md diff --git a/stock/doctype/stock_entry_detail/__init__.py b/erpnext/stock/doctype/stock_entry_detail/__init__.py similarity index 100% rename from stock/doctype/stock_entry_detail/__init__.py rename to erpnext/stock/doctype/stock_entry_detail/__init__.py diff --git a/stock/doctype/stock_entry_detail/stock_entry_detail.py b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py similarity index 100% rename from stock/doctype/stock_entry_detail/stock_entry_detail.py rename to erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py diff --git a/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt similarity index 100% rename from stock/doctype/stock_entry_detail/stock_entry_detail.txt rename to erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt diff --git a/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py similarity index 96% rename from stock/doctype/stock_ledger/stock_ledger.py rename to erpnext/stock/doctype/stock_ledger/stock_ledger.py index 062d70f9277..f44e5e3599a 100644 --- a/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -9,7 +9,7 @@ from webnotes.model.doc import Document from webnotes.model.bean import getlist from webnotes.model.code import get_obj from webnotes import session, msgprint -from stock.utils import get_valid_serial_nos +from erpnext.stock.utils import get_valid_serial_nos class DocType: diff --git a/stock/doctype/stock_ledger_entry/README.md b/erpnext/stock/doctype/stock_ledger_entry/README.md similarity index 100% rename from stock/doctype/stock_ledger_entry/README.md rename to erpnext/stock/doctype/stock_ledger_entry/README.md diff --git a/stock/doctype/stock_ledger_entry/__init__.py b/erpnext/stock/doctype/stock_ledger_entry/__init__.py similarity index 100% rename from stock/doctype/stock_ledger_entry/__init__.py rename to erpnext/stock/doctype/stock_ledger_entry/__init__.py diff --git a/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py similarity index 95% rename from stock/doctype/stock_ledger_entry/stock_ledger_entry.py rename to erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index e988434cb94..e43761ce78d 100644 --- a/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -13,20 +13,20 @@ class DocType(DocListController): self.doclist = doclist def validate(self): - from stock.utils import validate_warehouse_company + from erpnext.stock.utils import validate_warehouse_company self.validate_mandatory() self.validate_item() validate_warehouse_company(self.doc.warehouse, self.doc.company) self.scrub_posting_time() - 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, self.meta.get_label("posting_date")) def on_submit(self): self.check_stock_frozen_date() self.actual_amt_check() - from stock.doctype.serial_no.serial_no import process_serial_no + from erpnext.stock.doctype.serial_no.serial_no import process_serial_no process_serial_no(self.doc) #check for item quantity available in stock diff --git a/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt similarity index 100% rename from stock/doctype/stock_ledger_entry/stock_ledger_entry.txt rename to erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt diff --git a/stock/doctype/stock_reconciliation/README.md b/erpnext/stock/doctype/stock_reconciliation/README.md similarity index 100% rename from stock/doctype/stock_reconciliation/README.md rename to erpnext/stock/doctype/stock_reconciliation/README.md diff --git a/stock/doctype/stock_reconciliation/__init__.py b/erpnext/stock/doctype/stock_reconciliation/__init__.py similarity index 100% rename from stock/doctype/stock_reconciliation/__init__.py rename to erpnext/stock/doctype/stock_reconciliation/__init__.py diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js similarity index 94% rename from stock/doctype/stock_reconciliation/stock_reconciliation.js rename to erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js index fc502461d1f..48f3e458633 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("public/app/js/controllers/stock_controller.js"); +wn.require("assets/erpnext/js/controllers/stock_controller.js"); wn.provide("erpnext.stock"); erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ @@ -14,7 +14,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ if (sys_defaults.auto_accounting_for_stock && !this.frm.doc.expense_account) { return this.frm.call({ - method: "accounts.utils.get_company_default", + method: "erpnext.accounts.utils.get_company_default", args: { "fieldname": "stock_adjustment_account", "company": this.frm.doc.company @@ -50,8 +50,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ if(this.frm.doc.reconciliation_json) { this.frm.set_intro(wn._("You can submit this Stock Reconciliation.")); } else { - this.frm.set_intro(wn._("Download the Template, fill appropriate data and \ - attach the modified file.")); + this.frm.set_intro(wn._("Download the Template, fill appropriate data and attach the modified file.")); } } else if(this.frm.doc.docstatus == 1) { this.frm.set_intro(wn._("Cancelling this Stock Reconciliation will nullify its effect.")); @@ -94,7 +93,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ wn.upload.make({ parent: $wrapper, args: { - method: 'stock.doctype.stock_reconciliation.stock_reconciliation.upload' + method: 'erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.upload' }, sample_url: "e.g. http://example.com/somefile.csv", callback: function(fid, filename, r) { diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py similarity index 95% rename from stock/doctype/stock_reconciliation/stock_reconciliation.py rename to erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 01ded1aa7f3..f219aa06a56 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -7,9 +7,9 @@ import webnotes.defaults import json from webnotes import msgprint, _ from webnotes.utils import cstr, flt, cint -from stock.stock_ledger import update_entries_after -from controllers.stock_controller import StockController -from stock.utils import update_bin +from erpnext.stock.stock_ledger import update_entries_after +from erpnext.controllers.stock_controller import StockController +from erpnext.stock.utils import update_bin class DocType(StockController): def setup(self): @@ -90,7 +90,7 @@ class DocType(StockController): raise webnotes.ValidationError def validate_item(self, item_code, row_num): - from stock.utils import validate_end_of_life, validate_is_stock_item, \ + from erpnext.stock.utils import validate_end_of_life, validate_is_stock_item, \ validate_cancelled_item # using try except to catch all validation msgs and display together @@ -118,8 +118,8 @@ class DocType(StockController): def insert_stock_ledger_entries(self): """ find difference between current and expected entries and create stock ledger entries based on the difference""" - from stock.utils import get_valuation_method - from stock.stock_ledger import get_previous_sle + from erpnext.stock.utils import get_valuation_method + from erpnext.stock.stock_ledger import get_previous_sle row_template = ["item_code", "warehouse", "qty", "valuation_rate"] @@ -140,10 +140,9 @@ class DocType(StockController): # check valuation rate mandatory if row.qty != "" and not row.valuation_rate and \ flt(previous_sle.get("qty_after_transaction")) <= 0: - webnotes.msgprint(_("As existing qty for item: ") + row.item_code + + webnotes.throw(_("As existing qty for item: ") + row.item_code + _(" at warehouse: ") + row.warehouse + - _(" is less than equals to zero in the system, \ - valuation rate is mandatory for this item"), raise_exception=1) + _(" is less than equals to zero in the system, valuation rate is mandatory for this item")) change_in_qty = row.qty != "" and \ (flt(row.qty) - flt(previous_sle.get("qty_after_transaction"))) diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt similarity index 100% rename from stock/doctype/stock_reconciliation/stock_reconciliation.txt rename to erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt diff --git a/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py similarity index 98% rename from stock/doctype/stock_reconciliation/test_stock_reconciliation.py rename to erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 984e5089957..287395f515d 100644 --- a/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -8,7 +8,7 @@ from __future__ import unicode_literals import webnotes, unittest from webnotes.utils import flt import json -from accounts.utils import get_fiscal_year, get_stock_and_account_difference, get_balance_on +from erpnext.accounts.utils import get_fiscal_year, get_stock_and_account_difference, get_balance_on class TestStockReconciliation(unittest.TestCase): diff --git a/stock/doctype/delivery_note/templates/__init__.py b/erpnext/stock/doctype/stock_settings/__init__.py similarity index 100% rename from stock/doctype/delivery_note/templates/__init__.py rename to erpnext/stock/doctype/stock_settings/__init__.py diff --git a/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py similarity index 87% rename from stock/doctype/stock_settings/stock_settings.py rename to erpnext/stock/doctype/stock_settings/stock_settings.py index 48e1ee16198..e3e29b9f188 100644 --- a/stock/doctype/stock_settings/stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/stock_settings.py @@ -16,7 +16,7 @@ class DocType: "allow_negative_stock"]: 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("Item", "item_code", self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True) diff --git a/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.txt similarity index 100% rename from stock/doctype/stock_settings/stock_settings.txt rename to erpnext/stock/doctype/stock_settings/stock_settings.txt diff --git a/stock/doctype/stock_uom_replace_utility/README.md b/erpnext/stock/doctype/stock_uom_replace_utility/README.md similarity index 100% rename from stock/doctype/stock_uom_replace_utility/README.md rename to erpnext/stock/doctype/stock_uom_replace_utility/README.md diff --git a/stock/doctype/stock_uom_replace_utility/__init__.py b/erpnext/stock/doctype/stock_uom_replace_utility/__init__.py similarity index 100% rename from stock/doctype/stock_uom_replace_utility/__init__.py rename to erpnext/stock/doctype/stock_uom_replace_utility/__init__.py diff --git a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js similarity index 100% rename from stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js rename to erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js diff --git a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py similarity index 98% rename from stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py rename to erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 5441c24c1c3..2644995b944 100644 --- a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -58,7 +58,7 @@ class DocType: def update_stock_ledger_entry(self): # update stock ledger entry - from stock.stock_ledger import update_entries_after + from erpnext.stock.stock_ledger import update_entries_after if flt(self.doc.conversion_factor) != flt(1): webnotes.conn.sql("update `tabStock Ledger Entry` set stock_uom = '%s', actual_qty = ifnull(actual_qty,0) * '%s' where item_code = '%s' " % (self.doc.new_stock_uom, self.doc.conversion_factor, self.doc.item_code)) diff --git a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt similarity index 100% rename from stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt rename to erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt diff --git a/stock/doctype/uom_conversion_detail/README.md b/erpnext/stock/doctype/uom_conversion_detail/README.md similarity index 100% rename from stock/doctype/uom_conversion_detail/README.md rename to erpnext/stock/doctype/uom_conversion_detail/README.md diff --git a/stock/doctype/uom_conversion_detail/__init__.py b/erpnext/stock/doctype/uom_conversion_detail/__init__.py similarity index 100% rename from stock/doctype/uom_conversion_detail/__init__.py rename to erpnext/stock/doctype/uom_conversion_detail/__init__.py diff --git a/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py similarity index 100% rename from stock/doctype/uom_conversion_detail/uom_conversion_detail.py rename to erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py diff --git a/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt similarity index 100% rename from stock/doctype/uom_conversion_detail/uom_conversion_detail.txt rename to erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt diff --git a/stock/doctype/warehouse/README.md b/erpnext/stock/doctype/warehouse/README.md similarity index 100% rename from stock/doctype/warehouse/README.md rename to erpnext/stock/doctype/warehouse/README.md diff --git a/stock/doctype/warehouse/__init__.py b/erpnext/stock/doctype/warehouse/__init__.py similarity index 100% rename from stock/doctype/warehouse/__init__.py rename to erpnext/stock/doctype/warehouse/__init__.py diff --git a/stock/doctype/warehouse/test_warehouse.py b/erpnext/stock/doctype/warehouse/test_warehouse.py similarity index 100% rename from stock/doctype/warehouse/test_warehouse.py rename to erpnext/stock/doctype/warehouse/test_warehouse.py diff --git a/stock/doctype/warehouse/warehouse.js b/erpnext/stock/doctype/warehouse/warehouse.js similarity index 100% rename from stock/doctype/warehouse/warehouse.js rename to erpnext/stock/doctype/warehouse/warehouse.js diff --git a/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py similarity index 84% rename from stock/doctype/warehouse/warehouse.py rename to erpnext/stock/doctype/warehouse/warehouse.py index 8b1b5b5a1d4..7729b2e59e8 100644 --- a/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -20,6 +20,19 @@ class DocType: if self.doc.email_id and not validate_email_add(self.doc.email_id): msgprint("Please enter valid Email Id", raise_exception=1) + self.update_parent_account() + + def update_parent_account(self): + if not self.doc.__islocal and (self.doc.create_account_under != + webnotes.conn.get_value("Warehouse", self.doc.name, "create_account_under")): + warehouse_account = webnotes.conn.get_value("Account", + {"account_type": "Warehouse", "company": self.doc.company, + "master_name": self.doc.name}, ["name", "parent_account"]) + if warehouse_account and warehouse_account[1] != self.doc.create_account_under: + acc_bean = webnotes.bean("Account", warehouse_account[0]) + acc_bean.doc.parent_account = self.doc.create_account_under + acc_bean.save() + def on_update(self): self.create_account_head() @@ -80,7 +93,7 @@ class DocType: 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_warehouse = get_name_with_abbr(newdn, self.doc.company) if merge: @@ -92,7 +105,7 @@ class DocType: webnotes.conn.sql("delete from `tabBin` where warehouse=%s", olddn) - from accounts.utils import rename_account_for + from erpnext.accounts.utils import rename_account_for rename_account_for("Warehouse", olddn, new_warehouse, merge) return new_warehouse @@ -102,7 +115,7 @@ class DocType: self.recalculate_bin_qty(newdn) def recalculate_bin_qty(self, newdn): - from utilities.repost_stock import repost_stock + from erpnext.utilities.repost_stock import repost_stock webnotes.conn.auto_commit_on_many_writes = 1 webnotes.conn.set_default("allow_negative_stock", 1) diff --git a/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt similarity index 100% rename from stock/doctype/warehouse/warehouse.txt rename to erpnext/stock/doctype/warehouse/warehouse.txt diff --git a/stock/doctype/warehouse_user/README.md b/erpnext/stock/doctype/warehouse_user/README.md similarity index 100% rename from stock/doctype/warehouse_user/README.md rename to erpnext/stock/doctype/warehouse_user/README.md diff --git a/stock/doctype/delivery_note/templates/pages/__init__.py b/erpnext/stock/doctype/warehouse_user/__init__.py similarity index 100% rename from stock/doctype/delivery_note/templates/pages/__init__.py rename to erpnext/stock/doctype/warehouse_user/__init__.py diff --git a/stock/doctype/warehouse_user/warehouse_user.py b/erpnext/stock/doctype/warehouse_user/warehouse_user.py similarity index 100% rename from stock/doctype/warehouse_user/warehouse_user.py rename to erpnext/stock/doctype/warehouse_user/warehouse_user.py diff --git a/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt similarity index 100% rename from stock/doctype/warehouse_user/warehouse_user.txt rename to erpnext/stock/doctype/warehouse_user/warehouse_user.txt diff --git a/stock/page/__init__.py b/erpnext/stock/page/__init__.py similarity index 100% rename from stock/page/__init__.py rename to erpnext/stock/page/__init__.py diff --git a/erpnext/stock/page/stock_ageing/README.md b/erpnext/stock/page/stock_ageing/README.md new file mode 100644 index 00000000000..e8597b21942 --- /dev/null +++ b/erpnext/stock/page/stock_ageing/README.md @@ -0,0 +1 @@ +Average "age" of an Item in a particular Warehouse based on First-in-first-out (FIFO). \ No newline at end of file diff --git a/stock/page/stock_analytics/__init__.py b/erpnext/stock/page/stock_ageing/__init__.py similarity index 100% rename from stock/page/stock_analytics/__init__.py rename to erpnext/stock/page/stock_ageing/__init__.py diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.js b/erpnext/stock/page/stock_ageing/stock_ageing.js new file mode 100644 index 00000000000..33dbf542c79 --- /dev/null +++ b/erpnext/stock/page/stock_ageing/stock_ageing.js @@ -0,0 +1,183 @@ +// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + + +wn.pages['stock-ageing'].onload = function(wrapper) { + wn.ui.make_app_page({ + parent: wrapper, + title: wn._('Stock Ageing'), + single_column: true + }); + + new erpnext.StockAgeing(wrapper); + + + wrapper.appframe.add_module_icon("Stock") + +} + +wn.require("assets/erpnext/js/stock_grid_report.js"); + +erpnext.StockAgeing = erpnext.StockGridReport.extend({ + init: function(wrapper) { + this._super({ + title: wn._("Stock Ageing"), + page: wrapper, + parent: $(wrapper).find('.layout-main'), + appframe: wrapper.appframe, + doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Item Group", "Brand", "Serial No"], + }) + }, + setup_columns: function() { + this.columns = [ + {id: "name", name: wn._("Item"), field: "name", width: 300, + link_formatter: { + open_btn: true, + doctype: '"Item"' + }}, + {id: "item_name", name: wn._("Item Name"), field: "item_name", + width: 100, formatter: this.text_formatter}, + {id: "description", name: wn._("Description"), field: "description", + width: 200, formatter: this.text_formatter}, + {id: "brand", name: wn._("Brand"), field: "brand", width: 100}, + {id: "average_age", name: wn._("Average Age"), field: "average_age", + formatter: this.currency_formatter}, + {id: "earliest", name: wn._("Earliest"), field: "earliest", + formatter: this.currency_formatter}, + {id: "latest", name: wn._("Latest"), field: "latest", + formatter: this.currency_formatter}, + {id: "stock_uom", name: "UOM", field: "stock_uom", width: 100}, + ]; + }, + filters: [ + {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse", + default_value: "Select Warehouse..."}, + {fieldtype:"Select", label: wn._("Brand"), link:"Brand", + default_value: "Select Brand...", filter: function(val, item, opts) { + return val == opts.default_value || item.brand == val; + }, link_formatter: {filter_input: "brand"}}, + {fieldtype:"Select", label: wn._("Plot By"), + options: ["Average Age", "Earliest", "Latest"]}, + {fieldtype:"Date", label: wn._("To Date")}, + {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white"}, + {fieldtype:"Button", label: wn._("Reset Filters")} + ], + setup_filters: function() { + var me = this; + this._super(); + this.trigger_refresh_on_change(["warehouse", "plot_by", "brand"]); + this.show_zero_check(); + }, + init_filter_values: function() { + this._super(); + this.filter_inputs.to_date.val(dateutil.obj_to_user(new Date())); + }, + prepare_data: function() { + var me = this; + + if(!this.data) { + me._data = wn.report_dump.data["Item"]; + me.item_by_name = me.make_name_map(me._data); + } + + this.data = [].concat(this._data); + + this.serialized_buying_rates = this.get_serialized_buying_rates(); + + $.each(this.data, function(i, d) { + me.reset_item_values(d); + }); + + this.prepare_balances(); + + // filter out brand + this.data = $.map(this.data, function(d) { + return me.apply_filter(d, "brand") ? d : null; + }); + + // filter out rows with zero values + this.data = $.map(this.data, function(d) { + return me.apply_zero_filter(null, d, null, me) ? d : null; + }); + }, + prepare_balances: function() { + var me = this; + var to_date = dateutil.str_to_obj(this.to_date); + var data = wn.report_dump.data["Stock Ledger Entry"]; + + this.item_warehouse = {}; + + for(var i=0, j=data.length; i to_date) + break; + } + } + + $.each(me.data, function(i, item) { + var full_fifo_stack = []; + if(me.is_default("warehouse")) { + $.each(me.item_warehouse[item.name] || {}, function(i, wh) { + full_fifo_stack = full_fifo_stack.concat(wh.fifo_stack || []) + }); + } else { + full_fifo_stack = me.get_item_warehouse(me.warehouse, item.name).fifo_stack || []; + } + + var age_qty = total_qty = 0.0; + var min_age = max_age = null; + + $.each(full_fifo_stack, function(i, batch) { + var batch_age = dateutil.get_diff(me.to_date, batch[2]); + age_qty += batch_age * batch[0]; + total_qty += batch[0]; + max_age = Math.max(max_age, batch_age); + if(min_age===null) min_age=batch_age; + else min_age = Math.min(min_age, batch_age); + }); + + item.average_age = total_qty.toFixed(2)==0.0 ? 0 + : (age_qty / total_qty).toFixed(2); + item.earliest = max_age || 0.0; + item.latest = min_age || 0.0; + }); + + this.data = this.data.sort(function(a, b) { + var sort_by = me.plot_by.replace(" ", "_").toLowerCase(); + return b[sort_by] - a[sort_by]; + }); + }, + get_plot_data: function() { + var data = []; + var me = this; + + data.push({ + label: me.plot_by, + data: $.map(me.data, function(item, idx) { + return [[idx+1, item[me.plot_by.replace(" ", "_").toLowerCase() ]]] + }), + bars: {show: true}, + }); + + return data.length ? data : false; + }, + get_plot_options: function() { + var me = this; + return { + grid: { hoverable: true, clickable: true }, + xaxis: { + ticks: $.map(me.data, function(item, idx) { return [[idx+1, item.name]] }), + max: 15 + }, + series: { downsample: { threshold: 1000 } } + } + } +}); \ No newline at end of file diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.txt b/erpnext/stock/page/stock_ageing/stock_ageing.txt new file mode 100644 index 00000000000..cd1cfbd1c9a --- /dev/null +++ b/erpnext/stock/page/stock_ageing/stock_ageing.txt @@ -0,0 +1,37 @@ +[ + { + "creation": "2012-09-21 20:15:14", + "docstatus": 0, + "modified": "2013-07-11 14:44:08", + "modified_by": "Administrator", + "owner": "Administrator" + }, + { + "doctype": "Page", + "icon": "icon-table", + "module": "Stock", + "name": "__common__", + "page_name": "stock-ageing", + "standard": "Yes", + "title": "Stock Ageing" + }, + { + "doctype": "Page Role", + "name": "__common__", + "parent": "stock-ageing", + "parentfield": "roles", + "parenttype": "Page" + }, + { + "doctype": "Page", + "name": "stock-ageing" + }, + { + "doctype": "Page Role", + "role": "Analytics" + }, + { + "doctype": "Page Role", + "role": "Material Manager" + } +] \ No newline at end of file diff --git a/stock/page/stock_analytics/README.md b/erpnext/stock/page/stock_analytics/README.md similarity index 100% rename from stock/page/stock_analytics/README.md rename to erpnext/stock/page/stock_analytics/README.md diff --git a/stock/page/stock_home/__init__.py b/erpnext/stock/page/stock_analytics/__init__.py similarity index 100% rename from stock/page/stock_home/__init__.py rename to erpnext/stock/page/stock_analytics/__init__.py diff --git a/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js similarity index 88% rename from stock/page/stock_analytics/stock_analytics.js rename to erpnext/stock/page/stock_analytics/stock_analytics.js index 3fb4a85e6e4..ba2c55a2d1e 100644 --- a/stock/page/stock_analytics/stock_analytics.js +++ b/erpnext/stock/page/stock_analytics/stock_analytics.js @@ -16,4 +16,4 @@ wn.pages['stock-analytics'].onload = function(wrapper) { } -wn.require("app/js/stock_analytics.js"); \ No newline at end of file +wn.require("assets/erpnext/js/stock_analytics.js"); \ No newline at end of file diff --git a/stock/page/stock_analytics/stock_analytics.txt b/erpnext/stock/page/stock_analytics/stock_analytics.txt similarity index 100% rename from stock/page/stock_analytics/stock_analytics.txt rename to erpnext/stock/page/stock_analytics/stock_analytics.txt diff --git a/stock/page/stock_balance/README.md b/erpnext/stock/page/stock_balance/README.md similarity index 100% rename from stock/page/stock_balance/README.md rename to erpnext/stock/page/stock_balance/README.md diff --git a/stock/doctype/item/templates/__init__.py b/erpnext/stock/page/stock_balance/__init__.py similarity index 100% rename from stock/doctype/item/templates/__init__.py rename to erpnext/stock/page/stock_balance/__init__.py diff --git a/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js similarity index 99% rename from stock/page/stock_balance/stock_balance.js rename to erpnext/stock/page/stock_balance/stock_balance.js index 604312fce9c..cc293a4c018 100644 --- a/stock/page/stock_balance/stock_balance.js +++ b/erpnext/stock/page/stock_balance/stock_balance.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/stock_analytics.js"); +wn.require("assets/erpnext/js/stock_analytics.js"); wn.pages['stock-balance'].onload = function(wrapper) { wn.ui.make_app_page({ diff --git a/stock/page/stock_balance/stock_balance.txt b/erpnext/stock/page/stock_balance/stock_balance.txt similarity index 100% rename from stock/page/stock_balance/stock_balance.txt rename to erpnext/stock/page/stock_balance/stock_balance.txt diff --git a/support/doctype/__init__.py b/erpnext/stock/page/stock_home/__init__.py similarity index 100% rename from support/doctype/__init__.py rename to erpnext/stock/page/stock_home/__init__.py diff --git a/stock/page/stock_home/stock_home.js b/erpnext/stock/page/stock_home/stock_home.js similarity index 100% rename from stock/page/stock_home/stock_home.js rename to erpnext/stock/page/stock_home/stock_home.js diff --git a/stock/page/stock_home/stock_home.txt b/erpnext/stock/page/stock_home/stock_home.txt similarity index 100% rename from stock/page/stock_home/stock_home.txt rename to erpnext/stock/page/stock_home/stock_home.txt diff --git a/erpnext/stock/page/stock_ledger/README.md b/erpnext/stock/page/stock_ledger/README.md new file mode 100644 index 00000000000..774498b77e4 --- /dev/null +++ b/erpnext/stock/page/stock_ledger/README.md @@ -0,0 +1 @@ +Stock movement report based on Stock Ledger Entry. \ No newline at end of file diff --git a/support/doctype/customer_issue/__init__.py b/erpnext/stock/page/stock_ledger/__init__.py similarity index 100% rename from support/doctype/customer_issue/__init__.py rename to erpnext/stock/page/stock_ledger/__init__.py diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js new file mode 100644 index 00000000000..a8a966fbc4e --- /dev/null +++ b/erpnext/stock/page/stock_ledger/stock_ledger.js @@ -0,0 +1,247 @@ +// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +wn.pages['stock-ledger'].onload = function(wrapper) { + wn.ui.make_app_page({ + parent: wrapper, + title: wn._('Stock Ledger'), + single_column: true + }); + + new erpnext.StockLedger(wrapper); + wrapper.appframe.add_module_icon("Stock") +} + +wn.require("assets/erpnext/js/stock_grid_report.js"); + +erpnext.StockLedger = erpnext.StockGridReport.extend({ + init: function(wrapper) { + this._super({ + title: wn._("Stock Ledger"), + page: wrapper, + parent: $(wrapper).find('.layout-main'), + appframe: wrapper.appframe, + doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Serial No"], + }) + }, + + setup_columns: function() { + this.hide_balance = (this.is_default("item_code") || this.voucher_no) ? true : false; + this.columns = [ + {id: "posting_datetime", name: wn._("Posting Date"), field: "posting_datetime", width: 120, + formatter: this.date_formatter}, + {id: "item_code", name: wn._("Item Code"), field: "item_code", width: 160, + link_formatter: { + filter_input: "item_code", + open_btn: true, + doctype: '"Item"', + }}, + {id: "description", name: wn._("Description"), field: "description", width: 200, + formatter: this.text_formatter}, + {id: "warehouse", name: wn._("Warehouse"), field: "warehouse", width: 100, + link_formatter: {filter_input: "warehouse"}}, + {id: "brand", name: wn._("Brand"), field: "brand", width: 100}, + {id: "stock_uom", name: wn._("UOM"), field: "stock_uom", width: 100}, + {id: "qty", name: wn._("Qty"), field: "qty", width: 100, + formatter: this.currency_formatter}, + {id: "balance", name: wn._("Balance Qty"), field: "balance", width: 100, + formatter: this.currency_formatter, + hidden: this.hide_balance}, + {id: "balance_value", name: wn._("Balance Value"), field: "balance_value", width: 100, + formatter: this.currency_formatter, hidden: this.hide_balance}, + {id: "voucher_type", name: wn._("Voucher Type"), field: "voucher_type", width: 120}, + {id: "voucher_no", name: wn._("Voucher No"), field: "voucher_no", width: 160, + link_formatter: { + filter_input: "voucher_no", + open_btn: true, + doctype: "dataContext.voucher_type" + }}, + ]; + + }, + filters: [ + {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse", + default_value: "Select Warehouse...", filter: function(val, item, opts) { + return item.warehouse == val || val == opts.default_value; + }}, + {fieldtype:"Link", label: wn._("Item Code"), link:"Item", default_value: "Select Item...", + filter: function(val, item, opts) { + return item.item_code == val || !val; + }}, + {fieldtype:"Select", label: "Brand", link:"Brand", + default_value: "Select Brand...", filter: function(val, item, opts) { + return val == opts.default_value || item.brand == val || item._show; + }, link_formatter: {filter_input: "brand"}}, + {fieldtype:"Data", label: wn._("Voucher No"), + filter: function(val, item, opts) { + if(!val) return true; + return (item.voucher_no && item.voucher_no.indexOf(val)!=-1); + }}, + {fieldtype:"Date", label: wn._("From Date"), filter: function(val, item) { + return dateutil.str_to_obj(val) <= dateutil.str_to_obj(item.posting_date); + }}, + {fieldtype:"Label", label: wn._("To")}, + {fieldtype:"Date", label: wn._("To Date"), filter: function(val, item) { + return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date); + }}, + {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white"}, + {fieldtype:"Button", label: wn._("Reset Filters")} + ], + + setup_filters: function() { + var me = this; + this._super(); + + this.wrapper.bind("apply_filters_from_route", function() { me.toggle_enable_brand(); }); + this.filter_inputs.item_code.change(function() { me.toggle_enable_brand(); }); + + this.trigger_refresh_on_change(["item_code", "warehouse", "brand"]); + }, + + toggle_enable_brand: function() { + if(!this.filter_inputs.item_code.val()) { + this.filter_inputs.brand.prop("disabled", false); + } else { + this.filter_inputs.brand + .val(this.filter_inputs.brand.get(0).opts.default_value) + .prop("disabled", true); + } + }, + + init_filter_values: function() { + this._super(); + this.filter_inputs.warehouse.get(0).selectedIndex = 0; + }, + prepare_data: function() { + var me = this; + if(!this.item_by_name) + this.item_by_name = this.make_name_map(wn.report_dump.data["Item"]); + var data = wn.report_dump.data["Stock Ledger Entry"]; + var out = []; + + var opening = { + item_code: "On " + dateutil.str_to_user(this.from_date), qty: 0.0, balance: 0.0, + id:"_opening", _show: true, _style: "font-weight: bold", balance_value: 0.0 + } + var total_in = { + item_code: "Total In", qty: 0.0, balance: 0.0, balance_value: 0.0, + id:"_total_in", _show: true, _style: "font-weight: bold" + } + var total_out = { + item_code: "Total Out", qty: 0.0, balance: 0.0, balance_value: 0.0, + id:"_total_out", _show: true, _style: "font-weight: bold" + } + + // clear balance + $.each(wn.report_dump.data["Item"], function(i, item) { + item.balance = item.balance_value = 0.0; + }); + + // initialize warehouse-item map + this.item_warehouse = {}; + this.serialized_buying_rates = this.get_serialized_buying_rates(); + var from_datetime = dateutil.str_to_obj(me.from_date + " 00:00:00"); + var to_datetime = dateutil.str_to_obj(me.to_date + " 23:59:59"); + + // + for(var i=0, j=data.length; i 0) { + total_in.qty += sl.qty; + total_in.balance_value += value_diff; + } else { + total_out.qty += (-1 * sl.qty); + total_out.balance_value += value_diff; + } + } + } + + if(!before_end) break; + + // apply filters + if(me.apply_filters(sl)) { + out.push(sl); + } + + // update balance + if((!me.is_default("warehouse") ? me.apply_filter(sl, "warehouse") : true)) { + sl.balance = me.item_by_name[sl.item_code].balance + sl.qty; + me.item_by_name[sl.item_code].balance = sl.balance; + + sl.balance_value = me.item_by_name[sl.item_code].balance_value + value_diff; + me.item_by_name[sl.item_code].balance_value = sl.balance_value; + } + } + + if(me.item_code && !me.voucher_no) { + var closing = { + item_code: "On " + dateutil.str_to_user(this.to_date), + balance: (out.length ? out[out.length-1].balance : 0), qty: 0, + balance_value: (out.length ? out[out.length-1].balance_value : 0), + id:"_closing", _show: true, _style: "font-weight: bold" + }; + total_out.balance_value = -total_out.balance_value; + var out = [opening].concat(out).concat([total_in, total_out, closing]); + } + + this.data = out; + }, + get_plot_data: function() { + var data = []; + var me = this; + if(me.hide_balance) return false; + data.push({ + label: me.item_code, + data: [[dateutil.str_to_obj(me.from_date).getTime(), me.data[0].balance]] + .concat($.map(me.data, function(col, idx) { + if (col.posting_datetime) { + return [[dateutil.str_to_obj(col.posting_datetime).getTime(), col.balance - col.qty], + [dateutil.str_to_obj(col.posting_datetime).getTime(), col.balance]] + } + return null; + })).concat([ + // closing + [dateutil.str_to_obj(me.to_date).getTime(), me.data[me.data.length - 1].balance] + ]), + points: {show: true}, + lines: {show: true, fill: true}, + }); + return data; + }, + get_plot_options: function() { + return { + grid: { hoverable: true, clickable: true }, + xaxis: { mode: "time", + min: dateutil.str_to_obj(this.from_date).getTime(), + max: dateutil.str_to_obj(this.to_date).getTime(), + }, + series: { downsample: { threshold: 1000 } } + } + }, + get_tooltip_text: function(label, x, y) { + var d = new Date(x); + var date = dateutil.obj_to_user(d) + " " + d.getHours() + ":" + d.getMinutes(); + var value = format_number(y); + return value.bold() + " on " + date; + } +}); \ No newline at end of file diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.txt b/erpnext/stock/page/stock_ledger/stock_ledger.txt new file mode 100644 index 00000000000..9c2a4b75e57 --- /dev/null +++ b/erpnext/stock/page/stock_ledger/stock_ledger.txt @@ -0,0 +1,41 @@ +[ + { + "creation": "2012-09-21 20:15:14", + "docstatus": 0, + "modified": "2013-07-11 14:44:19", + "modified_by": "Administrator", + "owner": "Administrator" + }, + { + "doctype": "Page", + "icon": "icon-table", + "module": "Stock", + "name": "__common__", + "page_name": "stock-ledger", + "standard": "Yes", + "title": "Stock Ledger" + }, + { + "doctype": "Page Role", + "name": "__common__", + "parent": "stock-ledger", + "parentfield": "roles", + "parenttype": "Page" + }, + { + "doctype": "Page", + "name": "stock-ledger" + }, + { + "doctype": "Page Role", + "role": "Analytics" + }, + { + "doctype": "Page Role", + "role": "Material Manager" + }, + { + "doctype": "Page Role", + "role": "Material User" + } +] \ No newline at end of file diff --git a/erpnext/stock/page/stock_level/README.md b/erpnext/stock/page/stock_level/README.md new file mode 100644 index 00000000000..43b2b0fbde7 --- /dev/null +++ b/erpnext/stock/page/stock_level/README.md @@ -0,0 +1 @@ +Stock levels (actual, planned, reserved, ordered) for Items on a particular date. \ No newline at end of file diff --git a/stock/doctype/item/templates/generators/__init__.py b/erpnext/stock/page/stock_level/__init__.py similarity index 100% rename from stock/doctype/item/templates/generators/__init__.py rename to erpnext/stock/page/stock_level/__init__.py diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js new file mode 100644 index 00000000000..8cef636f9b0 --- /dev/null +++ b/erpnext/stock/page/stock_level/stock_level.js @@ -0,0 +1,228 @@ +// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +wn.pages['stock-level'].onload = function(wrapper) { + wn.ui.make_app_page({ + parent: wrapper, + title: wn._('Stock Level'), + single_column: true + }); + + new erpnext.StockLevel(wrapper); + + + wrapper.appframe.add_module_icon("Stock") + ; +} + +wn.require("assets/erpnext/js/stock_grid_report.js"); + +erpnext.StockLevel = erpnext.StockGridReport.extend({ + init: function(wrapper) { + var me = this; + + this._super({ + title: wn._("Stock Level"), + page: wrapper, + parent: $(wrapper).find('.layout-main'), + appframe: wrapper.appframe, + doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Production Order", + "Material Request Item", "Purchase Order Item", "Sales Order Item", "Brand", "Serial No"], + }); + + this.wrapper.bind("make", function() { + wn.utils.set_footnote(me, me.wrapper.get(0), + "
    \ +
  • \ + Projected Qty = Actual Qty + Planned Qty + Requested Qty \ + + Ordered Qty - Reserved Qty
  • \ +
      \ +
    • "+wn._("Actual Qty: Quantity available in the warehouse.") +"
    • "+ + "
    • "+wn._("Planned Qty: Quantity, for which, Production Order has been raised,")+ + wn._("but is pending to be manufactured.")+ "
    • " + + "
    • "+wn._("Requested Qty: Quantity requested for purchase, but not ordered.") + "
    • " + + "
    • " + wn._("Ordered Qty: Quantity ordered for purchase, but not received.")+ "
    • " + + "
    • " + wn._("Reserved Qty: Quantity ordered for sale, but not delivered.") + "
    • " + + "
    \ +
"); + }); + }, + + setup_columns: function() { + this.columns = [ + {id: "item_code", name: wn._("Item Code"), field: "item_code", width: 160, + link_formatter: { + filter_input: "item_code", + open_btn: true, + doctype: '"Item"', + }}, + {id: "item_name", name: wn._("Item Name"), field: "item_name", width: 100, + formatter: this.text_formatter}, + {id: "description", name: wn._("Description"), field: "description", width: 200, + formatter: this.text_formatter}, + {id: "brand", name: wn._("Brand"), field: "brand", width: 100, + link_formatter: {filter_input: "brand"}}, + {id: "warehouse", name: wn._("Warehouse"), field: "warehouse", width: 100, + link_formatter: {filter_input: "warehouse"}}, + {id: "uom", name: wn._("UOM"), field: "uom", width: 60}, + {id: "actual_qty", name: wn._("Actual Qty"), + field: "actual_qty", width: 80, formatter: this.currency_formatter}, + {id: "planned_qty", name: wn._("Planned Qty"), + field: "planned_qty", width: 80, formatter: this.currency_formatter}, + {id: "requested_qty", name: wn._("Requested Qty"), + field: "requested_qty", width: 80, formatter: this.currency_formatter}, + {id: "ordered_qty", name: wn._("Ordered Qty"), + field: "ordered_qty", width: 80, formatter: this.currency_formatter}, + {id: "reserved_qty", name: wn._("Reserved Qty"), + field: "reserved_qty", width: 80, formatter: this.currency_formatter}, + {id: "projected_qty", name: wn._("Projected Qty"), + field: "projected_qty", width: 80, formatter: this.currency_formatter}, + {id: "re_order_level", name: wn._("Re-Order Level"), + field: "re_order_level", width: 80, formatter: this.currency_formatter}, + {id: "re_order_qty", name: wn._("Re-Order Qty"), + field: "re_order_qty", width: 80, formatter: this.currency_formatter}, + ]; + }, + + filters: [ + {fieldtype:"Link", label: wn._("Item Code"), link:"Item", default_value: "Select Item...", + filter: function(val, item, opts) { + return item.item_code == val || !val; + }}, + + {fieldtype:"Select", label: wn._("Warehouse"), link:"Warehouse", + default_value: "Select Warehouse...", filter: function(val, item, opts) { + return item.warehouse == val || val == opts.default_value; + }}, + + {fieldtype:"Select", label: wn._("Brand"), link:"Brand", + default_value: "Select Brand...", filter: function(val, item, opts) { + return val == opts.default_value || item.brand == val; + }}, + {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white"}, + {fieldtype:"Button", label: wn._("Reset Filters")} + ], + + setup_filters: function() { + var me = this; + this._super(); + + this.wrapper.bind("apply_filters_from_route", function() { me.toggle_enable_brand(); }); + this.filter_inputs.item_code.change(function() { me.toggle_enable_brand(); }); + + this.trigger_refresh_on_change(["item_code", "warehouse", "brand"]); + }, + + toggle_enable_brand: function() { + if(!this.filter_inputs.item_code.val()) { + this.filter_inputs.brand.prop("disabled", false); + } else { + this.filter_inputs.brand + .val(this.filter_inputs.brand.get(0).opts.default_value) + .prop("disabled", true); + } + }, + + init_filter_values: function() { + this._super(); + this.filter_inputs.warehouse.get(0).selectedIndex = 0; + }, + + prepare_data: function() { + var me = this; + + if(!this._data) { + this._data = []; + this.item_warehouse_map = {}; + this.item_by_name = this.make_name_map(wn.report_dump.data["Item"]); + this.calculate_quantities(); + } + + this.data = [].concat(this._data); + this.data = $.map(this.data, function(d) { + return me.apply_filters(d) ? d : null; + }); + + this.calculate_total(); + }, + + calculate_quantities: function() { + var me = this; + $.each([ + ["Stock Ledger Entry", "actual_qty"], + ["Production Order", "planned_qty"], + ["Material Request Item", "requested_qty"], + ["Purchase Order Item", "ordered_qty"], + ["Sales Order Item", "reserved_qty"]], + function(i, v) { + $.each(wn.report_dump.data[v[0]], function(i, item) { + var row = me.get_row(item.item_code, item.warehouse); + row[v[1]] += flt(item.qty); + }); + } + ); + + // sort by item, warehouse + this._data = $.map(Object.keys(this.item_warehouse_map).sort(), function(key) { + return me.item_warehouse_map[key]; + }); + + // calculate projected qty + $.each(this._data, function(i, row) { + row.projected_qty = row.actual_qty + row.planned_qty + row.requested_qty + + row.ordered_qty - row.reserved_qty; + }); + + // filter out rows with zero values + this._data = $.map(this._data, function(d) { + return me.apply_zero_filter(null, d, null, me) ? d : null; + }); + }, + + get_row: function(item_code, warehouse) { + var key = item_code + ":" + warehouse; + if(!this.item_warehouse_map[key]) { + var item = this.item_by_name[item_code]; + var row = { + item_code: item_code, + warehouse: warehouse, + description: item.description, + brand: item.brand, + item_name: item.item_name || item.name, + uom: item.stock_uom, + id: key, + } + this.reset_item_values(row); + + row["re_order_level"] = item.re_order_level + row["re_order_qty"] = item.re_order_qty + + this.item_warehouse_map[key] = row; + } + return this.item_warehouse_map[key]; + }, + + calculate_total: function() { + var me = this; + // show total if a specific item is selected and warehouse is not filtered + if(this.is_default("warehouse") && !this.is_default("item_code")) { + var total = { + id: "_total", + item_code: "Total", + _style: "font-weight: bold", + _show: true + }; + this.reset_item_values(total); + + $.each(this.data, function(i, row) { + $.each(me.columns, function(i, col) { + if (col.formatter==me.currency_formatter) { + total[col.id] += row[col.id]; + } + }); + }); + + this.data = this.data.concat([total]); + } + } +}) diff --git a/erpnext/stock/page/stock_level/stock_level.txt b/erpnext/stock/page/stock_level/stock_level.txt new file mode 100644 index 00000000000..bae3d9c9b25 --- /dev/null +++ b/erpnext/stock/page/stock_level/stock_level.txt @@ -0,0 +1,37 @@ +[ + { + "creation": "2012-12-31 10:52:14", + "docstatus": 0, + "modified": "2013-07-11 14:44:21", + "modified_by": "Administrator", + "owner": "Administrator" + }, + { + "doctype": "Page", + "icon": "icon-table", + "module": "Stock", + "name": "__common__", + "page_name": "stock-level", + "standard": "Yes", + "title": "Stock Level" + }, + { + "doctype": "Page Role", + "name": "__common__", + "parent": "stock-level", + "parentfield": "roles", + "parenttype": "Page" + }, + { + "doctype": "Page", + "name": "stock-level" + }, + { + "doctype": "Page Role", + "role": "Material Manager" + }, + { + "doctype": "Page Role", + "role": "Analytics" + } +] \ No newline at end of file diff --git a/stock/doctype/item/templates/pages/__init__.py b/erpnext/stock/report/__init__.py similarity index 100% rename from stock/doctype/item/templates/pages/__init__.py rename to erpnext/stock/report/__init__.py diff --git a/stock/doctype/item_reorder/__init__.py b/erpnext/stock/report/batch_wise_balance_history/__init__.py similarity index 100% rename from stock/doctype/item_reorder/__init__.py rename to erpnext/stock/report/batch_wise_balance_history/__init__.py diff --git a/stock/report/batch_wise_balance_history/batch_wise_balance_history.js b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js similarity index 100% rename from stock/report/batch_wise_balance_history/batch_wise_balance_history.js rename to erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js diff --git a/stock/report/batch_wise_balance_history/batch_wise_balance_history.py b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py similarity index 100% rename from stock/report/batch_wise_balance_history/batch_wise_balance_history.py rename to erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py diff --git a/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt similarity index 100% rename from stock/report/batch_wise_balance_history/batch_wise_balance_history.txt rename to erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt diff --git a/stock/doctype/item_website_specification/__init__.py b/erpnext/stock/report/delivery_note_trends/__init__.py similarity index 100% rename from stock/doctype/item_website_specification/__init__.py rename to erpnext/stock/report/delivery_note_trends/__init__.py diff --git a/stock/report/delivery_note_trends/delivery_note_trends.js b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js similarity index 78% rename from stock/report/delivery_note_trends/delivery_note_trends.js rename to erpnext/stock/report/delivery_note_trends/delivery_note_trends.js index ab0147b4966..568d982548c 100644 --- a/stock/report/delivery_note_trends/delivery_note_trends.js +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/sales_trends_filters.js"); +wn.require("assets/erpnext/js/sales_trends_filters.js"); wn.query_reports["Delivery Note Trends"] = { filters: get_filters() diff --git a/stock/report/delivery_note_trends/delivery_note_trends.py b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py similarity index 86% rename from stock/report/delivery_note_trends/delivery_note_trends.py rename to erpnext/stock/report/delivery_note_trends/delivery_note_trends.py index 6cd6f8e1d07..a3f4218a65f 100644 --- a/stock/report/delivery_note_trends/delivery_note_trends.py +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_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/stock/report/delivery_note_trends/delivery_note_trends.txt b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt similarity index 100% rename from stock/report/delivery_note_trends/delivery_note_trends.txt rename to erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt diff --git a/stock/doctype/material_request/__init__.py b/erpnext/stock/report/item_prices/__init__.py similarity index 100% rename from stock/doctype/material_request/__init__.py rename to erpnext/stock/report/item_prices/__init__.py diff --git a/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py similarity index 100% rename from stock/report/item_prices/item_prices.py rename to erpnext/stock/report/item_prices/item_prices.py diff --git a/stock/report/item_prices/item_prices.txt b/erpnext/stock/report/item_prices/item_prices.txt similarity index 100% rename from stock/report/item_prices/item_prices.txt rename to erpnext/stock/report/item_prices/item_prices.txt diff --git a/stock/doctype/material_request_item/__init__.py b/erpnext/stock/report/item_shortage_report/__init__.py similarity index 100% rename from stock/doctype/material_request_item/__init__.py rename to erpnext/stock/report/item_shortage_report/__init__.py diff --git a/stock/report/item_shortage_report/item_shortage_report.txt b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt similarity index 100% rename from stock/report/item_shortage_report/item_shortage_report.txt rename to erpnext/stock/report/item_shortage_report/item_shortage_report.txt diff --git a/stock/doctype/packed_item/__init__.py b/erpnext/stock/report/items_to_be_requested/__init__.py similarity index 100% rename from stock/doctype/packed_item/__init__.py rename to erpnext/stock/report/items_to_be_requested/__init__.py diff --git a/stock/report/items_to_be_requested/items_to_be_requested.txt b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt similarity index 100% rename from stock/report/items_to_be_requested/items_to_be_requested.txt rename to erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt diff --git a/stock/doctype/stock_settings/__init__.py b/erpnext/stock/report/itemwise_recommended_reorder_level/__init__.py similarity index 100% rename from stock/doctype/stock_settings/__init__.py rename to erpnext/stock/report/itemwise_recommended_reorder_level/__init__.py diff --git a/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js similarity index 100% rename from stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js rename to erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js diff --git a/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py similarity index 100% rename from stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py rename to erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py diff --git a/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt similarity index 100% rename from stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt rename to erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt diff --git a/stock/doctype/warehouse_user/__init__.py b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/__init__.py similarity index 100% rename from stock/doctype/warehouse_user/__init__.py rename to erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/__init__.py diff --git a/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt similarity index 100% rename from stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt rename to erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt diff --git a/stock/page/stock_balance/__init__.py b/erpnext/stock/report/ordered_items_to_be_delivered/__init__.py similarity index 100% rename from stock/page/stock_balance/__init__.py rename to erpnext/stock/report/ordered_items_to_be_delivered/__init__.py diff --git a/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt similarity index 100% rename from stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt rename to erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt diff --git a/stock/report/__init__.py b/erpnext/stock/report/purchase_in_transit/__init__.py similarity index 100% rename from stock/report/__init__.py rename to erpnext/stock/report/purchase_in_transit/__init__.py diff --git a/stock/report/purchase_in_transit/purchase_in_transit.txt b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt similarity index 100% rename from stock/report/purchase_in_transit/purchase_in_transit.txt rename to erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt diff --git a/stock/report/batch_wise_balance_history/__init__.py b/erpnext/stock/report/purchase_order_items_to_be_received/__init__.py similarity index 100% rename from stock/report/batch_wise_balance_history/__init__.py rename to erpnext/stock/report/purchase_order_items_to_be_received/__init__.py diff --git a/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt similarity index 100% rename from stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt rename to erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt diff --git a/stock/report/delivery_note_trends/__init__.py b/erpnext/stock/report/purchase_receipt_trends/__init__.py similarity index 100% rename from stock/report/delivery_note_trends/__init__.py rename to erpnext/stock/report/purchase_receipt_trends/__init__.py diff --git a/stock/report/purchase_receipt_trends/purchase_receipt_trends.js b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js similarity index 77% rename from stock/report/purchase_receipt_trends/purchase_receipt_trends.js rename to erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js index c3397f76f3f..f66fcfc9527 100644 --- a/stock/report/purchase_receipt_trends/purchase_receipt_trends.js +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -wn.require("app/js/purchase_trends_filters.js"); +wn.require("assets/erpnext/js/purchase_trends_filters.js"); wn.query_reports["Purchase Receipt Trends"] = { filters: get_filters() diff --git a/stock/report/purchase_receipt_trends/purchase_receipt_trends.py b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py similarity index 86% rename from stock/report/purchase_receipt_trends/purchase_receipt_trends.py rename to erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py index 5fd003b9bcb..6be1179affb 100644 --- a/stock/report/purchase_receipt_trends/purchase_receipt_trends.py +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_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/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt similarity index 100% rename from stock/report/purchase_receipt_trends/purchase_receipt_trends.txt rename to erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt diff --git a/stock/report/item_prices/__init__.py b/erpnext/stock/report/requested_items_to_be_transferred/__init__.py similarity index 100% rename from stock/report/item_prices/__init__.py rename to erpnext/stock/report/requested_items_to_be_transferred/__init__.py diff --git a/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt similarity index 100% rename from stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt rename to erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt diff --git a/stock/report/item_shortage_report/__init__.py b/erpnext/stock/report/serial_no_service_contract_expiry/__init__.py similarity index 100% rename from stock/report/item_shortage_report/__init__.py rename to erpnext/stock/report/serial_no_service_contract_expiry/__init__.py diff --git a/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt similarity index 100% rename from stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt rename to erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt diff --git a/stock/report/items_to_be_requested/__init__.py b/erpnext/stock/report/serial_no_status/__init__.py similarity index 100% rename from stock/report/items_to_be_requested/__init__.py rename to erpnext/stock/report/serial_no_status/__init__.py diff --git a/stock/report/serial_no_status/serial_no_status.txt b/erpnext/stock/report/serial_no_status/serial_no_status.txt similarity index 100% rename from stock/report/serial_no_status/serial_no_status.txt rename to erpnext/stock/report/serial_no_status/serial_no_status.txt diff --git a/stock/report/itemwise_recommended_reorder_level/__init__.py b/erpnext/stock/report/serial_no_warranty_expiry/__init__.py similarity index 100% rename from stock/report/itemwise_recommended_reorder_level/__init__.py rename to erpnext/stock/report/serial_no_warranty_expiry/__init__.py diff --git a/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt similarity index 100% rename from stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt rename to erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt diff --git a/stock/report/material_requests_for_which_supplier_quotations_are_not_created/__init__.py b/erpnext/stock/report/stock_ageing/__init__.py similarity index 100% rename from stock/report/material_requests_for_which_supplier_quotations_are_not_created/__init__.py rename to erpnext/stock/report/stock_ageing/__init__.py diff --git a/stock/report/stock_ageing/stock_ageing.js b/erpnext/stock/report/stock_ageing/stock_ageing.js similarity index 100% rename from stock/report/stock_ageing/stock_ageing.js rename to erpnext/stock/report/stock_ageing/stock_ageing.js diff --git a/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py similarity index 100% rename from stock/report/stock_ageing/stock_ageing.py rename to erpnext/stock/report/stock_ageing/stock_ageing.py diff --git a/stock/report/stock_ageing/stock_ageing.txt b/erpnext/stock/report/stock_ageing/stock_ageing.txt similarity index 100% rename from stock/report/stock_ageing/stock_ageing.txt rename to erpnext/stock/report/stock_ageing/stock_ageing.txt diff --git a/stock/report/ordered_items_to_be_delivered/__init__.py b/erpnext/stock/report/stock_ledger/__init__.py similarity index 100% rename from stock/report/ordered_items_to_be_delivered/__init__.py rename to erpnext/stock/report/stock_ledger/__init__.py diff --git a/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js similarity index 100% rename from stock/report/stock_ledger/stock_ledger.js rename to erpnext/stock/report/stock_ledger/stock_ledger.js diff --git a/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py similarity index 95% rename from stock/report/stock_ledger/stock_ledger.py rename to erpnext/stock/report/stock_ledger/stock_ledger.py index 94c8eeda164..38308c2f319 100644 --- a/stock/report/stock_ledger/stock_ledger.py +++ b/erpnext/stock/report/stock_ledger/stock_ledger.py @@ -62,9 +62,10 @@ def get_item_conditions(filters): def get_sle_conditions(filters): conditions = [] - if filters.get("item_code"): + item_conditions=get_item_conditions(filters) + if item_conditions: conditions.append("""item_code in (select name from tabItem - {item_conditions})""".format(item_conditions=get_item_conditions(filters))) + {item_conditions})""".format(item_conditions=item_conditions)) if filters.get("warehouse"): conditions.append("warehouse=%(warehouse)s") if filters.get("voucher_no"): diff --git a/stock/report/stock_ledger/stock_ledger.txt b/erpnext/stock/report/stock_ledger/stock_ledger.txt similarity index 100% rename from stock/report/stock_ledger/stock_ledger.txt rename to erpnext/stock/report/stock_ledger/stock_ledger.txt diff --git a/stock/report/purchase_in_transit/__init__.py b/erpnext/stock/report/stock_projected_qty/__init__.py similarity index 100% rename from stock/report/purchase_in_transit/__init__.py rename to erpnext/stock/report/stock_projected_qty/__init__.py diff --git a/stock/report/stock_projected_qty/stock_projected_qty.js b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js similarity index 100% rename from stock/report/stock_projected_qty/stock_projected_qty.js rename to erpnext/stock/report/stock_projected_qty/stock_projected_qty.js diff --git a/stock/report/stock_projected_qty/stock_projected_qty.py b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py similarity index 100% rename from stock/report/stock_projected_qty/stock_projected_qty.py rename to erpnext/stock/report/stock_projected_qty/stock_projected_qty.py diff --git a/stock/report/stock_projected_qty/stock_projected_qty.txt b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt similarity index 100% rename from stock/report/stock_projected_qty/stock_projected_qty.txt rename to erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt diff --git a/stock/report/purchase_order_items_to_be_received/__init__.py b/erpnext/stock/report/supplier_wise_sales_analytics/__init__.py similarity index 100% rename from stock/report/purchase_order_items_to_be_received/__init__.py rename to erpnext/stock/report/supplier_wise_sales_analytics/__init__.py diff --git a/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js similarity index 100% rename from stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js rename to erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js diff --git a/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py similarity index 100% rename from stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py rename to erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py diff --git a/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt similarity index 100% rename from stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt rename to erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt diff --git a/stock/report/purchase_receipt_trends/__init__.py b/erpnext/stock/report/warehouse_wise_stock_balance/__init__.py similarity index 100% rename from stock/report/purchase_receipt_trends/__init__.py rename to erpnext/stock/report/warehouse_wise_stock_balance/__init__.py diff --git a/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js similarity index 100% rename from stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js rename to erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js diff --git a/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.py b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.py similarity index 100% rename from stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.py rename to erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.py diff --git a/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt similarity index 100% rename from stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt rename to erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt diff --git a/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py similarity index 99% rename from stock/stock_ledger.py rename to erpnext/stock/stock_ledger.py index 980dcd6d449..860bb769993 100644 --- a/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes import msgprint from webnotes.utils import cint, flt, cstr, now -from stock.utils import get_valuation_method +from erpnext.stock.utils import get_valuation_method import json # future reposting @@ -16,7 +16,7 @@ _exceptions = webnotes.local('stockledger_exceptions') def make_sl_entries(sl_entries, is_amended=None): if sl_entries: - from stock.utils import update_bin + from erpnext.stock.utils import update_bin cancel = True if sl_entries[0].get("is_cancelled") == "Yes" else False if cancel: diff --git a/stock/utils.py b/erpnext/stock/utils.py similarity index 98% rename from stock/utils.py rename to erpnext/stock/utils.py index c6e5f2d6b17..69a024b7e92 100644 --- a/stock/utils.py +++ b/erpnext/stock/utils.py @@ -109,7 +109,7 @@ def _msgprint(msg, verbose): def get_incoming_rate(args): """Get Incoming Rate based on valuation method""" - from stock.stock_ledger import get_previous_sle + from erpnext.stock.stock_ledger import get_previous_sle in_rate = 0 if args.get("serial_no"): @@ -272,7 +272,7 @@ def create_material_request(material_requests): mr_list = [] defaults = webnotes.defaults.get_defaults() exceptions_list = [] - from accounts.utils import get_fiscal_year + from erpnext.accounts.utils import get_fiscal_year current_fiscal_year = get_fiscal_year(nowdate())[0] or defaults.fiscal_year for request_type in material_requests: for company in material_requests[request_type]: @@ -316,7 +316,7 @@ def create_material_request(material_requests): exceptions_list.append([] + webnotes.local.message_log) webnotes.local.message_log = [] else: - exceptions_list.append(webnotes.getTraceback()) + exceptions_list.append(webnotes.get_traceback()) if mr_list: if getattr(webnotes.local, "reorder_email_notify", None) is None: diff --git a/support/README.md b/erpnext/support/README.md similarity index 100% rename from support/README.md rename to erpnext/support/README.md diff --git a/support/__init__.py b/erpnext/support/__init__.py similarity index 100% rename from support/__init__.py rename to erpnext/support/__init__.py diff --git a/support/doctype/maintenance_schedule/__init__.py b/erpnext/support/doctype/__init__.py similarity index 100% rename from support/doctype/maintenance_schedule/__init__.py rename to erpnext/support/doctype/__init__.py diff --git a/support/doctype/customer_issue/README.md b/erpnext/support/doctype/customer_issue/README.md similarity index 100% rename from support/doctype/customer_issue/README.md rename to erpnext/support/doctype/customer_issue/README.md diff --git a/support/doctype/maintenance_schedule_detail/__init__.py b/erpnext/support/doctype/customer_issue/__init__.py similarity index 100% rename from support/doctype/maintenance_schedule_detail/__init__.py rename to erpnext/support/doctype/customer_issue/__init__.py diff --git a/support/doctype/customer_issue/customer_issue.js b/erpnext/support/doctype/customer_issue/customer_issue.js similarity index 95% rename from support/doctype/customer_issue/customer_issue.js rename to erpnext/support/doctype/customer_issue/customer_issue.js index 066a11acbf8..0ff3f17585a 100644 --- a/support/doctype/customer_issue/customer_issue.js +++ b/erpnext/support/doctype/customer_issue/customer_issue.js @@ -25,7 +25,7 @@ erpnext.support.CustomerIssue = wn.ui.form.Controller.extend({ make_maintenance_visit: function() { wn.model.open_mapped_doc({ - method: "support.doctype.customer_issue.customer_issue.make_maintenance_visit", + method: "erpnext.support.doctype.customer_issue.customer_issue.make_maintenance_visit", source_name: cur_frm.doc.name }) } @@ -103,4 +103,4 @@ cur_frm.add_fetch('item_code', 'description', 'description'); cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } diff --git a/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py similarity index 96% rename from support/doctype/customer_issue/customer_issue.py rename to erpnext/support/doctype/customer_issue/customer_issue.py index 0739a2db8b8..f6e6b6df999 100644 --- a/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -9,7 +9,7 @@ from webnotes.utils import today -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self, doc, doclist=[]): diff --git a/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.txt similarity index 100% rename from support/doctype/customer_issue/customer_issue.txt rename to erpnext/support/doctype/customer_issue/customer_issue.txt diff --git a/support/doctype/maintenance_schedule/README.md b/erpnext/support/doctype/maintenance_schedule/README.md similarity index 100% rename from support/doctype/maintenance_schedule/README.md rename to erpnext/support/doctype/maintenance_schedule/README.md diff --git a/support/doctype/maintenance_schedule_item/__init__.py b/erpnext/support/doctype/maintenance_schedule/__init__.py similarity index 100% rename from support/doctype/maintenance_schedule_item/__init__.py rename to erpnext/support/doctype/maintenance_schedule/__init__.py diff --git a/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js similarity index 92% rename from support/doctype/maintenance_schedule/maintenance_schedule.js rename to erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index 25fe69ad7f4..75773e07ac4 100644 --- a/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -9,7 +9,7 @@ erpnext.support.MaintenanceSchedule = wn.ui.form.Controller.extend({ cur_frm.add_custom_button(wn._('From Sales Order'), function() { wn.model.map_current_doc({ - method: "selling.doctype.sales_order.sales_order.make_maintenance_schedule", + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule", source_doctype: "Sales Order", get_query_filters: { docstatus: 1, @@ -22,7 +22,7 @@ erpnext.support.MaintenanceSchedule = wn.ui.form.Controller.extend({ } else if (this.frm.doc.docstatus===1) { cur_frm.add_custom_button(wn._("Make Maintenance Visit"), function() { wn.model.open_mapped_doc({ - method: "support.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit", + method: "erpnext.support.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit", source_name: cur_frm.doc.name }) }) @@ -108,4 +108,4 @@ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) { } cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } diff --git a/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py similarity index 99% rename from support/doctype/maintenance_schedule/maintenance_schedule.py rename to erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index f18408fc193..8263b196676 100644 --- a/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -11,7 +11,7 @@ from webnotes import msgprint -from utilities.transaction_base import TransactionBase, delete_events +from erpnext.utilities.transaction_base import TransactionBase, delete_events class DocType(TransactionBase): def __init__(self, doc, doclist=[]): diff --git a/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt similarity index 100% rename from support/doctype/maintenance_schedule/maintenance_schedule.txt rename to erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt diff --git a/support/doctype/maintenance_schedule_detail/README.md b/erpnext/support/doctype/maintenance_schedule_detail/README.md similarity index 100% rename from support/doctype/maintenance_schedule_detail/README.md rename to erpnext/support/doctype/maintenance_schedule_detail/README.md diff --git a/support/doctype/maintenance_visit/__init__.py b/erpnext/support/doctype/maintenance_schedule_detail/__init__.py similarity index 100% rename from support/doctype/maintenance_visit/__init__.py rename to erpnext/support/doctype/maintenance_schedule_detail/__init__.py diff --git a/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py similarity index 100% rename from support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py rename to erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py diff --git a/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt similarity index 100% rename from support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt rename to erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt diff --git a/support/doctype/maintenance_schedule_item/README.md b/erpnext/support/doctype/maintenance_schedule_item/README.md similarity index 100% rename from support/doctype/maintenance_schedule_item/README.md rename to erpnext/support/doctype/maintenance_schedule_item/README.md diff --git a/support/doctype/maintenance_visit_purpose/__init__.py b/erpnext/support/doctype/maintenance_schedule_item/__init__.py similarity index 100% rename from support/doctype/maintenance_visit_purpose/__init__.py rename to erpnext/support/doctype/maintenance_schedule_item/__init__.py diff --git a/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py similarity index 100% rename from support/doctype/maintenance_schedule_item/maintenance_schedule_item.py rename to erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py diff --git a/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt similarity index 100% rename from support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt rename to erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt diff --git a/support/doctype/maintenance_visit/README.md b/erpnext/support/doctype/maintenance_visit/README.md similarity index 100% rename from support/doctype/maintenance_visit/README.md rename to erpnext/support/doctype/maintenance_visit/README.md diff --git a/support/doctype/newsletter/__init__.py b/erpnext/support/doctype/maintenance_visit/__init__.py similarity index 100% rename from support/doctype/newsletter/__init__.py rename to erpnext/support/doctype/maintenance_visit/__init__.py diff --git a/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js similarity index 89% rename from support/doctype/maintenance_visit/maintenance_visit.js rename to erpnext/support/doctype/maintenance_visit/maintenance_visit.js index 1a618cd534b..f571b9aa9c2 100644 --- a/support/doctype/maintenance_visit/maintenance_visit.js +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js @@ -9,7 +9,7 @@ erpnext.support.MaintenanceVisit = wn.ui.form.Controller.extend({ cur_frm.add_custom_button(wn._('From Maintenance Schedule'), function() { wn.model.map_current_doc({ - method: "support.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit", + method: "erpnext.support.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit", source_doctype: "Maintenance Schedule", get_query_filters: { docstatus: 1, @@ -21,7 +21,7 @@ erpnext.support.MaintenanceVisit = wn.ui.form.Controller.extend({ cur_frm.add_custom_button(wn._('From Customer Issue'), function() { wn.model.map_current_doc({ - method: "support.doctype.customer_issue.customer_issue.make_maintenance_visit", + method: "erpnext.support.doctype.customer_issue.customer_issue.make_maintenance_visit", source_doctype: "Customer Issue", get_query_filters: { status: ["in", "Open, Work in Progress"], @@ -33,7 +33,7 @@ erpnext.support.MaintenanceVisit = wn.ui.form.Controller.extend({ cur_frm.add_custom_button(wn._('From Sales Order'), function() { wn.model.map_current_doc({ - method: "selling.doctype.sales_order.sales_order.make_maintenance_visit", + method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit", source_doctype: "Sales Order", get_query_filters: { docstatus: 1, @@ -104,5 +104,5 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return {query: "controllers.queries.customer_query" } + return {query: "erpnext.controllers.queries.customer_query" } } \ No newline at end of file diff --git a/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py similarity index 98% rename from support/doctype/maintenance_visit/maintenance_visit.py rename to erpnext/support/doctype/maintenance_visit/maintenance_visit.py index f4696572bf8..e56389eb0cf 100644 --- a/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -10,7 +10,7 @@ from webnotes import msgprint -from utilities.transaction_base import TransactionBase +from erpnext.utilities.transaction_base import TransactionBase class DocType(TransactionBase): def __init__(self, doc, doclist=[]): diff --git a/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt similarity index 100% rename from support/doctype/maintenance_visit/maintenance_visit.txt rename to erpnext/support/doctype/maintenance_visit/maintenance_visit.txt diff --git a/support/doctype/maintenance_visit_purpose/README.md b/erpnext/support/doctype/maintenance_visit_purpose/README.md similarity index 100% rename from support/doctype/maintenance_visit_purpose/README.md rename to erpnext/support/doctype/maintenance_visit_purpose/README.md diff --git a/support/page/__init__.py b/erpnext/support/doctype/maintenance_visit_purpose/__init__.py similarity index 100% rename from support/page/__init__.py rename to erpnext/support/doctype/maintenance_visit_purpose/__init__.py diff --git a/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py similarity index 100% rename from support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py rename to erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py diff --git a/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt similarity index 100% rename from support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt rename to erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt diff --git a/support/doctype/newsletter/README.md b/erpnext/support/doctype/newsletter/README.md similarity index 100% rename from support/doctype/newsletter/README.md rename to erpnext/support/doctype/newsletter/README.md diff --git a/support/page/support_home/__init__.py b/erpnext/support/doctype/newsletter/__init__.py similarity index 100% rename from support/page/support_home/__init__.py rename to erpnext/support/doctype/newsletter/__init__.py diff --git a/support/doctype/newsletter/newsletter.js b/erpnext/support/doctype/newsletter/newsletter.js similarity index 95% rename from support/doctype/newsletter/newsletter.js rename to erpnext/support/doctype/newsletter/newsletter.js index f7a7ad1511f..41967e337ca 100644 --- a/support/doctype/newsletter/newsletter.js +++ b/erpnext/support/doctype/newsletter/newsletter.js @@ -3,7 +3,7 @@ cur_frm.cscript.onload = function(doc) { return wn.call({ - method: "support.doctype.newsletter.newsletter.get_lead_options", + method: "erpnext.support.doctype.newsletter.newsletter.get_lead_options", type: "GET", callback: function(r) { set_field_options("lead_source", r.message.sources.join("\n")) diff --git a/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py similarity index 100% rename from support/doctype/newsletter/newsletter.py rename to erpnext/support/doctype/newsletter/newsletter.py diff --git a/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt similarity index 100% rename from support/doctype/newsletter/newsletter.txt rename to erpnext/support/doctype/newsletter/newsletter.txt diff --git a/support/doctype/newsletter/test_newsletter.py b/erpnext/support/doctype/newsletter/test_newsletter.py similarity index 100% rename from support/doctype/newsletter/test_newsletter.py rename to erpnext/support/doctype/newsletter/test_newsletter.py diff --git a/support/doctype/support_ticket/README.md b/erpnext/support/doctype/support_ticket/README.md similarity index 100% rename from support/doctype/support_ticket/README.md rename to erpnext/support/doctype/support_ticket/README.md diff --git a/stock/report/requested_items_to_be_transferred/__init__.py b/erpnext/support/doctype/support_ticket/__init__.py similarity index 100% rename from stock/report/requested_items_to_be_transferred/__init__.py rename to erpnext/support/doctype/support_ticket/__init__.py diff --git a/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py similarity index 97% rename from support/doctype/support_ticket/get_support_mails.py rename to erpnext/support/doctype/support_ticket/get_support_mails.py index 33cb0237475..b50e46ea081 100644 --- a/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -6,7 +6,7 @@ import webnotes from webnotes.utils import cstr, cint, decode_dict, today from webnotes.utils.email_lib import sendmail from webnotes.utils.email_lib.receive import POP3Mailbox -from core.doctype.communication.communication import make +from webnotes.core.doctype.communication.communication import make class SupportMailbox(POP3Mailbox): def setup(self, args=None): diff --git a/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js similarity index 94% rename from support/doctype/support_ticket/support_ticket.js rename to erpnext/support/doctype/support_ticket/support_ticket.js index 4f8f75685fc..b5224e7b66a 100644 --- a/support/doctype/support_ticket/support_ticket.js +++ b/erpnext/support/doctype/support_ticket/support_ticket.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { - return{ query:"controllers.queries.customer_query" } } + return{ query: "erpnext.controllers.queries.customer_query" } } wn.provide("erpnext.support"); // TODO commonify this code @@ -75,7 +75,7 @@ $.extend(cur_frm.cscript, { set_status: function(status) { return wn.call({ - method:"support.doctype.support_ticket.support_ticket.set_status", + method: "erpnext.support.doctype.support_ticket.support_ticket.set_status", args: { name: cur_frm.doc.name, status: status diff --git a/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py similarity index 97% rename from support/doctype/support_ticket/support_ticket.py rename to erpnext/support/doctype/support_ticket/support_ticket.py index fd795831294..0b95292c6a7 100644 --- a/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -4,7 +4,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 now, extract_email_id class DocType(TransactionBase): diff --git a/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt similarity index 100% rename from support/doctype/support_ticket/support_ticket.txt rename to erpnext/support/doctype/support_ticket/support_ticket.txt diff --git a/utilities/doctype/__init__.py b/erpnext/support/page/__init__.py similarity index 100% rename from utilities/doctype/__init__.py rename to erpnext/support/page/__init__.py diff --git a/support/page/support_analytics/README.md b/erpnext/support/page/support_analytics/README.md similarity index 100% rename from support/page/support_analytics/README.md rename to erpnext/support/page/support_analytics/README.md diff --git a/stock/report/serial_no_service_contract_expiry/__init__.py b/erpnext/support/page/support_analytics/__init__.py similarity index 100% rename from stock/report/serial_no_service_contract_expiry/__init__.py rename to erpnext/support/page/support_analytics/__init__.py diff --git a/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js similarity index 100% rename from support/page/support_analytics/support_analytics.js rename to erpnext/support/page/support_analytics/support_analytics.js diff --git a/support/page/support_analytics/support_analytics.txt b/erpnext/support/page/support_analytics/support_analytics.txt similarity index 100% rename from support/page/support_analytics/support_analytics.txt rename to erpnext/support/page/support_analytics/support_analytics.txt diff --git a/utilities/doctype/address/__init__.py b/erpnext/support/page/support_home/__init__.py similarity index 100% rename from utilities/doctype/address/__init__.py rename to erpnext/support/page/support_home/__init__.py diff --git a/support/page/support_home/support_home.js b/erpnext/support/page/support_home/support_home.js similarity index 100% rename from support/page/support_home/support_home.js rename to erpnext/support/page/support_home/support_home.js diff --git a/support/page/support_home/support_home.txt b/erpnext/support/page/support_home/support_home.txt similarity index 100% rename from support/page/support_home/support_home.txt rename to erpnext/support/page/support_home/support_home.txt diff --git a/stock/report/serial_no_status/__init__.py b/erpnext/support/report/__init__.py similarity index 100% rename from stock/report/serial_no_status/__init__.py rename to erpnext/support/report/__init__.py diff --git a/stock/report/serial_no_warranty_expiry/__init__.py b/erpnext/support/report/maintenance_schedules/__init__.py similarity index 100% rename from stock/report/serial_no_warranty_expiry/__init__.py rename to erpnext/support/report/maintenance_schedules/__init__.py diff --git a/support/report/maintenance_schedules/maintenance_schedules.txt b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt similarity index 100% rename from support/report/maintenance_schedules/maintenance_schedules.txt rename to erpnext/support/report/maintenance_schedules/maintenance_schedules.txt diff --git a/stock/report/stock_ageing/__init__.py b/erpnext/templates/__init__.py similarity index 100% rename from stock/report/stock_ageing/__init__.py rename to erpnext/templates/__init__.py diff --git a/stock/report/stock_ledger/__init__.py b/erpnext/templates/generators/__init__.py similarity index 100% rename from stock/report/stock_ledger/__init__.py rename to erpnext/templates/generators/__init__.py diff --git a/stock/doctype/item/templates/generators/item.html b/erpnext/templates/generators/item.html similarity index 81% rename from stock/doctype/item/templates/generators/item.html rename to erpnext/templates/generators/item.html index 545693d0c77..91ea3e49172 100644 --- a/stock/doctype/item/templates/generators/item.html +++ b/erpnext/templates/generators/item.html @@ -2,12 +2,12 @@ {% block javascript %} -{% endblock %} diff --git a/erpnext/templates/includes/footer_powered.html b/erpnext/templates/includes/footer_powered.html new file mode 100644 index 00000000000..0abf2e4e778 --- /dev/null +++ b/erpnext/templates/includes/footer_powered.html @@ -0,0 +1 @@ +ERPNext Powered \ No newline at end of file diff --git a/stock/doctype/item/templates/includes/product_breadcrumbs.html b/erpnext/templates/includes/product_breadcrumbs.html similarity index 100% rename from stock/doctype/item/templates/includes/product_breadcrumbs.html rename to erpnext/templates/includes/product_breadcrumbs.html diff --git a/stock/doctype/item/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html similarity index 83% rename from stock/doctype/item/templates/includes/product_in_grid.html rename to erpnext/templates/includes/product_in_grid.html index 4271aaabb29..d99ad002945 100644 --- a/stock/doctype/item/templates/includes/product_in_grid.html +++ b/erpnext/templates/includes/product_in_grid.html @@ -4,7 +4,7 @@ {%- if website_image -%} {%- else -%} - {% include 'app/stock/doctype/item/templates/includes/product_missing_image.html' %} + {% include 'stock/doctype/item/templates/includes/product_missing_image.html' %} {%- endif -%}
diff --git a/stock/doctype/item/templates/includes/product_in_list.html b/erpnext/templates/includes/product_in_list.html similarity index 86% rename from stock/doctype/item/templates/includes/product_in_list.html rename to erpnext/templates/includes/product_in_list.html index c501283b89c..f895ab68102 100644 --- a/stock/doctype/item/templates/includes/product_in_list.html +++ b/erpnext/templates/includes/product_in_list.html @@ -5,7 +5,7 @@ {%- if website_image -%} {%- else -%} - {% include 'app/website/templates/html/product_missing_image.html' %} + {% include 'website/templates/html/product_missing_image.html' %} {%- endif -%}
diff --git a/stock/doctype/item/templates/includes/product_list.js b/erpnext/templates/includes/product_list.js similarity index 95% rename from stock/doctype/item/templates/includes/product_list.js rename to erpnext/templates/includes/product_list.js index 268760d7516..ac84c00a3ea 100644 --- a/stock/doctype/item/templates/includes/product_list.js +++ b/erpnext/templates/includes/product_list.js @@ -15,7 +15,7 @@ window.get_product_list = function() { url: "/", dataType: "json", data: { - cmd: "selling.utils.product.get_product_list", + cmd: "erpnext.selling.utils.product.get_product_list", start: window.start, search: window.search, product_group: window.product_group diff --git a/stock/doctype/item/templates/includes/product_missing_image.html b/erpnext/templates/includes/product_missing_image.html similarity index 100% rename from stock/doctype/item/templates/includes/product_missing_image.html rename to erpnext/templates/includes/product_missing_image.html diff --git a/stock/doctype/item/templates/includes/product_page.css b/erpnext/templates/includes/product_page.css similarity index 100% rename from stock/doctype/item/templates/includes/product_page.css rename to erpnext/templates/includes/product_page.css diff --git a/stock/doctype/item/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js similarity index 96% rename from stock/doctype/item/templates/includes/product_page.js rename to erpnext/templates/includes/product_page.js index df842ccc223..5029b902993 100644 --- a/stock/doctype/item/templates/includes/product_page.js +++ b/erpnext/templates/includes/product_page.js @@ -7,7 +7,7 @@ $(document).ready(function() { wn.call({ type: "POST", - method: "selling.utils.product.get_product_info", + method: "erpnext.selling.utils.product.get_product_info", args: { item_code: "{{ name }}" }, diff --git a/stock/doctype/item/templates/includes/product_search_box.html b/erpnext/templates/includes/product_search_box.html similarity index 100% rename from stock/doctype/item/templates/includes/product_search_box.html rename to erpnext/templates/includes/product_search_box.html diff --git a/portal/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html similarity index 100% rename from portal/templates/includes/transactions.html rename to erpnext/templates/includes/transactions.html diff --git a/stock/report/stock_projected_qty/__init__.py b/erpnext/templates/pages/__init__.py similarity index 100% rename from stock/report/stock_projected_qty/__init__.py rename to erpnext/templates/pages/__init__.py diff --git a/utilities/doctype/address/templates/pages/address.html b/erpnext/templates/pages/address.html similarity index 100% rename from utilities/doctype/address/templates/pages/address.html rename to erpnext/templates/pages/address.html diff --git a/utilities/doctype/address/templates/pages/address.py b/erpnext/templates/pages/address.py similarity index 100% rename from utilities/doctype/address/templates/pages/address.py rename to erpnext/templates/pages/address.py diff --git a/utilities/doctype/address/templates/pages/addresses.html b/erpnext/templates/pages/addresses.html similarity index 100% rename from utilities/doctype/address/templates/pages/addresses.html rename to erpnext/templates/pages/addresses.html diff --git a/utilities/doctype/address/templates/pages/addresses.py b/erpnext/templates/pages/addresses.py similarity index 100% rename from utilities/doctype/address/templates/pages/addresses.py rename to erpnext/templates/pages/addresses.py diff --git a/portal/templates/pages/cart.html b/erpnext/templates/pages/cart.html similarity index 96% rename from portal/templates/pages/cart.html rename to erpnext/templates/pages/cart.html index 1abe46787c4..8aae9d92b94 100644 --- a/portal/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -1,7 +1,7 @@ {% extends base_template %} {% block javascript %} - + {% endblock %} {% set title="Shopping Cart" %} diff --git a/portal/templates/pages/cart.py b/erpnext/templates/pages/cart.py similarity index 100% rename from portal/templates/pages/cart.py rename to erpnext/templates/pages/cart.py diff --git a/accounts/doctype/sales_invoice/templates/pages/invoice.html b/erpnext/templates/pages/invoice.html similarity index 64% rename from accounts/doctype/sales_invoice/templates/pages/invoice.html rename to erpnext/templates/pages/invoice.html index db6e009f891..45867eabdf5 100644 --- a/accounts/doctype/sales_invoice/templates/pages/invoice.html +++ b/erpnext/templates/pages/invoice.html @@ -1,4 +1,4 @@ -{% extends "app/portal/templates/sale.html" %} +{% extends "templates/sale.html" %} {% block status -%} {% if doc.status %}{{ doc.status }}{% endif %} diff --git a/accounts/doctype/sales_invoice/templates/pages/invoice.py b/erpnext/templates/pages/invoice.py similarity index 93% rename from accounts/doctype/sales_invoice/templates/pages/invoice.py rename to erpnext/templates/pages/invoice.py index 89789d39599..9d6a558b7c1 100644 --- a/accounts/doctype/sales_invoice/templates/pages/invoice.py +++ b/erpnext/templates/pages/invoice.py @@ -9,7 +9,7 @@ from webnotes.utils import flt, fmt_money no_cache = True def get_context(): - from portal.utils import get_transaction_context + from erpnext.templates.utils import get_transaction_context context = get_transaction_context("Sales Invoice", webnotes.form_dict.name) modify_status(context.get("doc")) context.update({ diff --git a/erpnext/templates/pages/invoices.html b/erpnext/templates/pages/invoices.html new file mode 100644 index 00000000000..0467f34ae62 --- /dev/null +++ b/erpnext/templates/pages/invoices.html @@ -0,0 +1 @@ +{% extends "templates/sales_transactions.html" %} \ No newline at end of file diff --git a/accounts/doctype/sales_invoice/templates/pages/invoices.py b/erpnext/templates/pages/invoices.py similarity index 76% rename from accounts/doctype/sales_invoice/templates/pages/invoices.py rename to erpnext/templates/pages/invoices.py index 871e37de9ab..448c525068d 100644 --- a/accounts/doctype/sales_invoice/templates/pages/invoices.py +++ b/erpnext/templates/pages/invoices.py @@ -7,7 +7,7 @@ import webnotes no_cache = True def get_context(): - from portal.utils import get_currency_context + from erpnext.templates.utils import get_currency_context context = get_currency_context() context.update({ "title": "Invoices", @@ -20,8 +20,8 @@ def get_context(): @webnotes.whitelist() def get_invoices(start=0): - from portal.utils import get_transaction_list - from accounts.doctype.sales_invoice.templates.pages.invoice import modify_status + from erpnext.templates.utils import get_transaction_list + from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"]) for d in invoices: modify_status(d) diff --git a/stock/doctype/item/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html similarity index 78% rename from stock/doctype/item/templates/pages/product_search.html rename to erpnext/templates/pages/product_search.html index 132e3b1e022..02c161cd90e 100644 --- a/stock/doctype/item/templates/pages/product_search.html +++ b/erpnext/templates/pages/product_search.html @@ -3,7 +3,7 @@ {% set title="Product Search" %} {% block javascript %} - + {% endblock %} {% block content %} @@ -17,7 +17,7 @@ $(document).ready(function() { }); -{% include "app/stock/doctype/item/templates/includes/product_search_box.html" %} +{% include "stock/doctype/item/templates/includes/product_search_box.html" %}

Search Results

diff --git a/stock/doctype/item/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py similarity index 100% rename from stock/doctype/item/templates/pages/product_search.py rename to erpnext/templates/pages/product_search.py diff --git a/portal/templates/pages/profile.html b/erpnext/templates/pages/profile.html similarity index 96% rename from portal/templates/pages/profile.html rename to erpnext/templates/pages/profile.html index a8077319c1f..880b8d49e3c 100644 --- a/portal/templates/pages/profile.html +++ b/erpnext/templates/pages/profile.html @@ -34,7 +34,7 @@ $(document).ready(function() { $("#fullname").val(getCookie("full_name") || ""); $("#update_profile").click(function() { wn.call({ - method: "portal.templates.pages.profile.update_profile", + method: "erpnext.templates.pages.profile.update_profile", type: "POST", args: { fullname: $("#fullname").val(), diff --git a/portal/templates/pages/profile.py b/erpnext/templates/pages/profile.py similarity index 90% rename from portal/templates/pages/profile.py rename to erpnext/templates/pages/profile.py index 241f9539742..143abef4188 100644 --- a/portal/templates/pages/profile.py +++ b/erpnext/templates/pages/profile.py @@ -10,7 +10,7 @@ no_cache = True no_sitemap = True def get_context(): - from selling.utils.cart import get_lead_or_customer + from erpnext.selling.utils.cart import get_lead_or_customer party = get_lead_or_customer() if party.doctype == "Lead": mobile_no = party.mobile_no @@ -27,7 +27,7 @@ def get_context(): @webnotes.whitelist() def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None): - from selling.utils.cart import update_party + from erpnext.selling.utils.cart import update_party update_party(fullname, company_name, mobile_no, phone) if not fullname: diff --git a/erpnext/templates/pages/shipment.html b/erpnext/templates/pages/shipment.html new file mode 100644 index 00000000000..d0aaa3efd59 --- /dev/null +++ b/erpnext/templates/pages/shipment.html @@ -0,0 +1 @@ +{% extends "templates/sale.html" %} \ No newline at end of file diff --git a/stock/doctype/delivery_note/templates/pages/shipment.py b/erpnext/templates/pages/shipment.py similarity index 86% rename from stock/doctype/delivery_note/templates/pages/shipment.py rename to erpnext/templates/pages/shipment.py index 760ffe0ad63..e7446852107 100644 --- a/stock/doctype/delivery_note/templates/pages/shipment.py +++ b/erpnext/templates/pages/shipment.py @@ -7,7 +7,7 @@ import webnotes no_cache = True def get_context(): - from portal.utils import get_transaction_context + from erpnext.templates.utils import get_transaction_context context = get_transaction_context("Delivery Note", webnotes.form_dict.name) context.update({ "parent_link": "shipments", diff --git a/erpnext/templates/pages/shipments.html b/erpnext/templates/pages/shipments.html new file mode 100644 index 00000000000..0467f34ae62 --- /dev/null +++ b/erpnext/templates/pages/shipments.html @@ -0,0 +1 @@ +{% extends "templates/sales_transactions.html" %} \ No newline at end of file diff --git a/stock/doctype/delivery_note/templates/pages/shipments.py b/erpnext/templates/pages/shipments.py similarity index 74% rename from stock/doctype/delivery_note/templates/pages/shipments.py rename to erpnext/templates/pages/shipments.py index b8fe65a7ea3..03d074a19fa 100644 --- a/stock/doctype/delivery_note/templates/pages/shipments.py +++ b/erpnext/templates/pages/shipments.py @@ -7,11 +7,11 @@ import webnotes no_cache = True def get_context(): - from portal.utils import get_currency_context + from erpnext.templates.utils import get_currency_context context = get_currency_context() context.update({ "title": "Shipments", - "method": "portal.templates.pages.shipments.get_shipments", + "method": "erpnext.templates.pages.shipments.get_shipments", "icon": "icon-truck", "empty_list_message": "No Shipments Found", "page": "shipment" @@ -20,5 +20,5 @@ def get_context(): @webnotes.whitelist() def get_shipments(start=0): - from portal.utils import get_transaction_list + from erpnext.templates.utils import get_transaction_list return get_transaction_list("Delivery Note", start) diff --git a/support/doctype/support_ticket/templates/pages/ticket.html b/erpnext/templates/pages/ticket.html similarity index 100% rename from support/doctype/support_ticket/templates/pages/ticket.html rename to erpnext/templates/pages/ticket.html diff --git a/support/doctype/support_ticket/templates/pages/ticket.py b/erpnext/templates/pages/ticket.py similarity index 93% rename from support/doctype/support_ticket/templates/pages/ticket.py rename to erpnext/templates/pages/ticket.py index 28d8802cc3f..f9e5c880401 100644 --- a/support/doctype/support_ticket/templates/pages/ticket.py +++ b/erpnext/templates/pages/ticket.py @@ -31,7 +31,7 @@ def add_reply(ticket, message): if bean.doc.raised_by != webnotes.session.user: raise webnotes.throw(_("You are not allowed to reply to this ticket."), webnotes.PermissionError) - from core.doctype.communication.communication import make + from webnotes.core.doctype.communication.communication import make make(content=message, sender=bean.doc.raised_by, subject = bean.doc.subject, doctype="Support Ticket", name=bean.doc.name, date=today()) \ No newline at end of file diff --git a/support/doctype/support_ticket/templates/pages/tickets.html b/erpnext/templates/pages/tickets.html similarity index 97% rename from support/doctype/support_ticket/templates/pages/tickets.html rename to erpnext/templates/pages/tickets.html index d99e6145d97..6942d3bff03 100644 --- a/support/doctype/support_ticket/templates/pages/tickets.html +++ b/erpnext/templates/pages/tickets.html @@ -1,4 +1,4 @@ -{% extends "app/portal/templates/includes/transactions.html" %} +{% extends "templates/includes/transactions.html" %} {% block javascript -%} {{ super() }} diff --git a/support/doctype/support_ticket/templates/pages/tickets.py b/erpnext/templates/pages/tickets.py similarity index 91% rename from support/doctype/support_ticket/templates/pages/tickets.py rename to erpnext/templates/pages/tickets.py index 1816ccc9323..7434af2075a 100644 --- a/support/doctype/support_ticket/templates/pages/tickets.py +++ b/erpnext/templates/pages/tickets.py @@ -32,7 +32,7 @@ def make_new_ticket(subject, message): if not (subject and message): raise webnotes.throw(_("Please write something in subject and message!")) - from support.doctype.support_ticket.get_support_mails import add_support_communication + from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication ticket = add_support_communication(subject, message, webnotes.session.user) return ticket.doc.name \ No newline at end of file diff --git a/portal/templates/sale.html b/erpnext/templates/sale.html similarity index 100% rename from portal/templates/sale.html rename to erpnext/templates/sale.html diff --git a/portal/templates/sales_transactions.html b/erpnext/templates/sales_transactions.html similarity index 93% rename from portal/templates/sales_transactions.html rename to erpnext/templates/sales_transactions.html index f4fd5d18cc0..4836c12dca5 100644 --- a/portal/templates/sales_transactions.html +++ b/erpnext/templates/sales_transactions.html @@ -1,4 +1,4 @@ -{% extends "app/portal/templates/includes/transactions.html" %} +{% extends "templates/includes/transactions.html" %} {% block javascript -%}