diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 3c6355488ff..6a2dce00fc6 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -266,8 +266,7 @@ def get_tolerance_for(item_code, item_tolerance={}, global_tolerance=None): if not tolerance: if global_tolerance == None: - global_tolerance = flt(frappe.db.get_value('Global Defaults', None, - 'tolerance')) + global_tolerance = flt(frappe.db.get_value('Stock Settings', None, 'tolerance')) tolerance = global_tolerance item_tolerance[item_code] = tolerance diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index 51a1ac5ede4..4209e7d7701 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -53,6 +53,15 @@ "permlevel": 0, "reqd": 0 }, + { + "fieldname": "country", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Country", + "options": "Country", + "permlevel": 0, + "reqd": 1 + }, { "fieldname": "charts_section", "fieldtype": "Section Break", @@ -60,18 +69,10 @@ "label": "Chart of Accounts", "permlevel": 0 }, - { - "fieldname": "country", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Country", - "options": "Country", - "permlevel": 0, - "reqd": 0 - }, { "fieldname": "chart_of_accounts", "fieldtype": "Link", + "hidden": 0, "ignore_user_permissions": 1, "label": "Chart of Accounts", "options": "Chart of Accounts", @@ -348,7 +349,7 @@ ], "icon": "icon-building", "idx": 1, - "modified": "2014-05-27 03:49:08.597191", + "modified": "2014-07-17 19:30:24.487672", "modified_by": "Administrator", "module": "Setup", "name": "Company", diff --git a/erpnext/setup/doctype/company/fixtures/india/__init__.py b/erpnext/setup/doctype/company/fixtures/india/__init__.py index fa45ab03640..d52b30402ea 100644 --- a/erpnext/setup/doctype/company/fixtures/india/__init__.py +++ b/erpnext/setup/doctype/company/fixtures/india/__init__.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe +from frappe import _ def install(company): docs = [ @@ -27,44 +28,45 @@ def install(company): 'group_or_ledger': 2, 'account_type': 3, 'report_type': 4, - 'tax_rate': 5 + 'tax_rate': 5, + 'root_type': 6 } acc_list_india = [ - ['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet','4.00'], - ['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet','8.00'], - ['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet','10.00'], - ['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet','14.00'], - ['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet','2.00'], - ['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet','1.00'], - ['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet','4.00'], - ['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet','8.00'], - ['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet','10.00'], - ['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet','14.00'], - ['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','10.3'], - ['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None] + [_('CENVAT Capital Goods'),_(_('Tax Assets')),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax Cess 1'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax Cess 2'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Edu Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT SHE Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('Excise Duty 4'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','4.00', 'Asset'], + [_('Excise Duty 8'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','8.00', 'Asset'], + [_('Excise Duty 10'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','10.00', 'Asset'], + [_('Excise Duty 14'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','14.00', 'Asset'], + [_('Excise Duty Edu Cess 2'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','2.00', 'Asset'], + [_('Excise Duty SHE Cess 1'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','1.00', 'Asset'], + [_('P L A'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('P L A - Cess Portion'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('Edu. Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Edu. Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Edu. Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Excise Duty @ 4'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','4.00', 'Liability'], + [_('Excise Duty @ 8'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','8.00', 'Liability'], + [_('Excise Duty @ 10'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.00', 'Liability'], + [_('Excise Duty @ 14'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','14.00', 'Liability'], + [_('Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.3', 'Liability'], + [_('SHE Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('SHE Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('SHE Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('Professional Tax'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('VAT'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Advertisement)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Commission)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Contractor)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Interest)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Rent)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Salary)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'] ] for lst in acc_list_india: diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index e53a92aad73..7a47765a2ce 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -11,8 +11,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten this._super(); this.frm.set_query("item_code", this.frm.cscript.fname, function() { return { - query: "erpnext.controllers.queries.item_query", - filters: {'is_stock_item': 'Yes'} + query: "erpnext.controllers.queries.item_query" } }); }, diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 10f5cc27761..100d338fd6b 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -192,7 +192,7 @@ def _reorder_item(): item_warehouse_projected_qty = get_item_warehouse_projected_qty() warehouse_company = frappe._dict(frappe.db.sql("""select name, company from `tabWarehouse`""")) - default_company = (frappe.defaults.get_defaults()["company"] or + default_company = (frappe.defaults.get_defaults().get("company") or frappe.db.sql("""select name from tabCompany limit 1""")[0][0]) def add_to_material_request(item_code, warehouse, reorder_level, reorder_qty, material_request_type):