Merge pull request #1437 from ddimmich/patch-1
Update README.md
diff --git a/erpnext/selling/doctype/customer_discount/__init__.py b/erpnext/accounts/doctype/pricing_rule/__init__.py
similarity index 100%
rename from erpnext/selling/doctype/customer_discount/__init__.py
rename to erpnext/accounts/doctype/pricing_rule/__init__.py
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
new file mode 100644
index 0000000..5073718
--- /dev/null
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -0,0 +1,38 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# MIT License. See license.txt
+
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import throw, _
+from frappe.model.controller import DocListController
+
+class DocType(DocListController):
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
+
+ def validate(self):
+ self.validate_mandatory()
+ self.cleanup_fields_value()
+
+ def validate_mandatory(self):
+ for field in ["apply_on", "applicable_for", "price_or_discount"]:
+ val = self.doc.fields.get("applicable_for")
+ if val and not self.doc.fields.get(frappe.scrub(val)):
+ throw("{fname} {msg}".format(fname = _(val), msg = _(" is mandatory")),
+ frappe.MandatoryError)
+
+ def cleanup_fields_value(self):
+ for logic_field in ["apply_on", "applicable_for", "price_or_discount"]:
+ fieldname = frappe.scrub(self.doc.fields.get(logic_field) or "")
+
+ # reset all values except for the logic field
+ options = (self.meta.get_options(logic_field) or "").split("\n")
+ for f in options:
+ if not f: continue
+
+ f = frappe.scrub(f)
+ if f!=fieldname:
+ self.doc.fields[f] = None
+
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt
new file mode 100644
index 0000000..413405c
--- /dev/null
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt
@@ -0,0 +1,261 @@
+[
+ {
+ "creation": "2014-02-21 15:02:51",
+ "docstatus": 0,
+ "modified": "2014-03-05 18:23:34",
+ "modified_by": "Administrator",
+ "owner": "Administrator"
+ },
+ {
+ "autoname": "PRULE.#####",
+ "doctype": "DocType",
+ "document_type": "Master",
+ "icon": "icon-gift",
+ "istable": 0,
+ "module": "Accounts",
+ "name": "__common__"
+ },
+ {
+ "doctype": "DocField",
+ "name": "__common__",
+ "parent": "Pricing Rule",
+ "parentfield": "fields",
+ "parenttype": "DocType",
+ "permlevel": 0
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "doctype": "DocPerm",
+ "name": "__common__",
+ "parent": "Pricing Rule",
+ "parentfield": "permissions",
+ "parenttype": "DocType",
+ "permlevel": 0,
+ "read": 1,
+ "write": 1
+ },
+ {
+ "doctype": "DocType",
+ "name": "Pricing Rule"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "basic_section",
+ "fieldtype": "Section Break",
+ "label": "Basic Section"
+ },
+ {
+ "default": "Today",
+ "doctype": "DocField",
+ "fieldname": "valid_from",
+ "fieldtype": "Date",
+ "label": "Valid From"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "valid_upto",
+ "fieldtype": "Date",
+ "label": "Valid Upto"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "priority",
+ "fieldtype": "Select",
+ "label": "Priority",
+ "options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "disable",
+ "fieldtype": "Check",
+ "label": "Disable"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "price_discount_section",
+ "fieldtype": "Section Break",
+ "label": "Price / Discount"
+ },
+ {
+ "default": "Discount Percentage",
+ "doctype": "DocField",
+ "fieldname": "price_or_discount",
+ "fieldtype": "Select",
+ "label": "Price or Discount",
+ "options": "\nPrice\nDiscount Percentage",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Price\"",
+ "doctype": "DocField",
+ "fieldname": "price",
+ "fieldtype": "Float",
+ "label": "Price"
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
+ "doctype": "DocField",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "label": "Discount Percentage"
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
+ "doctype": "DocField",
+ "fieldname": "for_price_list",
+ "fieldtype": "Link",
+ "label": "For Price List",
+ "options": "Price List"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "applicability_section",
+ "fieldtype": "Section Break",
+ "label": "Applicability"
+ },
+ {
+ "default": "Item Code",
+ "doctype": "DocField",
+ "fieldname": "apply_on",
+ "fieldtype": "Select",
+ "label": "Apply On",
+ "options": "\nItem Code\nItem Group\nBrand",
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Item Code\"",
+ "doctype": "DocField",
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "label": "Item Code",
+ "options": "Item",
+ "reqd": 0
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Item Group\"",
+ "doctype": "DocField",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "label": "Item Group",
+ "options": "Item Group"
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Brand\"",
+ "doctype": "DocField",
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "label": "Brand",
+ "options": "Brand"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "applicable_for",
+ "fieldtype": "Select",
+ "label": "Applicable For",
+ "options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Customer\"",
+ "doctype": "DocField",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "options": "Customer"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Customer Group\"",
+ "doctype": "DocField",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Territory\"",
+ "doctype": "DocField",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "options": "Territory"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
+ "doctype": "DocField",
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "options": "Sales Partner"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Campaign\"",
+ "doctype": "DocField",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "options": "Campaign"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Supplier\"",
+ "doctype": "DocField",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier"
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
+ "doctype": "DocField",
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "label": "Supplier Type",
+ "options": "Supplier Type"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "min_qty",
+ "fieldtype": "Float",
+ "label": "Min Qty"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "max_qty",
+ "fieldtype": "Float",
+ "label": "Max Qty"
+ },
+ {
+ "doctype": "DocPerm",
+ "role": "Accounts Manager"
+ },
+ {
+ "doctype": "DocPerm",
+ "role": "Sales Manager"
+ },
+ {
+ "doctype": "DocPerm",
+ "role": "Purchase Manager"
+ },
+ {
+ "doctype": "DocPerm",
+ "role": "Website Manager"
+ },
+ {
+ "doctype": "DocPerm",
+ "role": "System Manager"
+ }
+]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
new file mode 100644
index 0000000..a28db32
--- /dev/null
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -0,0 +1,79 @@
+# 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 unittest
+import frappe
+
+class TestPricingRule(unittest.TestCase):
+ def test_pricing_rule_for_discount(self):
+ from erpnext.stock.get_item_details import get_item_details
+ from frappe import MandatoryError
+
+ test_record = [{
+ "doctype": "Pricing Rule",
+ "apply_on": "Item Code",
+ "item_code": "_Test Item",
+ "price_or_discount": "Discount Percentage",
+ "price": 0,
+ "discount_percentage": 10,
+ }]
+ frappe.bean(copy=test_record).insert()
+
+ args = frappe._dict({
+ "item_code": "_Test Item",
+ "company": "_Test Company",
+ "price_list": "_Test Price List",
+ "currency": "_Test Currency",
+ "doctype": "Sales Order",
+ "conversion_rate": 1,
+ "price_list_currency": "_Test Currency",
+ "plc_conversion_rate": 1,
+ "order_type": "Sales",
+ "transaction_type": "selling",
+ "customer": "_Test Customer",
+ })
+
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 10)
+
+ prule = frappe.bean(copy=test_record)
+ prule.doc.applicable_for = "Customer"
+ self.assertRaises(MandatoryError, prule.insert)
+ prule.doc.customer = "_Test Customer"
+ prule.doc.discount_percentage = 20
+ prule.insert()
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 20)
+
+ prule = frappe.bean(copy=test_record)
+ prule.doc.apply_on = "Item Group"
+ prule.doc.item_group = "All Item Groups"
+ prule.doc.discount_percentage = 15
+ prule.insert()
+
+ args.customer = None
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 10)
+
+ prule = frappe.bean(copy=test_record)
+ prule.doc.applicable_for = "Campaign"
+ prule.doc.campaign = "_Test Campaign"
+ prule.doc.discount_percentage = 5
+ prule.doc.priority = 8
+ prule.insert()
+
+ args.campaign = "_Test Campaign"
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 5)
+
+ frappe.db.sql("update `tabPricing Rule` set priority=NULL where campaign='_Test Campaign'")
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 15)
+
+ args.item_code = "_Test Item 2"
+ details = get_item_details(args)
+ self.assertEquals(details.get("discount_percentage"), 15)
+
+ frappe.db.sql("delete from `tabPricing Rule`")
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index 5bb3f5a..b3562b3 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2014-02-10 17:29:13",
+ "modified": "2014-02-28 11:27:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -215,6 +215,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "accounting",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index a6b6c6e..224f7b7 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-04 11:02:19",
"docstatus": 0,
- "modified": "2014-02-10 17:28:47",
+ "modified": "2014-02-28 11:04:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -223,6 +223,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "accounting",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/accounts/page/accounts_home/__init__.py b/erpnext/accounts/page/accounts_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/accounts/page/accounts_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/accounts/page/accounts_home/accounts_home.js b/erpnext/accounts/page/accounts_home/accounts_home.js
deleted file mode 100644
index f3c3098..0000000
--- a/erpnext/accounts/page/accounts_home/accounts_home.js
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Accounts"] = [
- {
- top: true,
- title: frappe._("Documents"),
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Journal Voucher"),
- description: frappe._("Accounting journal entries."),
- doctype:"Journal Voucher"
- },
- {
- label: frappe._("Sales Invoice"),
- description: frappe._("Bills raised to Customers."),
- doctype:"Sales Invoice"
- },
- {
- label: frappe._("Purchase Invoice"),
- description: frappe._("Bills raised by Suppliers."),
- doctype:"Purchase Invoice"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Chart of Accounts"),
- route: "Accounts Browser/Account",
- description: frappe._("Structure of books of accounts."),
- doctype:"Account"
- },
- {
- label: frappe._("Chart of Cost Centers"),
- route: "Accounts Browser/Cost Center",
- description: frappe._("Structure cost centers for budgeting."),
- doctype:"Cost Center"
- },
- {
- label: frappe._("Customer"),
- description: frappe._("Customer database."),
- doctype:"Customer"
- },
- {
- label: frappe._("Supplier"),
- description: frappe._("Supplier database."),
- doctype:"Supplier"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-wrench",
- items: [
- {
- label: frappe._("Company"),
- description: frappe._("Company Master."),
- doctype:"Company"
- },
- {
- label: frappe._("Fiscal Year"),
- description: frappe._("Accounting Year."),
- doctype:"Fiscal Year"
- },
- ]
- },
- {
- title: frappe._("Tools"),
- icon: "icon-wrench",
- items: [
- {
- "route":"Form/Bank Reconciliation/Bank Reconciliation",
- "label": frappe._("Bank Reconciliation"),
- "description": frappe._("Update bank payment dates with journals."),
- doctype: "Bank Reconciliation"
- },
- {
- "route":"Form/Payment to Invoice Matching Tool/Payment to Invoice Matching Tool",
- "label": frappe._("Payment Reconciliation"),
- "description": frappe._("Match non-linked Invoices and Payments."),
- doctype: "Payment to Invoice Matching Tool"
-
- },
- {
- "label": frappe._("Period Closing Voucher"),
- "doctype": "Period Closing Voucher",
- description: frappe._("Close Balance Sheet and book Profit or Loss.")
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- "label": frappe._("Accounts Settings"),
- "route": "Form/Accounts Settings",
- "doctype":"Accounts Settings",
- "description": frappe._("Settings for Accounts")
- },
- {
- "label": frappe._("Sales Taxes and Charges Master"),
- "doctype":"Sales Taxes and Charges Master",
- "description": frappe._("Tax Template for Sales")
- },
- {
- "label": frappe._("Purchase Taxes and Charges Master"),
- "doctype":"Purchase Taxes and Charges Master",
- "description": frappe._("Tax Template for Purchase")
- },
- {
- "label": frappe._("Shipping Rules"),
- "doctype":"Shipping Rule",
- "description": frappe._("Rules to calculate shipping amount for a sale")
- },
- {
- "label": frappe._("Currency Exchange"),
- "doctype":"Currency Exchange",
- "description": frappe._("Manage exchange rates for currency conversion")
- },
- {
- "label": frappe._("Point-of-Sale Setting"),
- "doctype":"POS Setting",
- "description": frappe._("User settings for Point-of-sale (POS)")
- },
- {
- "doctype":"Budget Distribution",
- "label": frappe._("Budget Distribution"),
- "description": frappe._("Seasonality for setting budgets.")
- },
- {
- "doctype":"Terms and Conditions",
- "label": frappe._("Terms and Conditions Template"),
- description: frappe._("Template of terms or contract.")
- },
- {
- "doctype":"Mode of Payment",
- "label": frappe._("Mode of Payment"),
- description: frappe._("e.g. Bank, Cash, Credit Card")
- },
- {
- "doctype":"C-Form",
- "label": frappe._("C-Form"),
- description: frappe._("C-Form records"),
- country: "India"
- }
- ]
- },
- {
- title: frappe._("Main Reports"),
- right: true,
- icon: "icon-table",
- items: [
- {
- "label":frappe._("General Ledger"),
- doctype: "GL Entry",
- route: "query-report/General Ledger"
- },
- {
- "label":frappe._("Trial Balance"),
- page: "trial-balance"
- },
- {
- "page":"Financial Statements",
- "label": frappe._("Financial Statements")
- },
- {
- "label":frappe._("Accounts Receivable"),
- route: "query-report/Accounts Receivable",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Accounts Payable"),
- route: "query-report/Accounts Payable",
- doctype: "Purchase Invoice"
- },
- {
- "label":frappe._("Sales Register"),
- route: "query-report/Sales Register",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Purchase Register"),
- route: "query-report/Purchase Register",
- doctype: "Purchase Invoice"
- },
- ]
- },
- {
- title: frappe._("Analytics"),
- right: true,
- icon: "icon-bar-chart",
- items: [
- {
- "label":frappe._("Financial Analytics"),
- page: "financial-analytics"
- },
- {
- "label":frappe._("Gross Profit"),
- route: "query-report/Gross Profit",
- doctype: "Sales Invoice"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Bank Reconciliation Statement"),
- route: "query-report/Bank Reconciliation Statement",
- doctype: "Journal Voucher"
- },
- {
- "label":frappe._("Ordered Items To Be Billed"),
- route: "query-report/Ordered Items To Be Billed",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Delivered Items To Be Billed"),
- route: "query-report/Delivered Items To Be Billed",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Purchase Order Items To Be Billed"),
- route: "query-report/Purchase Order Items To Be Billed",
- doctype: "Purchase Invoice"
- },
- {
- "label":frappe._("Received Items To Be Billed"),
- route: "query-report/Received Items To Be Billed",
- doctype: "Purchase Invoice"
- },
- {
- "label":frappe._("Bank Clearance Summary"),
- route: "query-report/Bank Clearance Summary",
- doctype: "Journal Voucher"
- },
- {
- "label":frappe._("Payment Period Based On Invoice Date"),
- route: "query-report/Payment Period Based On Invoice Date",
- doctype: "Journal Voucher"
- },
- {
- "label":frappe._("Sales Partners Commission"),
- route: "query-report/Sales Partners Commission",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Customer Account Head"),
- route: "query-report/Customer Account Head",
- doctype: "Account"
- },
- {
- "label":frappe._("Supplier Account Head"),
- route: "query-report/Supplier Account Head",
- doctype: "Account"
- },
- {
- "label":frappe._("Item-wise Sales Register"),
- route: "query-report/Item-wise Sales Register",
- doctype: "Sales Invoice"
- },
- {
- "label":frappe._("Item-wise Purchase Register"),
- route: "query-report/Item-wise Purchase Register",
- doctype: "Purchase Invoice"
- },
- {
- "label":frappe._("Budget Variance Report"),
- route: "query-report/Budget Variance Report",
- doctype: "Cost Center"
- },
- {
- "label":frappe._("Purchase Invoice Trends"),
- route: "query-report/Purchase Invoice Trends",
- doctype: "Purchase Invoice"
- },
- {
- "label":frappe._("Sales Invoice Trends"),
- route: "query-report/Sales Invoice Trends",
- doctype: "Sales Invoice"
- },
- ]
- }
-]
-
-pscript['onload_accounts-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Accounts");
-}
\ No newline at end of file
diff --git a/erpnext/accounts/page/accounts_home/accounts_home.txt b/erpnext/accounts/page/accounts_home/accounts_home.txt
deleted file mode 100644
index 3753617..0000000
--- a/erpnext/accounts/page/accounts_home/accounts_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-06-14 15:07:28",
- "docstatus": 0,
- "modified": "2013-07-11 14:40:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Accounts",
- "name": "__common__",
- "page_name": "accounts-home",
- "standard": "Yes",
- "title": "Accounts Home"
- },
- {
- "doctype": "Page",
- "name": "accounts-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
index 334c74b..192b206 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:06",
"docstatus": 0,
- "modified": "2014-02-10 17:29:01",
+ "modified": "2014-02-28 11:26:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -274,6 +274,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
index 30666bb..18b9216 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2014-02-10 17:28:54",
+ "modified": "2014-02-28 11:25:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -217,6 +217,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/buying/page/buying_home/__init__.py b/erpnext/buying/page/buying_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/buying/page/buying_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/buying/page/buying_home/buying_home.js b/erpnext/buying/page/buying_home/buying_home.js
deleted file mode 100644
index 2ba4761..0000000
--- a/erpnext/buying/page/buying_home/buying_home.js
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Buying"] = [
- {
- title: frappe._("Documents"),
- top: true,
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Supplier"),
- description: frappe._("Supplier database."),
- doctype:"Supplier"
- },
- {
- label: frappe._("Material Request"),
- description: frappe._("Request for purchase."),
- doctype:"Material Request"
- },
- {
- label: frappe._("Supplier Quotation"),
- description: frappe._("Quotations received from Suppliers."),
- doctype:"Supplier Quotation"
- },
- {
- label: frappe._("Purchase Order"),
- description: frappe._("Purchase Orders given to Suppliers."),
- doctype:"Purchase Order"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Contact"),
- description: frappe._("All Contacts."),
- doctype:"Contact"
- },
- {
- label: frappe._("Address"),
- description: frappe._("All Addresses."),
- doctype:"Address"
- },
- {
- label: frappe._("Item"),
- description: frappe._("All Products or Services."),
- doctype:"Item"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- "label": frappe._("Buying Settings"),
- "route": "Form/Buying Settings",
- "doctype":"Buying Settings",
- "description": frappe._("Settings for Buying Module")
- },
- {
- "label": frappe._("Purchase Taxes and Charges Master"),
- "doctype":"Purchase Taxes and Charges Master",
- "description": frappe._("Tax Template for Purchase")
- },
- {
- label: frappe._("Price List"),
- description: frappe._("Multiple Price list."),
- doctype:"Price List"
- },
- {
- label: frappe._("Item Price"),
- description: frappe._("Multiple Item prices."),
- doctype:"Item Price"
- },
- {
- "doctype":"Supplier Type",
- "label": frappe._("Supplier Type"),
- "description": frappe._("Supplier classification.")
- },
- {
- "route":"Sales Browser/Item Group",
- "label":frappe._("Item Group"),
- "description": frappe._("Tree of item classification"),
- doctype:"Item Group"
- },
- {
- label: frappe._("Terms and Conditions"),
- description: frappe._("Template of terms or contract."),
- doctype:"Terms and Conditions"
- },
- ]
- },
- {
- title: frappe._("Tools"),
- icon: "icon-wrench",
- items: [
- ]
- },
- {
- title: frappe._("Analytics"),
- right: true,
- icon: "icon-bar-chart",
- items: [
- {
- "label":frappe._("Purchase Analytics"),
- page: "purchase-analytics"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Items To Be Requested"),
- route: "query-report/Items To Be Requested",
- doctype: "Item"
- },
- {
- "label":frappe._("Requested Items To Be Ordered"),
- route: "query-report/Requested Items To Be Ordered",
- doctype: "Material Request"
- },
- {
- "label":frappe._("Material Requests for which Supplier Quotations are not created"),
- route: "query-report/Material Requests for which Supplier Quotations are not created",
- doctype: "Material Request"
- },
- {
- "label":frappe._("Purchase In Transit"),
- route: "query-report/Purchase In Transit",
- doctype: "Purchase Order"
- },
- {
- "label":frappe._("Item-wise Purchase History"),
- route: "query-report/Item-wise Purchase History",
- doctype: "Item"
- },
- {
- "label":frappe._("Item-wise Last Purchase Rate"),
- route: "query-report/Item-wise Last Purchase Rate",
- doctype: "Item"
- },
- {
- "label":frappe._("Purchase Order Trends"),
- route: "query-report/Purchase Order Trends",
- doctype: "Purchase Order"
- },
- {
- "label":frappe._("Supplier Addresses And Contacts"),
- route: "query-report/Supplier Addresses and Contacts",
- doctype: "Supplier"
- },
- {
- "label":frappe._("Supplier-Wise Sales Analytics"),
- route: "query-report/Supplier-Wise Sales Analytics",
- doctype: "Stock Ledger Entry"
- }
- ]
- }
-]
-
-pscript['onload_buying-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Buying");
-}
diff --git a/erpnext/buying/page/buying_home/buying_home.txt b/erpnext/buying/page/buying_home/buying_home.txt
deleted file mode 100644
index 49a782f..0000000
--- a/erpnext/buying/page/buying_home/buying_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:22:54",
- "docstatus": 0,
- "modified": "2013-07-11 14:41:50",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Buying",
- "name": "__common__",
- "page_name": "buying-home",
- "standard": "Yes",
- "title": "Buying Home"
- },
- {
- "doctype": "Page",
- "name": "buying-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
new file mode 100644
index 0000000..2a47c2a
--- /dev/null
+++ b/erpnext/config/accounts.py
@@ -0,0 +1,303 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Journal Voucher",
+ "description": _("Accounting journal entries.")
+ },
+ {
+ "type": "doctype",
+ "name": "Sales Invoice",
+ "description": _("Bills raised to Customers.")
+ },
+ {
+ "type": "doctype",
+ "name": "Purchase Invoice",
+ "description": _("Bills raised by Suppliers.")
+ },
+ {
+ "type": "doctype",
+ "name": "Customer",
+ "description": _("Customer database.")
+ },
+ {
+ "type": "doctype",
+ "name": "Supplier",
+ "description": _("Supplier database.")
+ },
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Bank Reconciliation",
+ "description": _("Update bank payment dates with journals.")
+ },
+ {
+ "type": "doctype",
+ "name": "Payment to Invoice Matching Tool",
+ "description": _("Match non-linked Invoices and Payments.")
+ },
+ {
+ "type": "doctype",
+ "name": "Period Closing Voucher",
+ "description": _("Close Balance Sheet and book Profit or Loss.")
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Fiscal Year",
+ "description": _("Financial / accounting year.")
+ },
+ {
+ "type": "page",
+ "name": "Accounts Browser",
+ "icon": "icon-sitemap",
+ "label": _("Chart of Accounts"),
+ "route": "Accounts Browser/Account",
+ "description": _("Tree of finanial accounts."),
+ "doctype": "Account",
+ },
+ {
+ "type": "page",
+ "name": "Accounts Browser",
+ "icon": "icon-sitemap",
+ "label": _("Chart of Cost Centers"),
+ "route": "Accounts Browser/Cost Center",
+ "description": _("Tree of finanial Cost Centers."),
+ "doctype": "Cost Center",
+ },
+ {
+ "type": "doctype",
+ "name": "Accounts Settings",
+ "description": _("Default settings for accounting transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Sales Taxes and Charges Master",
+ "description": _("Tax template for selling transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Purchase Taxes and Charges Master",
+ "description": _("Tax template for buying transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "POS Setting",
+ "label": _("Point-of-Sale Setting"),
+ "description": _("Rules to calculate shipping amount for a sale")
+ },
+ {
+ "type": "doctype",
+ "name": "Shipping Rule",
+ "description": _("Rules for adding shipping costs.")
+ },
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
+ {
+ "type": "doctype",
+ "name": "Currency",
+ "description": _("Enable / disable currencies.")
+ },
+ {
+ "type": "doctype",
+ "name": "Currency Exchange",
+ "description": _("Currency exchange rate master.")
+ },
+ {
+ "type":"doctype",
+ "name": "Budget Distribution",
+ "description": _("Seasonality for setting budgets.")
+ },
+ {
+ "type": "doctype",
+ "name":"Terms and Conditions",
+ "label": _("Terms and Conditions Template"),
+ "description": _("Template of terms or contract.")
+ },
+ {
+ "type": "doctype",
+ "name":"Mode of Payment",
+ "description": _("e.g. Bank, Cash, Credit Card")
+ },
+ {
+ "type": "doctype",
+ "name":"C-Form",
+ "description": _("C-Form records"),
+ "country": "India"
+ }
+ ]
+ },
+ {
+ "label": _("Main Reports"),
+ "icon": "icon-table",
+ "items": [
+ {
+ "type": "report",
+ "name":"General Ledger",
+ "doctype": "GL Entry",
+ "is_query_report": True,
+ },
+ {
+ "type": "page",
+ "name": "trial-balance",
+ "label": _("Trial Balance"),
+ "icon": "icon-table"
+ },
+ {
+ "type": "page",
+ "name":"Financial Statements",
+ "icon": "icon-table"
+ },
+ {
+ "type": "report",
+ "name": "Accounts Receivable",
+ "doctype": "Sales Invoice",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Accounts Payable",
+ "doctype": "Purchase Invoice",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Sales Register",
+ "doctype": "Sales Invoice",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Purchase Register",
+ "doctype": "Purchase Invoice",
+ "is_query_report": True
+ },
+ {
+ "type": "page",
+ "name": "financial-analytics",
+ "label": _("Financial Analytics"),
+ "icon": "icon-bar-chart",
+ },
+ {
+ "type": "report",
+ "name": "Gross Profit",
+ "doctype": "Sales Invoice",
+ "is_query_report": True
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "name": "Bank Reconciliation Statement",
+ "is_query_report": True,
+ "doctype": "Journal Voucher"
+ },
+ {
+ "type": "report",
+ "name": "Ordered Items To Be Billed",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Delivered Items To Be Billed",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Purchase Order Items To Be Billed",
+ "is_query_report": True,
+ "doctype": "Purchase Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Received Items To Be Billed",
+ "is_query_report": True,
+ "doctype": "Purchase Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Bank Clearance Summary",
+ "is_query_report": True,
+ "doctype": "Journal Voucher"
+ },
+ {
+ "type": "report",
+ "name": "Payment Period Based On Invoice Date",
+ "is_query_report": True,
+ "doctype": "Journal Voucher"
+ },
+ {
+ "type": "report",
+ "name": "Sales Partners Commission",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Customer Account Head",
+ "is_query_report": True,
+ "doctype": "Account"
+ },
+ {
+ "type": "report",
+ "name": "Supplier Account Head",
+ "is_query_report": True,
+ "doctype": "Account"
+ },
+ {
+ "type": "report",
+ "name": "Item-wise Sales Register",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Item-wise Purchase Register",
+ "is_query_report": True,
+ "doctype": "Purchase Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Budget Variance Report",
+ "is_query_report": True,
+ "doctype": "Cost Center"
+ },
+ {
+ "type": "report",
+ "name": "Purchase Invoice Trends",
+ "is_query_report": True,
+ "doctype": "Purchase Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Sales Invoice Trends",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py
new file mode 100644
index 0000000..0c8c2f6
--- /dev/null
+++ b/erpnext/config/buying.py
@@ -0,0 +1,169 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Supplier",
+ "description": _("Supplier database."),
+ },
+ {
+ "type": "doctype",
+ "name": "Material Request",
+ "description": _("Request for purchase."),
+ },
+ {
+ "type": "doctype",
+ "name": "Supplier Quotation",
+ "description": _("Quotations received from Suppliers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Purchase Order",
+ "description": _("Purchase Orders given to Suppliers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Contact",
+ "description": _("All Contacts."),
+ },
+ {
+ "type": "doctype",
+ "name": "Address",
+ "description": _("All Addresses."),
+ },
+ {
+ "type": "doctype",
+ "name": "Item",
+ "description": _("All Products or Services."),
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Buying Settings",
+ "description": _("Default settings for buying transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Supplier Type",
+ "description": _("Supplier Type master.")
+ },
+ {
+ "type": "page",
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "label": _("Item Group Tree"),
+ "link": "Sales Browser/Item Group",
+ "description": _("Tree of Item Groups."),
+ "doctype": "Item Group",
+ },
+ {
+ "type": "doctype",
+ "name":"Terms and Conditions",
+ "label": _("Terms and Conditions Template"),
+ "description": _("Template of terms or contract.")
+ },
+ {
+ "type": "doctype",
+ "name": "Purchase Taxes and Charges Master",
+ "description": _("Tax template for buying transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Price List",
+ "description": _("Price List master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Item Price",
+ "description": _("Multiple Item prices."),
+ "route": "Report/Item Price"
+ },
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
+ ]
+ },
+ {
+ "label": _("Main Reports"),
+ "icon": "icon-table",
+ "items": [
+ {
+ "type": "page",
+ "name": "purchase-analytics",
+ "label": _("Purchase Analytics"),
+ "icon": "icon-bar-chart",
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Items To Be Requested",
+ "doctype": "Item"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Requested Items To Be Ordered",
+ "doctype": "Material Request"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Material Requests for which Supplier Quotations are not created",
+ "doctype": "Material Request"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Purchase In Transit",
+ "doctype": "Purchase Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Item-wise Purchase History",
+ "doctype": "Item"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Item-wise Last Purchase Rate",
+ "doctype": "Item"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Purchase Order Trends",
+ "doctype": "Purchase Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Supplier Addresses And Contacts",
+ "doctype": "Supplier"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Supplier-Wise Sales Analytics",
+ "doctype": "Stock Ledger Entry"
+ }
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index 7aeff66..700013f 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -4,7 +4,6 @@
"Accounts": {
"color": "#3498db",
"icon": "icon-money",
- "link": "accounts-home",
"type": "module"
},
"Activity": {
@@ -17,20 +16,17 @@
"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": {
@@ -44,25 +40,21 @@
"Projects": {
"color": "#8e44ad",
"icon": "icon-puzzle-piece",
- "link": "projects-home",
"type": "module"
},
"Selling": {
"color": "#1abc9c",
"icon": "icon-tag",
- "link": "selling-home",
"type": "module"
},
"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/erpnext/config/hr.py b/erpnext/config/hr.py
new file mode 100644
index 0000000..6739893
--- /dev/null
+++ b/erpnext/config/hr.py
@@ -0,0 +1,202 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Employee",
+ "description": _("Employee records."),
+ },
+ {
+ "type": "doctype",
+ "name": "Salary Slip",
+ "description": _("Monthly salary statement."),
+ },
+ {
+ "type": "doctype",
+ "name": "Leave Application",
+ "description": _("Applications for leave."),
+ },
+ {
+ "type": "doctype",
+ "name": "Attendance",
+ "description": _("Attendance record."),
+ },
+ {
+ "type": "doctype",
+ "name": "Expense Claim",
+ "description": _("Claims for company expense."),
+ },
+ {
+ "type": "doctype",
+ "name": "Appraisal",
+ "description": _("Performance appraisal."),
+ },
+ {
+ "type": "doctype",
+ "name": "Job Applicant",
+ "description": _("Applicant for a Job."),
+ },
+ {
+ "type": "doctype",
+ "name": "Job Opening",
+ "description": _("Opening for a Job."),
+ },
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Salary Manager",
+ "label": _("Process Payroll"),
+ "description":_("Generate Salary Slips"),
+ "hide_count": True
+ },
+ {
+ "type": "doctype",
+ "name": "Upload Attendance",
+ "description":_("Upload attendance from a .csv file"),
+ "hide_count": True
+ },
+ {
+ "type": "doctype",
+ "name": "Leave Control Panel",
+ "label": _("Leave Allocation Tool"),
+ "description":_("Allocate leaves for the year."),
+ "hide_count": True
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "HR Settings",
+ "description": _("Settings for HR Module")
+ },
+ {
+ "type": "doctype",
+ "name": "Employee",
+ "description": _("Employee master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Employment Type",
+ "description": _("Types of employment (permanent, contract, intern etc.).")
+ },
+ {
+ "type": "doctype",
+ "name": "Branch",
+ "description": _("Organization branch master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Department",
+ "description": _("Organization unit (department) master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Grade",
+ "description": _("Employee grade.")
+ },
+ {
+ "type": "doctype",
+ "name": "Designation",
+ "description": _("Employee designation (e.g. CEO, Director etc.).")
+ },
+ {
+ "type": "doctype",
+ "name": "Salary Structure",
+ "description": _("Salary template master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Earning Type",
+ "description": _("Salary components.")
+ },
+ {
+ "type": "doctype",
+ "name": "Deduction Type",
+ "description": _("Tax and other salary deductions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Leave Allocation",
+ "description": _("Allocate leaves for a period.")
+ },
+ {
+ "type": "doctype",
+ "name":"Leave Type",
+ "description": _("Type of leaves like casual, sick etc."),
+ },
+ {
+ "type": "doctype",
+ "name": "Holiday List",
+ "description": _("Holiday master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Leave Block List",
+ "description": _("Block leave applications by department.")
+ },
+ {
+ "type": "doctype",
+ "name": "Appraisal Template",
+ "description": _("Template for performance appraisals.")
+ },
+ {
+ "type": "doctype",
+ "name": "Expense Claim Type",
+ "description": _("Types of Expense Claim.")
+ },
+ {
+ "type": "doctype",
+ "name": "Jobs Email Settings",
+ "description": _("Setup incoming server for jobs email id. (e.g. jobs@example.com)")
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Employee Leave Balance",
+ "doctype": "Leave Application"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Employee Birthday",
+ "doctype": "Employee"
+ },
+ {
+ "type": "report",
+ "name": "Employee Information",
+ "doctype": "Employee"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Monthly Salary Register",
+ "doctype": "Salary Slip"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Monthly Attendance Sheet",
+ "doctype": "Attendance"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/manufacturing.py b/erpnext/config/manufacturing.py
new file mode 100644
index 0000000..618fa14
--- /dev/null
+++ b/erpnext/config/manufacturing.py
@@ -0,0 +1,77 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Bill of Materials",
+ "description": _("Bill of Materials (BOM)"),
+ },
+ {
+ "type": "doctype",
+ "name": "Production Order",
+ "description": _("Orders released for production."),
+ },
+ {
+ "type": "doctype",
+ "name": "Item",
+ "description": _("All Products or Services."),
+ },
+ {
+ "type": "doctype",
+ "name": "Workstation",
+ "description": _("Where manufacturing operations are carried out."),
+ },
+
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Production Planning Tool",
+ "description": _("Generate Material Requests (MRP) and Production Orders."),
+ },
+ {
+ "type": "doctype",
+ "name": "BOM Replace Tool",
+ "description": _("Replace Item / BOM in all BOMs"),
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Open Production Orders",
+ "doctype": "Production Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Production Orders in Progress",
+ "doctype": "Production Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Issued Items Against Production Order",
+ "doctype": "Production Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Completed Production Orders",
+ "doctype": "Production Order"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/projects.py b/erpnext/config/projects.py
new file mode 100644
index 0000000..8cc30a5
--- /dev/null
+++ b/erpnext/config/projects.py
@@ -0,0 +1,66 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Task",
+ "description": _("Project activity / task."),
+ },
+ {
+ "type": "doctype",
+ "name": "Project",
+ "description": _("Project master."),
+ },
+ {
+ "type": "doctype",
+ "name": "Time Log",
+ "description": _("Time Log for tasks."),
+ },
+ {
+ "type": "doctype",
+ "name": "Time Log Batch",
+ "description": _("Batch Time Logs for billing."),
+ },
+ {
+ "type": "doctype",
+ "name": "Activity Type",
+ "description": _("Types of activities for Time Sheets"),
+ },
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "report",
+ "route": "Gantt/Task",
+ "doctype": "Task",
+ "name": "Gantt Chart",
+ "description": _("Gantt chart of all tasks.")
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Daily Time Log Summary",
+ "doctype": "Time Log"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Project wise Stock Tracking",
+ "doctype": "Project"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
new file mode 100644
index 0000000..65cec9e
--- /dev/null
+++ b/erpnext/config/selling.py
@@ -0,0 +1,260 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Lead",
+ "description": _("Database of potential customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Customer",
+ "description": _("Customer database."),
+ },
+ {
+ "type": "doctype",
+ "name": "Opportunity",
+ "description": _("Potential opportunities for selling."),
+ },
+ {
+ "type": "doctype",
+ "name": "Quotation",
+ "description": _("Quotes to Leads or Customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Sales Order",
+ "description": _("Confirmed orders from Customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Contact",
+ "description": _("All Contacts."),
+ },
+ {
+ "type": "doctype",
+ "name": "Address",
+ "description": _("All Addresses."),
+ },
+ {
+ "type": "doctype",
+ "name": "Item",
+ "description": _("All Products or Services."),
+ },
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "SMS Center",
+ "description":_("Send mass SMS to your contacts"),
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Selling Settings",
+ "description": _("Default settings for selling transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Campaign",
+ "description": _("Sales campaigns."),
+ },
+ {
+ "type": "page",
+ "label": _("Customer Group"),
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "link": "Sales Browser/Customer Group",
+ "description": _("Manage Customer Group Tree."),
+ "doctype": "Customer Group",
+ },
+ {
+ "type": "page",
+ "label": _("Territory"),
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "link": "Sales Browser/Territory",
+ "description": _("Manage Territory Tree."),
+ "doctype": "Territory",
+ },
+ {
+ "type": "page",
+ "label": _("Sales Person"),
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "link": "Sales Browser/Sales Person",
+ "description": _("Manage Sales Person Tree."),
+ "doctype": "Sales Person",
+ },
+ {
+ "type": "page",
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "label": _("Item Group Tree"),
+ "link": "Sales Browser/Item Group",
+ "description": _("Tree of Item Groups."),
+ "doctype": "Item Group",
+ },
+ {
+ "type": "doctype",
+ "name":"Terms and Conditions",
+ "label": _("Terms and Conditions Template"),
+ "description": _("Template of terms or contract.")
+ },
+ {
+ "type": "doctype",
+ "name": "Sales Taxes and Charges Master",
+ "description": _("Tax template for selling transactions.")
+ },
+ {
+ "type": "doctype",
+ "name": "Shipping Rule",
+ "description": _("Rules for adding shipping costs.")
+ },
+ {
+ "type": "doctype",
+ "name": "Price List",
+ "description": _("Price List master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Item Price",
+ "description": _("Multiple Item prices."),
+ "route": "Report/Item Price"
+ },
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
+ {
+ "type": "doctype",
+ "name": "Sales BOM",
+ "description": _("Bundle items at time of sale."),
+ },
+ {
+ "type": "doctype",
+ "name": "Sales Email Settings",
+ "description": _("Setup incoming server for sales email id. (e.g. sales@example.com)")
+ },
+ ]
+ },
+ {
+ "label": _("Main Reports"),
+ "icon": "icon-table",
+ "items": [
+ {
+ "type": "page",
+ "name": "sales-analytics",
+ "label": _("Sales Analytics"),
+ "icon": "icon-bar-chart",
+ },
+ {
+ "type": "page",
+ "name": "sales-funnel",
+ "label": _("Sales Funnel"),
+ "icon": "icon-bar-chart",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Customer Acquisition and Loyalty",
+ "doctype": "Customer",
+ "icon": "icon-bar-chart",
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Lead Details",
+ "doctype": "Lead"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Customer Addresses And Contacts",
+ "doctype": "Contact"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Ordered Items To Be Delivered",
+ "doctype": "Sales Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Sales Person-wise Transaction Summary",
+ "doctype": "Sales Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Item-wise Sales History",
+ "doctype": "Item"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Territory Target Variance (Item Group-Wise)",
+ "route": "query-report/Territory Target Variance Item Group-Wise",
+ "doctype": "Territory"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Sales Person Target Variance (Item Group-Wise)",
+ "route": "query-report/Sales Person Target Variance Item Group-Wise",
+ "doctype": "Sales Person",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Customers Not Buying Since Long Time",
+ "doctype": "Sales Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Quotation Trend",
+ "doctype": "Quotation"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Sales Order Trends",
+ "doctype": "Sales Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Available Stock for Packing Items",
+ "doctype": "Item",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Pending SO Items For Purchase Request",
+ "doctype": "Sales Order"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py
index be096d8..e539390 100644
--- a/erpnext/config/setup.py
+++ b/erpnext/config/setup.py
@@ -1,7 +1,21 @@
from frappe import _
+from frappe.widgets.moduleview import add_setup_section
data = [
{
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Global Defaults",
+ "label": _("Global Settings"),
+ "description": _("Set the Date & Number Formats, Default Currency, Current Fiscal Year, etc."),
+ "hide_count": True
+ }
+ ]
+ },
+ {
"label": _("Customize"),
"icon": "icon-glass",
"items": [
@@ -85,207 +99,19 @@
},
]
},
- {
- "label": _("Accounts"),
- "icon": "icon-money",
- "items": [
- {
- "type": "page",
- "name": "Accounts Browser",
- "icon": "icon-sitemap",
- "label": _("Chart of Accounts"),
- "link": "Accounts Browser/Account",
- "description": _("Tree of finanial accounts.")
- },
- {
- "type": "page",
- "name": "Accounts Browser",
- "icon": "icon-sitemap",
- "label": _("Chart of Cost Centers"),
- "link": "Accounts Browser/Cost Center",
- "description": _("Tree of finanial Cost Centers.")
- },
- {
- "type": "doctype",
- "name": "Accounts Settings",
- "description": _("Default settings for accounting transactions.")
- },
- {
- "type": "doctype",
- "name": "Fiscal Year",
- "description": _("Financial / accounting year.")
- },
- {
- "type": "doctype",
- "name": "Sales Taxes and Charges Master",
- "description": _("Tax template for selling transactions.")
- },
- {
- "type": "doctype",
- "name": "Purchase Taxes and Charges Master",
- "description": _("Tax template for buying transactions.")
- },
- {
- "type": "doctype",
- "name": "Currency",
- "description": _("Enable / disable currencies.")
- },
- {
- "type": "doctype",
- "name": "Shipping Rules",
- "description": _("Rules for adding shipping costs.")
- },
- {
- "type": "doctype",
- "name": "Currency Exchange",
- "description": _("Currency exchange rate master.")
- },
- ]
- },
- {
- "label": _("Stock"),
- "icon": "icon-truck",
- "items": [
- {
- "type": "page",
- "name": "Sales Browser",
- "icon": "icon-sitemap",
- "label": _("Item Group Tree"),
- "link": "Sales Browser/Item Group",
- "description": _("Tree of Item Groups.")
- },
- {
- "type": "doctype",
- "name": "Stock Settings",
- "description": _("Default settings for stock transactions.")
- },
- {
- "type": "doctype",
- "name": "Warehouse",
- "description": _("Warehouses.")
- },
- {
- "type": "doctype",
- "name": "Brand",
- "description": _("Brand master.")
- },
- {
- "type": "doctype",
- "name": "Price List",
- "description": _("Price List master.")
- },
- {
- "type": "doctype",
- "name": "Stock Reconciliation",
- "description": _("Upload actual stock for a warehouse.")
- },
- ]
- },
- {
- "label": _("Selling"),
- "icon": "icon-tag",
- "items": [
- {
- "type": "doctype",
- "name": "Selling Settings",
- "description": _("Default settings for selling transactions.")
- },
- {
- "type": "page",
- "label": _("Customer Group"),
- "name": "Sales Browser",
- "icon": "icon-sitemap",
- "link": "Sales Browser/Customer Group",
- "description": _("Manage Customer Group Tree.")
- },
- {
- "type": "page",
- "label": _("Territory"),
- "name": "Sales Browser",
- "icon": "icon-sitemap",
- "link": "Sales Browser/Territory",
- "description": _("Manage Territory Tree.")
- },
- {
- "type": "page",
- "label": _("Sales Person"),
- "name": "Sales Browser",
- "icon": "icon-sitemap",
- "link": "Sales Browser/Sales Person",
- "description": _("Manage Sales Person Tree.")
- },
- ]
- },
- {
- "label": _("Buying"),
- "icon": "icon-shopping-cart",
- "items": [
- {
- "type": "doctype",
- "name": "Buying Settings",
- "description": _("Default settings for buying transactions.")
- },
- {
- "type": "doctype",
- "name": "Supplier Type",
- "description": _("Supplier Type master.")
- },
- ]
- },
- {
- "label": _("Human Resources"),
- "icon": "icon-group",
- "items": [
- {
- "type": "doctype",
- "name": "Employee",
- "description": _("Employee master.")
- },
- {
- "type": "doctype",
- "name": "Employment Type",
- "description": _("Types of employment (permanent, contract, intern etc.).")
- },
- {
- "type": "doctype",
- "name": "Branch",
- "description": _("Organization branch master.")
- },
- {
- "type": "doctype",
- "name": "Department",
- "description": _("Organization unit (department) master.")
- },
- {
- "type": "doctype",
- "name": "Grade",
- "description": _("Employee grade.")
- },
- {
- "type": "doctype",
- "name": "Designation",
- "description": _("Employee designation (e.g. CEO, Director etc.).")
- },
- {
- "type": "doctype",
- "name": "Holiday List",
- "description": _("Holiday master.")
- },
- {
- "type": "doctype",
- "name": "Salary Structure",
- "description": _("Salary template master.")
- },
- {
- "type": "doctype",
- "name": "Appraisal Template",
- "description": _("Template for performance appraisals.")
- },
- {
- "type": "doctype",
- "name": "Leave Allocation",
- "description": _("Allocate leaves for a period.")
- },
- ]
- },
]
+
+def get_data():
+ out = list(data)
+
+ for module, label, icon in (
+ ("accounts", _("Accounts"), "icon-money"),
+ ("stock", _("Stock"), "icon-truck"),
+ ("selling", _("Selling"), "icon-tag"),
+ ("buying", _("Buying"), "icon-shopping-cart"),
+ ("hr", _("Human Resources"), "icon-group"),
+ ("support", _("Support"), "icon-phone")):
+
+ add_setup_section(out, "erpnext", module, label, icon)
+
+ return out
\ No newline at end of file
diff --git a/erpnext/config/stock.py b/erpnext/config/stock.py
new file mode 100644
index 0000000..afc4ea8
--- /dev/null
+++ b/erpnext/config/stock.py
@@ -0,0 +1,263 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Material Request",
+ "description": _("Requests for items."),
+ },
+ {
+ "type": "doctype",
+ "name": "Stock Entry",
+ "description": _("Record item movement."),
+ },
+ {
+ "type": "doctype",
+ "name": "Delivery Note",
+ "description": _("Shipments to customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Purchase Receipt",
+ "description": _("Goods received from Suppliers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Item",
+ "description": _("All Products or Services."),
+ },
+ {
+ "type": "doctype",
+ "name": "Warehouse",
+ "description": _("Where items are stored."),
+ },
+ {
+ "type": "doctype",
+ "name": "Serial No",
+ "description": _("Single unit of an Item."),
+ },
+ {
+ "type": "doctype",
+ "name": "Batch",
+ "description": _("Batch (lot) of an Item."),
+ },
+ ]
+ },
+ {
+ "label": _("Tools"),
+ "icon": "icon-wrench",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Stock Reconciliation",
+ "description": _("Upload stock balance via csv.")
+ },
+ {
+ "type": "doctype",
+ "name": "Installation Note",
+ "description": _("Installation record for a Serial No.")
+ },
+ {
+ "type": "doctype",
+ "name": "Packing Slip",
+ "description": _("Split Delivery Note into packages.")
+ },
+ {
+ "type": "doctype",
+ "name": "Quality Inspection",
+ "description": _("Incoming quality inspection.")
+ },
+ {
+ "type": "doctype",
+ "name": "Landed Cost Wizard",
+ "description": _("Distribute transport overhead across items."),
+ },
+ {
+ "type": "doctype",
+ "name": "Stock UOM Replace Utility",
+ "description": _("Change UOM for an Item."),
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Stock Settings",
+ "description": _("Default settings for stock transactions.")
+ },
+ {
+ "type": "page",
+ "name": "Sales Browser",
+ "icon": "icon-sitemap",
+ "label": _("Item Group Tree"),
+ "link": "Sales Browser/Item Group",
+ "description": _("Tree of Item Groups."),
+ "doctype": "Item Group",
+ },
+ {
+ "type": "doctype",
+ "name": "UOM",
+ "label": _("Unit of Measure") + " (UOM)",
+ "description": _("e.g. Kg, Unit, Nos, m")
+ },
+ {
+ "type": "doctype",
+ "name": "Warehouse",
+ "description": _("Warehouses.")
+ },
+ {
+ "type": "doctype",
+ "name": "Brand",
+ "description": _("Brand master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Price List",
+ "description": _("Price List master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Item Price",
+ "description": _("Multiple Item prices."),
+ "route": "Report/Item Price"
+ },
+ ]
+ },
+ {
+ "label": _("Main Reports"),
+ "icon": "icon-table",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Stock Ledger",
+ "doctype": "Item",
+ },
+ {
+ "type": "page",
+ "name": "stock-balance",
+ "label": _("Stock Balance"),
+ "icon": "icon-table",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Stock Projected Qty",
+ "doctype": "Item",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Stock Ageing",
+ "doctype": "Item",
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Item-wise Price List Rate",
+ "doctype": "Item Price",
+ },
+ {
+ "type": "page",
+ "name": "stock-analytics",
+ "label": _("Stock Analytics"),
+ "icon": "icon-bar-chart"
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Ordered Items To Be Delivered",
+ "doctype": "Delivery Note"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Purchase Order Items To Be Received",
+ "doctype": "Purchase Receipt"
+ },
+ {
+ "type": "report",
+ "name": "Item Shortage Report",
+ "route": "Report/Bin/Item Shortage Report",
+ "doctype": "Purchase Receipt"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Serial No Service Contract Expiry",
+ "doctype": "Serial No"
+ },
+ {
+ "type": "report",
+ "name": "Serial No Status",
+ "doctype": "Serial No"
+ },
+ {
+ "type": "report",
+ "name": "Serial No Warranty Expiry",
+ "doctype": "Serial No"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Purchase In Transit",
+ "doctype": "Purchase Order"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Requested Items To Be Transferred",
+ "doctype": "Material Request"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Batch-Wise Balance History",
+ "doctype": "Batch"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Warehouse-Wise Stock Balance",
+ "doctype": "Warehouse"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Item Prices",
+ "doctype": "Price List"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Itemwise Recommended Reorder Level",
+ "doctype": "Item"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Delivery Note Trends",
+ "doctype": "Delivery Note"
+ },
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Purchase Receipt Trends",
+ "doctype": "Purchase Receipt"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/config/support.py b/erpnext/config/support.py
new file mode 100644
index 0000000..0914320
--- /dev/null
+++ b/erpnext/config/support.py
@@ -0,0 +1,74 @@
+from frappe import _
+
+data = [
+ {
+ "label": _("Documents"),
+ "icon": "icon-star",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Support Ticket",
+ "description": _("Support queries from customers."),
+ },
+ {
+ "type": "doctype",
+ "name": "Customer Issue",
+ "description": _("Customer Issue against Serial No."),
+ },
+ {
+ "type": "doctype",
+ "name": "Maintenance Schedule",
+ "description": _("Plan for maintenance visits."),
+ },
+ {
+ "type": "doctype",
+ "name": "Maintenance Visit",
+ "description": _("Visit report for maintenance call."),
+ },
+ {
+ "type": "doctype",
+ "name": "Newsletter",
+ "description": _("Newsletters to contacts, leads."),
+ },
+ {
+ "type": "doctype",
+ "name": "Communication",
+ "description": _("Communication log."),
+ },
+ {
+ "type": "doctype",
+ "name": "Serial No",
+ "description": _("Single unit of an Item."),
+ },
+ ]
+ },
+ {
+ "label": _("Setup"),
+ "icon": "icon-cog",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Support Email Settings",
+ "description": _("Setup incoming server for support email id. (e.g. support@example.com)")
+ },
+ ]
+ },
+ {
+ "label": _("Standard Reports"),
+ "icon": "icon-list",
+ "items": [
+ {
+ "type": "page",
+ "name": "support-analytics",
+ "label": _("Support Analytics"),
+ "icon": "icon-bar-chart"
+ },
+ {
+ "type": "report",
+ "name": "Maintenance Schedules",
+ "is_query_report": True,
+ "doctype": "Maintenance Schedule"
+ },
+ ]
+ },
+]
\ No newline at end of file
diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt
index 8b0ece2..b6969dd 100644
--- a/erpnext/hooks.txt
+++ b/erpnext/hooks.txt
@@ -29,10 +29,6 @@
bean_event:*:on_submit = erpnext.home.update_feed
bean_event:Comment:on_update = erpnext.home.make_comment_feed
-bean_event:*:on_update = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
-bean_event:*:on_cancel = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
-bean_event:*:on_trash = frappe.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
diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py
index 91d3fad..4f75345 100644
--- a/erpnext/hr/doctype/job_applicant/get_job_applications.py
+++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py
@@ -21,6 +21,7 @@
applicant = frappe.bean("Job Applicant", name)
if applicant.doc.status!="Rejected":
applicant.doc.status = "Open"
+ applicant.ignore_permissions = True
applicant.doc.save()
else:
name = (mail.from_real_name and (mail.from_real_name + " - ") or "") \
@@ -32,6 +33,8 @@
"email_id": mail.from_email,
"status": "Open"
})
+ applicant.ignore_permissions = True
+ applicant.ignore_mandatory = True
applicant.insert()
mail.save_attachments_in_doc(applicant.doc)
diff --git a/erpnext/hr/page/hr_home/__init__.py b/erpnext/hr/page/hr_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/hr/page/hr_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/hr/page/hr_home/hr_home.js b/erpnext/hr/page/hr_home/hr_home.js
deleted file mode 100644
index af6a108..0000000
--- a/erpnext/hr/page/hr_home/hr_home.js
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["HR"] = [
- {
- title: frappe._("Top"),
- top: true,
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Employee"),
- description: frappe._("Employee records."),
- doctype:"Employee"
- },
- {
- label: frappe._("Leave Application"),
- description: frappe._("Applications for leave."),
- doctype:"Leave Application"
- },
- {
- label: frappe._("Expense Claim"),
- description: frappe._("Claims for company expense."),
- doctype:"Expense Claim"
- },
- {
- label: frappe._("Salary Slip"),
- description: frappe._("Monthly salary statement."),
- doctype:"Salary Slip"
- },
- {
- label: frappe._("Attendance"),
- description: frappe._("Attendance record."),
- doctype:"Attendance"
- },
- ]
- },
- {
- title: frappe._("Documents"),
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Job Applicant"),
- description: frappe._("Applicant for a Job."),
- doctype:"Job Applicant"
- },
- {
- label: frappe._("Appraisal"),
- description: frappe._("Performance appraisal."),
- doctype:"Appraisal"
- },
- ]
- },
- {
- title: frappe._("Leave Setup"),
- icon: "icon-cog",
- items: [
- {
- "route":"Form/Upload Attendance/Upload Attendance",
- "label":frappe._("Upload Attendance"),
- "description":frappe._("Upload attendance from a .csv file"),
- doctype: "Upload Attendance"
- },
- {
- "route":"Form/Leave Control Panel/Leave Control Panel",
- "label": frappe._("Leave Allocation Tool"),
- "description": frappe._("Allocate leaves for the year."),
- doctype: "Leave Control Panel"
- },
- {
- "label":frappe._("Leave Allocation"),
- "description":frappe._("Leave allocations."),
- doctype: "Leave Allocation"
- },
- {
- "label":frappe._("Leave Type"),
- "description":frappe._("Type of leaves like casual, sick etc."),
- doctype: "Leave Type"
- },
- {
- "label":frappe._("Holiday List"),
- "description":frappe._("List of holidays."),
- doctype: "Holiday List"
- },
- {
- "label":frappe._("Leave Block List"),
- "description":frappe._("Block leave applications by department."),
- doctype: "Leave Block List"
- },
- ]
- },
- {
- title: frappe._("Payroll Setup"),
- icon: "icon-cog",
- items: [
- {
- "label": frappe._("Salary Structure"),
- "description": frappe._("Monthly salary template."),
- doctype: "Salary Structure"
- },
- {
- "route":"Form/Salary Manager/Salary Manager",
- "label":frappe._("Process Payroll"),
- "description":frappe._("Generate Salary Slips"),
- doctype: "Salary Manager"
- },
- {
- "label": frappe._("Earning Type"),
- "description": frappe._("Salary components."),
- doctype: "Earning Type"
- },
- {
- "label": frappe._("Deduction Type"),
- "description": frappe._("Tax and other salary deductions."),
- doctype: "Deduction Type"
- },
- ]
- },
- {
- title: frappe._("Employee Setup"),
- icon: "icon-cog",
- items: [
- {
- label: frappe._("Job Opening"),
- description: frappe._("Opening for a Job."),
- doctype:"Job Opening"
- },
- {
- "label": frappe._("Employment Type"),
- "description": frappe._("Type of employment master."),
- doctype: "Employment Type"
- },
- {
- "label": frappe._("Designation"),
- "description": frappe._("Employee Designation."),
- doctype: "Designation"
- },
- {
- "label": frappe._("Appraisal Template"),
- "description": frappe._("Template for employee performance appraisals."),
- doctype: "Appraisal Template"
- },
- {
- "label": frappe._("Expense Claim Type"),
- "description": frappe._("Types of Expense Claim."),
- doctype: "Expense Claim Type"
- },
- {
- "label": frappe._("Branch"),
- "description": frappe._("Company branches."),
- doctype: "Branch"
- },
- {
- "label": frappe._("Department"),
- "description": frappe._("Company departments."),
- doctype: "Department"
- },
- {
- "label": frappe._("Grade"),
- "description": frappe._("Employee grades"),
- doctype: "Grade"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- "label": frappe._("HR Settings"),
- "route": "Form/HR Settings",
- "doctype":"HR Settings",
- "description": "Settings for HR Module"
- }
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Employee Leave Balance"),
- route: "query-report/Employee Leave Balance",
- doctype: "Leave Application"
- },
- {
- "label":frappe._("Employee Birthday"),
- route: "query-report/Employee Birthday",
- doctype: "Employee"
- },
- {
- "label":frappe._("Employee Information"),
- route: "Report/Employee/Employee Information",
- doctype: "Employee"
- },
- {
- "label":frappe._("Monthly Salary Register"),
- route: "query-report/Monthly Salary Register",
- doctype: "Salary Slip"
- },
- {
- "label":frappe._("Monthly Attendance Sheet"),
- route: "query-report/Monthly Attendance Sheet",
- doctype: "Attendance"
- },
- ]
- }
-];
-
-pscript['onload_hr-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "HR");
-}
\ No newline at end of file
diff --git a/erpnext/hr/page/hr_home/hr_home.txt b/erpnext/hr/page/hr_home/hr_home.txt
deleted file mode 100644
index 3d53582..0000000
--- a/erpnext/hr/page/hr_home/hr_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:24:05",
- "docstatus": 0,
- "modified": "2013-07-11 14:42:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "HR",
- "name": "__common__",
- "page_name": "hr-home",
- "standard": "Yes",
- "title": "Human Resources Home"
- },
- {
- "doctype": "Page",
- "name": "hr-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/manufacturing/page/__init__.py b/erpnext/manufacturing/page/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/manufacturing/page/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/manufacturing/page/manufacturing_home/__init__.py b/erpnext/manufacturing/page/manufacturing_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/manufacturing/page/manufacturing_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.js b/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.js
deleted file mode 100644
index ab7bfe6..0000000
--- a/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Manufacturing"] = [
- {
- title: frappe._("Documents"),
- top: true,
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Bill of Materials"),
- description: frappe._("Bill of Materials (BOM)"),
- doctype:"BOM"
- },
- {
- label: frappe._("Production Order"),
- description: frappe._("Orders released for production."),
- doctype:"Production Order"
- },
- ]
- },
- {
- title: frappe._("Production Planning (MRP)"),
- icon: "icon-wrench",
- items: [
- {
- "route":"Form/Production Planning Tool/Production Planning Tool",
- "label":frappe._("Production Planning Tool"),
- "description":frappe._("Generate Material Requests (MRP) and Production Orders."),
- doctype: "Production Planning Tool"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Item"),
- description: frappe._("All Products or Services."),
- doctype:"Item"
- },
- {
- label: frappe._("Workstation"),
- description: frappe._("Where manufacturing operations are carried out."),
- doctype:"Workstation"
- },
- ]
- },
- {
- title: frappe._("Utility"),
- icon: "icon-wrench",
- items: [
- {
- "route":"Form/BOM Replace Tool/BOM Replace Tool",
- "label":frappe._("BOM Replace Tool"),
- "description":frappe._("Replace Item / BOM in all BOMs"),
- doctype: "BOM Replace Tool"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Open Production Orders"),
- route: "query-report/Open Production Orders",
- doctype:"Production Order"
- },
- {
- "label":frappe._("Production Orders in Progress"),
- route: "query-report/Production Orders in Progress",
- doctype:"Production Order"
- },
- {
- "label":frappe._("Issued Items Against Production Order"),
- route: "query-report/Issued Items Against Production Order",
- doctype:"Production Order"
- },
- {
- "label":frappe._("Completed Production Orders"),
- route: "query-report/Completed Production Orders",
- doctype:"Production Order"
- },
- ]
- }
-]
-
-pscript['onload_manufacturing-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Manufacturing");
-}
\ No newline at end of file
diff --git a/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.txt b/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.txt
deleted file mode 100644
index 5a946f3..0000000
--- a/erpnext/manufacturing/page/manufacturing_home/manufacturing_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:24:34",
- "docstatus": 0,
- "modified": "2013-07-11 14:43:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Manufacturing",
- "name": "__common__",
- "page_name": "manufacturing-home",
- "standard": "Yes",
- "title": "Manufacturing Home"
- },
- {
- "doctype": "Page",
- "name": "manufacturing-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index a6efd5a..824fe60 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -21,3 +21,9 @@
execute:frappe.db.sql("update tabPage set module='Core' where name='Setup'")
erpnext.patches.4_0.fields_to_be_renamed
erpnext.patches.4_0.rename_sitemap_to_route
+erpnext.patches.4_0.fix_contact_address
+erpnext.patches.4_0.customer_discount_to_pricing_rule
+execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
+erpnext.patches.4_0.remove_module_home_pages
+erpnext.patches.4_0.split_email_settings
+erpnext.patches.4_0.fix_employee_user_id
\ No newline at end of file
diff --git a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py
new file mode 100644
index 0000000..1566301
--- /dev/null
+++ b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py
@@ -0,0 +1,32 @@
+# 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 frappe
+
+def execute():
+ frappe.reload_doc("accounts", "doctype", "pricing_rule")
+
+ frappe.db.auto_commit_on_many_writes = True
+
+ for d in frappe.db.sql("""select * from `tabCustomer Discount`
+ where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1):
+ if not d.item_group:
+ item_group = frappe.db.sql("""select name from `tabItem Group`
+ where ifnull(parent_item_group, '') = ''""")[0][0]
+ else:
+ item_group = d.item_group
+
+ frappe.bean([{
+ "doctype": "Pricing Rule",
+ "apply_on": "Item Group",
+ "item_group": item_group,
+ "applicable_for": "Customer",
+ "customer": d.parent,
+ "price_or_discount": "Discount",
+ "discount_percentage": d.discount
+ }]).insert()
+
+ frappe.db.auto_commit_on_many_writes = False
+
+ frappe.delete_doc("DocType", "Customer Discount")
\ No newline at end of file
diff --git a/erpnext/patches/4_0/fields_to_be_renamed.py b/erpnext/patches/4_0/fields_to_be_renamed.py
index 0c0a235..2bbd430 100644
--- a/erpnext/patches/4_0/fields_to_be_renamed.py
+++ b/erpnext/patches/4_0/fields_to_be_renamed.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model import rename_field
-
+from frappe.modules import scrub, get_doctype_module
def execute():
rename_map = {
@@ -109,7 +109,7 @@
def reload_docs(docs):
for dn in docs:
- frappe.reload_doc(get_module(dn), "doctype", dn.lower().replace(" ", "_"))
+ frappe.reload_doc(get_doctype_module(dn), "doctype", scrub(dn))
# reload all standard print formats
for pf in frappe.db.sql("""select name, module from `tabPrint Format`
@@ -124,7 +124,8 @@
for r in frappe.db.sql("""select name, ref_doctype from `tabReport`
where ifnull(is_standard, 'No') = 'Yes'
and report_type in ('Report Builder', 'Query Report')""", as_dict=1):
- frappe.reload_doc(get_module(r.ref_doctype), "Report", r.name)
-
-def get_module(dn):
- return frappe.db.get_value("DocType", dn, "module").lower().replace(" ", "_")
\ No newline at end of file
+ try:
+ frappe.reload_doc(get_doctype_module(r.ref_doctype), "Report", r.name)
+ except Exception, e:
+ print e
+ pass
diff --git a/erpnext/patches/4_0/fix_contact_address.py b/erpnext/patches/4_0/fix_contact_address.py
new file mode 100644
index 0000000..4bf81b3
--- /dev/null
+++ b/erpnext/patches/4_0/fix_contact_address.py
@@ -0,0 +1,12 @@
+import frappe
+
+def execute():
+ frappe.reload_doc("website", "doctype", "contact_us_settings")
+ address = frappe.db.get_value("Contact Us Settings", None, "address")
+ if address:
+ address = frappe.doc("Address", address)
+ contact = frappe.bean("Contact Us Settings", "Contact Us Settings")
+ for f in ("address_title", "address_line1", "address_line2", "city", "state", "country", "pincode"):
+ contact.doc.fields[f] = address.get(f)
+
+ contact.save()
\ No newline at end of file
diff --git a/erpnext/patches/4_0/fix_employee_user_id.py b/erpnext/patches/4_0/fix_employee_user_id.py
new file mode 100644
index 0000000..71107f8
--- /dev/null
+++ b/erpnext/patches/4_0/fix_employee_user_id.py
@@ -0,0 +1,13 @@
+import frappe
+from frappe.utils import get_fullname
+
+def execute():
+ for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
+ where ifnull(user_id, '')!=''
+ group by user_id having count(name) > 1"""):
+
+ fullname = get_fullname(user_id)
+ employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
+ if employee:
+ frappe.db.sql("""update `tabEmployee` set user_id=null
+ where user_id=%s and name!=%s""", (user_id, employee))
\ No newline at end of file
diff --git a/erpnext/patches/4_0/remove_module_home_pages.py b/erpnext/patches/4_0/remove_module_home_pages.py
new file mode 100644
index 0000000..f7407a6
--- /dev/null
+++ b/erpnext/patches/4_0/remove_module_home_pages.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 frappe
+
+def execute():
+ for page in ("accounts-home", "website-home", "support-home", "stock-home", "selling-home", "projects-home",
+ "manufacturing-home", "hr-home", "buying-home"):
+ frappe.delete_doc("Page", page)
\ No newline at end of file
diff --git a/erpnext/patches/4_0/rename_sitemap_to_route.py b/erpnext/patches/4_0/rename_sitemap_to_route.py
index 0485bf9..b933e36 100644
--- a/erpnext/patches/4_0/rename_sitemap_to_route.py
+++ b/erpnext/patches/4_0/rename_sitemap_to_route.py
@@ -5,7 +5,12 @@
frappe.reload_doc("setup", "doctype", "item_group")
frappe.reload_doc("stock", "doctype", "item")
frappe.reload_doc("setup", "doctype", "sales_partner")
- frappe.model.rename_field("Item Group", "parent_website_sitemap", "parent_website_route")
- frappe.model.rename_field("Item", "parent_website_sitemap", "parent_website_route")
- frappe.model.rename_field("Sales Partner", "parent_website_sitemap",
- "parent_website_route")
+
+ try:
+ frappe.model.rename_field("Item Group", "parent_website_sitemap", "parent_website_route")
+ frappe.model.rename_field("Item", "parent_website_sitemap", "parent_website_route")
+ frappe.model.rename_field("Sales Partner", "parent_website_sitemap",
+ "parent_website_route")
+ except Exception, e:
+ if e.args[0]!=1054:
+ raise
\ No newline at end of file
diff --git a/erpnext/patches/4_0/split_email_settings.py b/erpnext/patches/4_0/split_email_settings.py
new file mode 100644
index 0000000..e73095e
--- /dev/null
+++ b/erpnext/patches/4_0/split_email_settings.py
@@ -0,0 +1,50 @@
+# 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 frappe
+
+def execute():
+ frappe.reload_doc("core", "doctype", "outgoing_email_settings")
+ frappe.reload_doc("support", "doctype", "support_email_settings")
+
+ email_settings = frappe.bean("Email Settings")
+ map_outgoing_email_settings(email_settings)
+ map_support_email_settings(email_settings)
+ frappe.delete_doc("Doctype", "Email Settings")
+
+def map_outgoing_email_settings(email_settings):
+ outgoing_email_settings = frappe.bean("Outgoing Email Settings")
+ for fieldname in (("outgoing_mail_server", "mail_server"),
+ "use_ssl", "mail_port", "mail_login", "mail_password",
+ "always_use_login_id_as_sender",
+ "auto_email_id", "send_print_in_body_and_attachment"):
+
+ if isinstance(fieldname, tuple):
+ from_fieldname, to_fieldname = fieldname
+ else:
+ from_fieldname = to_fieldname = fieldname
+
+ outgoing_email_settings.doc.fields[to_fieldname] = email_settings.doc.fields.get(from_fieldname)
+
+ outgoing_email_settings.save()
+
+def map_support_email_settings(email_settings):
+ support_email_settings = frappe.bean("Support Email Settings")
+
+ for fieldname in ("sync_support_mails", "support_email",
+ ("support_host", "mail_server"),
+ ("support_use_ssl", "use_ssl"),
+ ("support_username", "mail_login"),
+ ("support_password", "mail_password"),
+ "support_signature", "send_autoreply", "support_autoreply"):
+
+ if isinstance(fieldname, tuple):
+ from_fieldname, to_fieldname = fieldname
+ else:
+ from_fieldname = to_fieldname = fieldname
+
+ support_email_settings.doc.fields[to_fieldname] = email_settings.doc.fields.get(from_fieldname)
+
+ support_email_settings.save()
+
diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py
index c07713e..5070bfd 100644
--- a/erpnext/patches/4_0/update_user_properties.py
+++ b/erpnext/patches/4_0/update_user_properties.py
@@ -102,5 +102,5 @@
group by parent, defkey, defvalue""", as_dict=1):
if d.cnt > 1:
# order by parenttype so that restriction does not get removed!
- frappe.db.sql("""delete from tabDefaultValue where parent=%s, defkey=%s,
- defvalue=%s order by parenttype limit %s""", (d.parent, d.defkey, d.defvalue, d.cnt-1))
+ frappe.db.sql("""delete from tabDefaultValue where `parent`=%s and `defkey`=%s and
+ `defvalue`=%s order by parenttype limit %s""", (d.parent, d.defkey, d.defvalue, d.cnt-1))
diff --git a/erpnext/projects/page/__init__.py b/erpnext/projects/page/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/projects/page/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/projects/page/projects_home/__init__.py b/erpnext/projects/page/projects_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/projects/page/projects_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/projects/page/projects_home/projects_home.js b/erpnext/projects/page/projects_home/projects_home.js
deleted file mode 100644
index 9ee4dce..0000000
--- a/erpnext/projects/page/projects_home/projects_home.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Projects"] = [
- {
- title: frappe._("Top"),
- icon: "icon-copy",
- top: true,
- items: [
- {
- label: frappe._("Task"),
- description: frappe._("Project activity / task."),
- doctype:"Task"
- },
- {
- label: frappe._("Project"),
- description: frappe._("Project master."),
- doctype:"Project"
- },
- {
- label: frappe._("Time Log"),
- description: frappe._("Time Log for tasks."),
- doctype:"Time Log"
- },
- ]
- },
- {
- title: frappe._("Documents"),
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Time Log Batch"),
- description: frappe._("Batch Time Logs for billing."),
- doctype:"Time Log Batch"
- },
- ]
- },
- {
- title: frappe._("Tools"),
- icon: "icon-wrench",
- items: [
- {
- route: "Gantt/Task",
- label: frappe._("Gantt Chart"),
- "description":frappe._("Gantt chart of all tasks.")
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Activity Type"),
- description: frappe._("Types of activities for Time Sheets"),
- doctype:"Activity Type"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Daily Time Log Summary"),
- route: "query-report/Daily Time Log Summary",
- doctype: "Time Log"
- },
- {
- "label":frappe._("Project wise Stock Tracking"),
- route: "query-report/Project wise Stock Tracking",
- doctype: "Project"
- },
- ]
- }]
-
-pscript['onload_projects-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Projects");
-}
\ No newline at end of file
diff --git a/erpnext/projects/page/projects_home/projects_home.txt b/erpnext/projects/page/projects_home/projects_home.txt
deleted file mode 100644
index d944156..0000000
--- a/erpnext/projects/page/projects_home/projects_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:24:22",
- "docstatus": 0,
- "modified": "2013-07-11 14:43:49",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Projects",
- "name": "__common__",
- "page_name": "projects-home",
- "standard": "Yes",
- "title": "Projects Home"
- },
- {
- "doctype": "Page",
- "name": "projects-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt
index c6c0e9f..56051d5 100644
--- a/erpnext/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": "2014-01-28 19:06:18",
+ "modified": "2014-03-03 19:05:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -327,21 +327,6 @@
},
{
"doctype": "DocField",
- "fieldname": "customer_discount_section",
- "fieldtype": "Section Break",
- "label": "Customer Discount",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_discounts",
- "fieldtype": "Table",
- "label": "Customer Discounts",
- "options": "Customer Discount",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
"fieldname": "communications",
"fieldtype": "Table",
"hidden": 1,
@@ -378,6 +363,7 @@
"permlevel": 0,
"print": 1,
"report": 1,
+ "restrict": 1,
"role": "Sales Master Manager",
"submit": 0,
"write": 1
diff --git a/erpnext/selling/doctype/customer_discount/customer_discount.py b/erpnext/selling/doctype/customer_discount/customer_discount.py
deleted file mode 100644
index 968a25b..0000000
--- a/erpnext/selling/doctype/customer_discount/customer_discount.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer_discount/customer_discount.txt b/erpnext/selling/doctype/customer_discount/customer_discount.txt
deleted file mode 100644
index 5abe3b6..0000000
--- a/erpnext/selling/doctype/customer_discount/customer_discount.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-[
- {
- "creation": "2013-07-22 12:43:40",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:04",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Customer Discount",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Customer Discount"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "label": "Item Group",
- "options": "Item Group"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount",
- "fieldtype": "Float",
- "label": "Discount (%)"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py
index 169f250..77a94f7 100644
--- a/erpnext/selling/doctype/lead/get_leads.py
+++ b/erpnext/selling/doctype/lead/get_leads.py
@@ -22,6 +22,7 @@
"source": "Email"
})
lead.ignore_permissions = True
+ lead.ignore_mandatory = True
lead.insert()
lead_name = lead.doc.name
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt
index 735e539..bbf953a 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.txt
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:57",
"docstatus": 0,
- "modified": "2014-02-10 17:28:02",
+ "modified": "2014-02-28 11:20:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -253,6 +253,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
index b57ba99..7e471e4 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:58",
"docstatus": 0,
- "modified": "2014-02-10 17:28:08",
+ "modified": "2014-02-28 11:20:05",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -239,6 +239,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/selling/page/selling_home/__init__.py b/erpnext/selling/page/selling_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/selling/page/selling_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/selling/page/selling_home/selling_home.js b/erpnext/selling/page/selling_home/selling_home.js
deleted file mode 100644
index 765ef40..0000000
--- a/erpnext/selling/page/selling_home/selling_home.js
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Selling"] = [
- {
- top: true,
- title: frappe._("Documents"),
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Customer"),
- description: frappe._("Customer database."),
- doctype:"Customer"
- },
- {
- label: frappe._("Lead"),
- description: frappe._("Database of potential customers."),
- doctype:"Lead"
- },
- {
- label: frappe._("Opportunity"),
- description: frappe._("Potential opportunities for selling."),
- doctype:"Opportunity"
- },
- {
- label: frappe._("Quotation"),
- description: frappe._("Quotes to Leads or Customers."),
- doctype:"Quotation"
- },
- {
- label: frappe._("Sales Order"),
- description: frappe._("Confirmed orders from Customers."),
- doctype:"Sales Order"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Contact"),
- description: frappe._("All Contacts."),
- doctype:"Contact"
- },
- {
- label: frappe._("Address"),
- description: frappe._("All Addresses."),
- doctype:"Address"
- },
- {
- label: frappe._("Item"),
- description: frappe._("All Products or Services."),
- doctype:"Item"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- "label": frappe._("Selling Settings"),
- "route": "Form/Selling Settings",
- "doctype":"Selling Settings",
- "description": frappe._("Settings for Selling Module")
- },
- {
- label: frappe._("Sales Taxes and Charges Master"),
- description: frappe._("Sales taxes template."),
- doctype:"Sales Taxes and Charges Master"
- },
- {
- label: frappe._("Shipping Rules"),
- description: frappe._("Rules to calculate shipping amount for a sale"),
- doctype:"Shipping Rule"
- },
- {
- label: frappe._("Price List"),
- description: frappe._("Multiple Price list."),
- doctype:"Price List"
- },
- {
- label: frappe._("Item Price"),
- description: frappe._("Multiple Item prices."),
- doctype:"Item Price"
- },
- {
- label: frappe._("Sales BOM"),
- description: frappe._("Bundle items at time of sale."),
- doctype:"Sales BOM"
- },
- {
- label: frappe._("Terms and Conditions"),
- description: frappe._("Template of terms or contract."),
- doctype:"Terms and Conditions"
- },
- {
- label: frappe._("Customer Group"),
- description: frappe._("Customer classification tree."),
- route: "Sales Browser/Customer Group",
- doctype:"Customer Group"
- },
- {
- label: frappe._("Territory"),
- description: frappe._("Sales territories."),
- route: "Sales Browser/Territory",
- doctype:"Territory"
- },
- {
- "route":"Sales Browser/Sales Person",
- "label":frappe._("Sales Person"),
- "description": frappe._("Sales persons and targets"),
- doctype:"Sales Person"
- },
- {
- "route":"List/Sales Partner",
- "label": frappe._("Sales Partner"),
- "description":frappe._("Commission partners and targets"),
- doctype:"Sales Partner"
- },
- {
- "route":"Sales Browser/Item Group",
- "label":frappe._("Item Group"),
- "description": frappe._("Tree of item classification"),
- doctype:"Item Group"
- },
- {
- "route":"List/Campaign",
- "label":frappe._("Campaign"),
- "description":frappe._("Sales campaigns"),
- doctype:"Campaign"
- },
- ]
- },
- {
- title: frappe._("Tools"),
- icon: "icon-wrench",
- items: [
- {
- "route":"Form/SMS Center/SMS Center",
- "label":frappe._("SMS Center"),
- "description":frappe._("Send mass SMS to your contacts"),
- doctype:"SMS Center"
- },
- ]
- },
- {
- title: frappe._("Analytics"),
- right: true,
- icon: "icon-bar-chart",
- items: [
- {
- "label":frappe._("Sales Analytics"),
- page: "sales-analytics"
- },
- {
- "label":frappe._("Sales Funnel"),
- page: "sales-funnel"
- },
- {
- "label":frappe._("Customer Acquisition and Loyalty"),
- route: "query-report/Customer Acquisition and Loyalty",
- doctype: "Customer"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Lead Details"),
- route: "query-report/Lead Details",
- doctype: "Lead"
- },
- {
- "label":frappe._("Customer Addresses And Contacts"),
- route: "query-report/Customer Addresses And Contacts",
- doctype: "Contact"
- },
- {
- "label":frappe._("Ordered Items To Be Delivered"),
- route: "query-report/Ordered Items To Be Delivered",
- doctype: "Sales Order"
- },
- {
- "label":frappe._("Sales Person-wise Transaction Summary"),
- route: "query-report/Sales Person-wise Transaction Summary",
- doctype: "Sales Order"
- },
- {
- "label":frappe._("Item-wise Sales History"),
- route: "query-report/Item-wise Sales History",
- doctype: "Item"
- },
- {
- "label":frappe._("Territory Target Variance (Item Group-Wise)"),
- route: "query-report/Territory Target Variance Item Group-Wise",
- doctype: "Territory"
- },
- {
- "label":frappe._("Sales Person Target Variance (Item Group-Wise)"),
- route: "query-report/Sales Person Target Variance Item Group-Wise",
- doctype: "Sales Person",
- },
- {
- "label":frappe._("Customers Not Buying Since Long Time"),
- route: "query-report/Customers Not Buying Since Long Time",
- doctype: "Sales Order"
- },
- {
- "label":frappe._("Quotation Trend"),
- route: "query-report/Quotation Trends",
- doctype: "Quotation"
- },
- {
- "label":frappe._("Sales Order Trend"),
- route: "query-report/Sales Order Trends",
- doctype: "Sales Order"
- },
- {
- "label":frappe._("Available Stock for Packing Items"),
- route: "query-report/Available Stock for Packing Items",
- doctype: "Item",
- },
- {
- "label":frappe._("Pending SO Items For Purchase Request"),
- route: "query-report/Pending SO Items For Purchase Request",
- doctype: "Sales Order"
- },
- ]
- }
-]
-
-pscript['onload_selling-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Selling");
-}
\ No newline at end of file
diff --git a/erpnext/selling/page/selling_home/selling_home.txt b/erpnext/selling/page/selling_home/selling_home.txt
deleted file mode 100644
index 9cff04d..0000000
--- a/erpnext/selling/page/selling_home/selling_home.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "creation": "2012-02-20 15:46:39",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:01",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Selling",
- "name": "__common__",
- "page_name": "selling-home",
- "standard": "Yes",
- "title": "Selling Home"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "selling-home",
- "parentfield": "roles",
- "parenttype": "Page",
- "role": "All"
- },
- {
- "doctype": "Page",
- "name": "selling-home"
- },
- {
- "doctype": "Page Role"
- }
-]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/email_settings/README.md b/erpnext/setup/doctype/email_settings/README.md
deleted file mode 100644
index a666902..0000000
--- a/erpnext/setup/doctype/email_settings/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Settings for outgoing emails (SMTP), Support Ticket (POP).
\ No newline at end of file
diff --git a/erpnext/setup/doctype/email_settings/__init__.py b/erpnext/setup/doctype/email_settings/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/setup/doctype/email_settings/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/setup/doctype/email_settings/email_settings.py b/erpnext/setup/doctype/email_settings/email_settings.py
deleted file mode 100644
index 17ae283..0000000
--- a/erpnext/setup/doctype/email_settings/email_settings.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-from frappe.utils import cint
-
-class DocType:
- def __init__(self,doc,doclist):
- self.doc,self.doclist = doc,doclist
-
- def validate(self):
- """Checks connectivity to email servers before saving"""
- self.validate_outgoing()
- self.validate_incoming()
-
- def validate_outgoing(self):
- """Checks incoming email settings"""
- self.doc.encode()
- if self.doc.outgoing_mail_server:
- from frappe.utils import cint
- from frappe.utils.email_lib.smtp import SMTPServer
- smtpserver = SMTPServer(login = self.doc.mail_login,
- password = self.doc.mail_password,
- server = self.doc.outgoing_mail_server,
- port = cint(self.doc.mail_port),
- use_ssl = self.doc.use_ssl
- )
-
- # exceptions are handled in session connect
- sess = smtpserver.sess
-
- def validate_incoming(self):
- """
- Checks support ticket email settings
- """
- if self.doc.sync_support_mails and self.doc.support_host:
- from frappe.utils.email_lib.receive import POP3Mailbox
- from frappe.model.doc import Document
- import _socket, poplib
-
- inc_email = Document('Incoming Email Settings')
- inc_email.encode()
- inc_email.host = self.doc.support_host
- inc_email.use_ssl = self.doc.support_use_ssl
- try:
- err_msg = 'User Name or Support Password missing. Please enter and try again.'
- if not (self.doc.support_username and self.doc.support_password):
- raise AttributeError, err_msg
- inc_email.username = self.doc.support_username
- inc_email.password = self.doc.support_password
- except AttributeError, e:
- frappe.msgprint(err_msg)
- raise
-
- pop_mb = POP3Mailbox(inc_email)
-
- try:
- pop_mb.connect()
- except _socket.error, e:
- # Invalid mail server -- due to refusing connection
- frappe.msgprint('Invalid POP3 Mail Server. Please rectify and try again.')
- raise
- except poplib.error_proto, e:
- frappe.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
- raise
diff --git a/erpnext/setup/doctype/email_settings/email_settings.txt b/erpnext/setup/doctype/email_settings/email_settings.txt
deleted file mode 100644
index 6b28f10..0000000
--- a/erpnext/setup/doctype/email_settings/email_settings.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-[
- {
- "creation": "2013-03-25 17:53:21",
- "docstatus": 0,
- "modified": "2013-12-06 13:12:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "description": "Email Settings for Outgoing and Incoming Emails.",
- "doctype": "DocType",
- "icon": "icon-cog",
- "in_create": 1,
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Email Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Email Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Email Settings"
- },
- {
- "description": "Set your outgoing mail SMTP settings here. All system generated notifications, emails will go from this mail server. If you are not sure, leave this blank to use ERPNext servers (emails will still be sent from your email id) or contact your email provider.",
- "doctype": "DocField",
- "fieldname": "outgoing_mails",
- "fieldtype": "Section Break",
- "label": "Outgoing Mails"
- },
- {
- "description": "SMTP Server (e.g. smtp.gmail.com)",
- "doctype": "DocField",
- "fieldname": "outgoing_mail_server",
- "fieldtype": "Data",
- "label": "Outgoing Mail Server"
- },
- {
- "description": "<a href=\"https://en.wikipedia.org/wiki/Transport_Layer_Security\" target=\"_blank\">[?]</a>",
- "doctype": "DocField",
- "fieldname": "use_ssl",
- "fieldtype": "Check",
- "label": "Use TLS"
- },
- {
- "description": "If non standard port (e.g. 587)",
- "doctype": "DocField",
- "fieldname": "mail_port",
- "fieldtype": "Int",
- "label": "Mail Port"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "description": "Set Login and Password if authentication is required.",
- "doctype": "DocField",
- "fieldname": "mail_login",
- "fieldtype": "Data",
- "label": "Login Id"
- },
- {
- "description": "Check this if you want to send emails as this id only (in case of restriction by your email provider).",
- "doctype": "DocField",
- "fieldname": "always_use_login_id_as_sender",
- "fieldtype": "Check",
- "label": "Always use above Login Id as sender"
- },
- {
- "doctype": "DocField",
- "fieldname": "mail_password",
- "fieldtype": "Password",
- "label": "Mail Password"
- },
- {
- "description": "System generated mails will be sent from this email id.",
- "doctype": "DocField",
- "fieldname": "auto_email_id",
- "fieldtype": "Data",
- "label": "Auto Email Id"
- },
- {
- "default": "1",
- "description": "If checked, an email with an attached HTML format will be added to part of the EMail body as well as attachment. To only send as attachment, uncheck this.",
- "doctype": "DocField",
- "fieldname": "send_print_in_body_and_attachment",
- "fieldtype": "Check",
- "label": "Send Print in Body and Attachment"
- },
- {
- "description": "To automatically create Support Tickets from your incoming mail, set your POP3 settings here. You must ideally create a separate email id for the erp system so that all emails will be synced into the system from that mail id. If you are not sure, please contact your EMail Provider.",
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "label": "Incoming / Support Mail Setting"
- },
- {
- "description": "Check this to pull emails from your mailbox",
- "doctype": "DocField",
- "fieldname": "sync_support_mails",
- "fieldtype": "Check",
- "label": "Sync Support Mails"
- },
- {
- "description": "Your support email id - must be a valid email - this is where your emails will come!",
- "doctype": "DocField",
- "fieldname": "support_email",
- "fieldtype": "Data",
- "label": "Support Email"
- },
- {
- "description": "POP3 mail server (e.g. pop.gmail.com)",
- "doctype": "DocField",
- "fieldname": "support_host",
- "fieldtype": "Data",
- "label": "POP3 Mail Server"
- },
- {
- "doctype": "DocField",
- "fieldname": "support_use_ssl",
- "fieldtype": "Check",
- "label": "Use SSL"
- },
- {
- "doctype": "DocField",
- "fieldname": "support_username",
- "fieldtype": "Data",
- "label": "User Name"
- },
- {
- "doctype": "DocField",
- "fieldname": "support_password",
- "fieldtype": "Password",
- "label": "Support Password"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb1",
- "fieldtype": "Column Break"
- },
- {
- "description": "Signature to be appended at the end of every email",
- "doctype": "DocField",
- "fieldname": "support_signature",
- "fieldtype": "Text",
- "label": "Signature"
- },
- {
- "default": "1",
- "doctype": "DocField",
- "fieldname": "send_autoreply",
- "fieldtype": "Check",
- "label": "Send Autoreply"
- },
- {
- "description": "Autoreply when a new mail is received",
- "doctype": "DocField",
- "fieldname": "support_autoreply",
- "fieldtype": "Text",
- "label": "Custom Autoreply Message"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt
index a2a6e7e..ff731a1 100644
--- a/erpnext/setup/doctype/website_item_group/website_item_group.txt
+++ b/erpnext/setup/doctype/website_item_group/website_item_group.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:09",
"docstatus": 0,
- "modified": "2013-12-20 19:21:54",
+ "modified": "2014-02-28 13:00:07",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,7 +26,8 @@
"parent": "Website Item Group",
"parentfield": "fields",
"parenttype": "DocType",
- "permlevel": 0
+ "permlevel": 0,
+ "reqd": 1
},
{
"doctype": "DocType",
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index cec6212..3900eba 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -160,7 +160,7 @@
hr_settings.doc.emp_created_by = "Naming Series"
hr_settings.save()
- email_settings = frappe.bean("Email Settings")
+ email_settings = frappe.bean("Outgoing Email Settings")
email_settings.doc.send_print_in_body_and_attachment = 1
email_settings.save()
diff --git a/erpnext/startup/__init__.py b/erpnext/startup/__init__.py
index faafb76..1c49c8f 100644
--- a/erpnext/startup/__init__.py
+++ b/erpnext/startup/__init__.py
@@ -34,7 +34,7 @@
def get_monthly_bulk_mail_limit():
import frappe
# if global settings, then 500 or unlimited
- if frappe.db.get_value('Email Settings', None, 'outgoing_mail_server'):
+ if frappe.db.get_value('Outgoing Email Settings', None, 'mail_server'):
return 999999
else:
return 500
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 1fb7ea0..fe445e4 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
+from erpnext.home import make_feed
def on_session_creation(login_manager):
"""
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
index 5d04992..f5f7712 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-22 13:15:44",
"docstatus": 0,
- "modified": "2014-02-10 17:28:16",
+ "modified": "2014-02-28 11:20:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -247,6 +247,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt
index ff66df3..51abc22 100644
--- a/erpnext/stock/doctype/item/item.txt
+++ b/erpnext/stock/doctype/item/item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
- "modified": "2014-02-20 18:27:02",
+ "modified": "2014-03-05 15:20:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -111,6 +111,7 @@
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Unit of Measure",
"oldfieldname": "stock_uom",
"oldfieldtype": "Link",
@@ -217,6 +218,7 @@
"doctype": "DocField",
"fieldname": "default_warehouse",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Warehouse",
"oldfieldname": "default_warehouse",
"oldfieldtype": "Link",
@@ -349,6 +351,7 @@
"doctype": "DocField",
"fieldname": "weight_uom",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Weight UOM",
"options": "UOM",
"read_only": 0
@@ -420,6 +423,7 @@
"doctype": "DocField",
"fieldname": "default_supplier",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Supplier",
"options": "Supplier"
},
@@ -441,6 +445,7 @@
"doctype": "DocField",
"fieldname": "expense_account",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Expense Account",
"oldfieldname": "purchase_account",
"oldfieldtype": "Link",
@@ -453,6 +458,7 @@
"doctype": "DocField",
"fieldname": "buying_cost_center",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Buying Cost Center",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@@ -579,6 +585,7 @@
"doctype": "DocField",
"fieldname": "income_account",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Income Account",
"options": "Account",
"read_only": 0
@@ -588,6 +595,7 @@
"doctype": "DocField",
"fieldname": "selling_cost_center",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default Selling Cost Center",
"options": "Cost Center",
"read_only": 0
@@ -691,6 +699,7 @@
"doctype": "DocField",
"fieldname": "default_bom",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Default BOM",
"no_copy": 1,
"oldfieldname": "default_bom",
@@ -802,6 +811,7 @@
"doctype": "DocField",
"fieldname": "website_warehouse",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Website Warehouse",
"options": "Warehouse",
"read_only": 0
@@ -852,6 +862,7 @@
"doctype": "DocField",
"fieldname": "parent_website_route",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Website Route",
"options": "Website Route"
},
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index f990ec9..e86b113 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -18,7 +18,7 @@
item.doc.default_warehouse = None
self.assertRaises(WarehouseNotSet, item.insert)
- def atest_get_item_details(self):
+ def test_get_item_details(self):
from erpnext.stock.get_item_details import get_item_details
to_check = {
"item_code": "_Test Item",
@@ -37,13 +37,13 @@
"amount": 0.0,
"base_amount": 0.0,
"batch_no": None,
- "item_tax_rate": {},
+ "item_tax_rate": '{}',
"uom": "_Test UOM",
"conversion_factor": 1.0,
}
make_test_records("Item Price")
-
+
details = get_item_details({
"item_code": "_Test Item",
"company": "_Test Company",
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
index efc5a17..cde7911 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:10",
"docstatus": 0,
- "modified": "2014-02-10 17:29:07",
+ "modified": "2014-02-28 11:27:09",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -278,6 +278,22 @@
},
{
"doctype": "DocField",
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"in_list_view": 0,
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index b78c104..59438fd 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -339,18 +339,21 @@
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- args = {
- 'item_code' : d.item_code,
- 'warehouse' : cstr(d.s_warehouse) || cstr(d.t_warehouse),
- 'transfer_qty' : d.transfer_qty,
- 'serial_no' : d.serial_no,
- 'bom_no' : d.bom_no,
- 'expense_account' : d.expense_account,
- 'cost_center' : d.cost_center,
- 'company' : cur_frm.doc.company
- };
- return get_server_fields('get_item_details', JSON.stringify(args),
- 'mtn_details', doc, cdt, cdn, 1);
+ if(d.item_code) {
+ args = {
+ 'item_code' : d.item_code,
+ 'warehouse' : cstr(d.s_warehouse) || cstr(d.t_warehouse),
+ 'transfer_qty' : d.transfer_qty,
+ 'serial_no' : d.serial_no,
+ 'bom_no' : d.bom_no,
+ 'expense_account' : d.expense_account,
+ 'cost_center' : d.cost_center,
+ 'company' : cur_frm.doc.company
+ };
+ return get_server_fields('get_item_details', JSON.stringify(args),
+ 'mtn_details', doc, cdt, cdn, 1);
+ }
+
}
cur_frm.cscript.s_warehouse = function(doc, cdt, cdn) {
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt
index 01cfed8..a8cf16b 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.txt
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-04-09 11:43:55",
"docstatus": 0,
- "modified": "2014-01-20 17:49:27",
+ "modified": "2014-02-26 10:59:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 0,
+ "allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"doctype": "DocType",
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index dfe4cc3..fe596c4 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -18,7 +18,7 @@
"conversion_rate": 1.0,
"selling_price_list": None,
"price_list_currency": None,
- "plc_conversion_rate": 1.0
+ "plc_conversion_rate": 1.0,
"doctype": "",
"docname": "",
"supplier": None,
@@ -60,11 +60,11 @@
out.update(get_projected_qty(item.name, out.warehouse))
get_price_list_rate(args, item_bean, out)
-
- out.update(get_item_discount(out.item_group, args.customer))
if args.transaction_type == "selling" and cint(args.is_pos):
out.update(get_pos_settings_item_details(args.company, args))
+
+ apply_pricing_rule(out, args)
if args.get("doctype") in ("Sales Invoice", "Delivery Note"):
if item_bean.doc.has_serial_no == "Yes" and not args.serial_no:
@@ -100,16 +100,16 @@
if args.get("order_type") == "Maintenance":
if item.is_service_item != "Yes":
throw(_("Item") + (" %s: " % item.name) +
- _("not a service item.") +
+ _("is not a service item.") +
_("Please select a service item or change the order type to Sales."))
elif item.is_sales_item != "Yes":
- throw(_("Item") + (" %s: " % item.name) + _("not a sales item"))
+ throw(_("Item") + (" %s: " % item.name) + _("is not a sales item"))
elif args.transaction_type == "buying":
# validate if purchase item or subcontracted item
if item.is_purchase_item != "Yes":
- throw(_("Item") + (" %s: " % item.name) + _("not a purchase item"))
+ throw(_("Item") + (" %s: " % item.name) + _("is not a purchase item"))
if args.get("is_subcontracted") == "Yes" and item.is_sub_contracted_item != "Yes":
throw(_("Item") + (" %s: " % item.name) +
@@ -206,23 +206,6 @@
args.plc_conversion_rate = flt(args.plc_conversion_rate,
get_field_precision(meta.get_field("plc_conversion_rate"),
frappe._dict({"fields": args})))
-
-def get_item_discount(item_group, customer):
- parent_item_groups = [x[0] for x in frappe.db.sql("""SELECT parent.name
- FROM `tabItem Group` AS node, `tabItem Group` AS parent
- WHERE parent.lft <= node.lft and parent.rgt >= node.rgt and node.name = %s
- GROUP BY parent.name
- ORDER BY parent.lft desc""", (item_group,))]
-
- discount = 0
- for d in parent_item_groups:
- res = frappe.db.sql("""select discount, name from `tabCustomer Discount`
- where parent = %s and item_group = %s""", (customer, d))
- if res:
- discount = flt(res[0][0])
- break
-
- return {"discount_percentage": discount}
def get_party_item_code(args, item_bean, out):
if args.transaction_type == "selling":
@@ -262,6 +245,114 @@
return pos_settings and pos_settings[0] or None
+def apply_pricing_rule(out, args):
+ args_dict = frappe._dict().update(args)
+ args_dict.update(out)
+ all_pricing_rules = get_pricing_rules(args_dict)
+
+ for rule_for in ["price", "discount_percentage"]:
+ pricing_rules = filter(lambda x: x[rule_for] > 0.0, all_pricing_rules)
+ pricing_rules = filter_pricing_rules(args_dict, pricing_rules, rule_for)
+ if pricing_rules:
+ if rule_for == "discount_percentage":
+ out["discount_percentage"] = pricing_rules[-1]["discount_percentage"]
+ out["pricing_rule_for_discount"] = pricing_rules[-1]["name"]
+ else:
+ out["base_price_list_rate"] = pricing_rules[0]["price"]
+ out["price_list_rate"] = pricing_rules[0]["price"] * \
+ flt(args_dict.plc_conversion_rate) / flt(args_dict.conversion_rate)
+ out["pricing_rule_for_price"] = pricing_rules[-1]["name"]
+
+def get_pricing_rules(args_dict):
+ def _get_tree_conditions(doctype, allow_blank=True):
+ field = frappe.scrub(doctype)
+ condition = ""
+ if args_dict.get(field):
+ lft, rgt = frappe.db.get_value(doctype, args_dict[field], ["lft", "rgt"])
+ parent_groups = frappe.db.sql_list("""select name from `tab%s`
+ where lft<=%s and rgt>=%s""" % (doctype, '%s', '%s'), (lft, rgt))
+
+ if parent_groups:
+ if allow_blank: parent_groups.append('')
+ condition = " ifnull("+field+", '') in ('" + "', '".join(parent_groups)+"')"
+
+ return condition
+
+
+ conditions = ""
+ for field in ["customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
+ if args_dict.get(field):
+ conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
+ else:
+ conditions += " and ifnull("+field+", '') = ''"
+
+ for doctype in ["Customer Group", "Territory"]:
+ group_condition = _get_tree_conditions(doctype)
+ if group_condition:
+ conditions += " and " + group_condition
+
+ conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"
+
+
+ if args_dict.get("transaction_date"):
+ conditions += """ and %(transaction_date)s between ifnull(valid_from, '2000-01-01')
+ and ifnull(valid_upto, '2500-12-31')"""
+
+ return frappe.db.sql("""select * from `tabPricing Rule`
+ where (item_code=%(item_code)s or {item_group_condition} or brand=%(brand)s)
+ and docstatus < 2 and ifnull(disable, 0) = 0 {conditions}
+ order by priority desc, name desc""".format(
+ item_group_condition=_get_tree_conditions("Item Group", False), conditions=conditions),
+ args_dict, as_dict=1)
+
+def filter_pricing_rules(args_dict, pricing_rules, price_or_discount):
+ # filter for qty
+ if pricing_rules and args_dict.get("qty"):
+ pricing_rules = filter(lambda x: (args_dict.qty>=flt(x.min_qty)
+ and (args_dict.qty<=x.max_qty if x.max_qty else True)), pricing_rules)
+
+ # find pricing rule with highest priority
+ if pricing_rules:
+ max_priority = max([cint(p.priority) for p in pricing_rules])
+ if max_priority:
+ pricing_rules = filter(lambda x: cint(x.priority)==max_priority, pricing_rules)
+
+ # apply internal priority
+ all_fields = ["item_code", "item_group", "brand", "customer", "customer_group", "territory",
+ "supplier", "supplier_type", "campaign", "for_price_list", "sales_partner"]
+
+ if len(pricing_rules) > 1:
+ for field_set in [["item_code", "item_group", "brand"],
+ ["customer", "customer_group", "territory"], ["supplier", "supplier_type"]]:
+ remaining_fields = list(set(all_fields) - set(field_set))
+ if if_all_rules_same(pricing_rules, remaining_fields):
+ pricing_rules = apply_internal_priority(pricing_rules, field_set, args_dict)
+ break
+
+ if len(pricing_rules) > 1:
+ pricing_rules = sorted(pricing_rules, key=lambda x: x[price_or_discount])
+
+ return pricing_rules
+
+def if_all_rules_same(pricing_rules, fields):
+ all_rules_same = True
+ val = [pricing_rules[0][k] for k in fields]
+ for p in pricing_rules[1:]:
+ if val != [p[k] for k in fields]:
+ all_rules_same = False
+ break
+
+ return all_rules_same
+
+def apply_internal_priority(pricing_rules, field_set, args_dict):
+ filtered_rules = []
+ for field in field_set:
+ if args_dict.get(field):
+ filtered_rules = filter(lambda x: x[field]==args_dict[field], pricing_rules)
+ if filtered_rules: break
+
+ return filtered_rules or pricing_rules
+
def get_serial_nos_by_fifo(args, item_bean):
return "\n".join(frappe.db.sql_list("""select name from `tabSerial No`
where item_code=%(item_code)s and warehouse=%(warehouse)s and status='Available'
@@ -270,17 +361,17 @@
"warehouse": args.warehouse,
"qty": cint(args.qty)
}))
-
+
@frappe.whitelist()
def get_conversion_factor(item_code, uom):
return {"conversion_factor": frappe.db.get_value("UOM Conversion Detail",
{"parent": item_code, "uom": uom}, "conversion_factor")}
-
+
@frappe.whitelist()
def get_projected_qty(item_code, warehouse):
return {"projected_qty": frappe.db.get_value("Bin",
{"item_code": item_code, "warehouse": warehouse}, "projected_qty")}
-
+
@frappe.whitelist()
def get_available_qty(item_code, warehouse):
return frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse},
diff --git a/erpnext/stock/page/stock_home/__init__.py b/erpnext/stock/page/stock_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/stock/page/stock_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/stock/page/stock_home/stock_home.js b/erpnext/stock/page/stock_home/stock_home.js
deleted file mode 100644
index 93b7110..0000000
--- a/erpnext/stock/page/stock_home/stock_home.js
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Stock"] = [
- {
- title: frappe._("Documents"),
- top: true,
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Item"),
- description: frappe._("All Products or Services."),
- doctype: "Item"
- },
- {
- label: frappe._("Material Request"),
- description: frappe._("Requests for items."),
- doctype: "Material Request"
- },
- {
- label: frappe._("Stock Entry"),
- description: frappe._("Record item movement."),
- doctype: "Stock Entry"
- },
- {
- label: frappe._("Delivery Note"),
- description: frappe._("Shipments to customers."),
- doctype: "Delivery Note"
- },
- {
- label: frappe._("Purchase Receipt"),
- description: frappe._("Goods received from Suppliers."),
- doctype: "Purchase Receipt"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Serial No"),
- description: frappe._("Single unit of an Item."),
- doctype: "Serial No"
- },
- {
- label: frappe._("Batch"),
- description: frappe._("Batch (lot) of an Item."),
- doctype: "Batch"
- },
- {
- label: frappe._("Warehouse"),
- description: frappe._("Where items are stored."),
- doctype: "Warehouse"
- },
- ]
- },
- {
- title: frappe._("Tools"),
- icon: "icon-wrench",
- items: [
- {
- doctype: "Stock Reconciliation",
- label: frappe._("Stock Reconciliation"),
- description: frappe._("Upload stock balance via csv.")
- },
- {
- doctype: "Installation Note",
- label: frappe._("Installation Note"),
- description: frappe._("Installation record for a Serial No.")
- },
- {
- label: frappe._("Packing Slip"),
- doctype: "Packing Slip",
- description: frappe._("Split Delivery Note into packages.")
- },
- {
- doctype: "Price List",
- label: frappe._("Price List"),
- description: frappe._("Multiple Price list.")
- },
- {
- doctype: "Item Price",
- label: frappe._("Item Price"),
- description: frappe._("Multiple Item prices.")
- },
- {
- doctype: "Quality Inspection",
- label: frappe._("Quality Inspection"),
- description: frappe._("Incoming quality inspection.")
- },
- {
- route: "Form/Landed Cost Wizard/Landed Cost Wizard",
- label: frappe._("Landed Cost Wizard"),
- description: frappe._("Distribute transport overhead across items."),
- doctype: "Landed Cost Wizard"
- },
- {
- route: "Form/Stock UOM Replace Utility/Stock UOM Replace Utility",
- label: frappe._("UOM Replace Utility"),
- description: frappe._("Change UOM for an Item."),
- doctype: "Stock UOM Replace Utility"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- label: frappe._("Stock Settings"),
- route: "Form/Stock Settings",
- doctype: "Stock Settings",
- description: frappe._("Settings for Stock Module")
- },
- {
- route: "Sales Browser/Item Group",
- label: frappe._("Item Group"),
- doctype: "Item Group",
- description: frappe._("Item classification.")
- },
- {
- doctype: "UOM",
- label: frappe._("Unit of Measure") + " (UOM)",
- description: frappe._("e.g. Kg, Unit, Nos, m")
- },
- {
- doctype: "Brand",
- label: frappe._("Brand"),
- description: frappe._("Brand master.")
- }
- ]
- },
- {
- title: frappe._("Main Reports"),
- right: true,
- icon: "icon-table",
- items: [
- {
- label: frappe._("Stock Ledger"),
- doctype: "Item",
- route: "query-report/Stock Ledger"
- },
- {
- label: frappe._("Stock Balance"),
- page: "stock-balance"
- },
- {
- label: frappe._("Stock Projected Qty"),
- doctype: "Item",
- route: "query-report/Stock Projected Qty"
- },
- {
- label: frappe._("Stock Ageing"),
- doctype: "Item",
- route: "query-report/Stock Ageing"
- },
- {
- label: frappe._("Item-wise Price List Rate"),
- route: "Report/Item Price/Item-wise Price List Rate",
- doctype: "Item Price"
- },
- ]
- },
- {
- title: frappe._("Analytics"),
- right: true,
- icon: "icon-bar-chart",
- items: [
- {
- label: frappe._("Stock Analytics"),
- page: "stock-analytics"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- label: frappe._("Ordered Items To Be Delivered"),
- route: "query-report/Ordered Items To Be Delivered",
- doctype: "Delivery Note"
- },
- {
- label: frappe._("Purchase Order Items To Be Received"),
- route: "query-report/Purchase Order Items To Be Received",
- doctype: "Purchase Receipt"
- },
- {
- label: frappe._("Item Shortage Report"),
- route: "Report/Bin/Item Shortage Report",
- doctype: "Purchase Receipt"
- },
- {
- label: frappe._("Serial No Service Contract Expiry"),
- route: "Report/Serial No/Serial No Service Contract Expiry",
- doctype: "Serial No"
- },
- {
- label: frappe._("Serial No Status"),
- route: "Report/Serial No/Serial No Status",
- doctype: "Serial No"
- },
- {
- label: frappe._("Serial No Warranty Expiry"),
- route: "Report/Serial No/Serial No Warranty Expiry",
- doctype: "Serial No"
- },
- {
- label: frappe._("Purchase In Transit"),
- route: "query-report/Purchase In Transit",
- doctype: "Purchase Order"
- },
- {
- label: frappe._("Requested Items To Be Transferred"),
- route: "query-report/Requested Items To Be Transferred",
- doctype: "Material Request"
- },
- {
- label: frappe._("Batch-Wise Balance History"),
- route: "query-report/Batch-Wise Balance History",
- doctype: "Batch"
- },
- {
- label: frappe._("Warehouse-Wise Stock Balance"),
- route: "query-report/Warehouse-Wise Stock Balance",
- doctype: "Warehouse"
- },
- {
- label: frappe._("Item Prices"),
- route: "query-report/Item Prices",
- doctype: "Price List"
- },
- {
- label: frappe._("Itemwise Recommended Reorder Level"),
- route: "query-report/Itemwise Recommended Reorder Level",
- doctype: "Item"
- },
- {
- label: frappe._("Delivery Note Trends"),
- route: "query-report/Delivery Note Trends",
- doctype: "Delivery Note"
- },
- {
- label: frappe._("Purchase Receipt Trends"),
- route: "query-report/Purchase Receipt Trends",
- doctype: "Purchase Receipt"
- },
- ]
- }
-]
-
-pscript['onload_stock-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Stock");
-}
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_home/stock_home.txt b/erpnext/stock/page/stock_home/stock_home.txt
deleted file mode 100644
index 81e78bb..0000000
--- a/erpnext/stock/page/stock_home/stock_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:23:22",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:17",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-home",
- "standard": "Yes",
- "title": "Stock Home"
- },
- {
- "doctype": "Page",
- "name": "stock-home"
- }
-]
\ No newline at end of file
diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
index cc514f7..2a5eb50 100644
--- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
+++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
@@ -10,7 +10,8 @@
data = frappe.db.sql("""select
item.name, item.item_name, description, item_group, brand, warehouse, item.stock_uom,
actual_qty, planned_qty, indented_qty, ordered_qty, reserved_qty,
- projected_qty, item.re_order_level, item.re_order_qty
+ projected_qty, item.re_order_level, item.re_order_qty,
+ (item.re_order_level - projected_qty) as shortage_qty
from `tabBin` bin,
(select name, company from tabWarehouse
{warehouse_conditions}) wh,
@@ -29,7 +30,8 @@
"Item Group:Link/Item Group:100", "Brand:Link/Brand:100", "Warehouse:Link/Warehouse:120",
"UOM:Link/UOM:100", "Actual Qty:Float:100", "Planned Qty:Float:100",
"Requested Qty:Float:110", "Ordered Qty:Float:100", "Reserved Qty:Float:100",
- "Projected Qty:Float:100", "Reorder Level:Float:100", "Reorder Qty:Float:100"]
+ "Projected Qty:Float:100", "Reorder Level:Float:100", "Reorder Qty:Float:100",
+ "Shortage Qty:Float:100"]
def get_item_conditions(filters):
conditions = []
diff --git a/erpnext/selling/doctype/customer_discount/__init__.py b/erpnext/support/doctype/support_email_settings/__init__.py
similarity index 100%
copy from erpnext/selling/doctype/customer_discount/__init__.py
copy to erpnext/support/doctype/support_email_settings/__init__.py
diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py
new file mode 100644
index 0000000..203bf72
--- /dev/null
+++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py
@@ -0,0 +1,47 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# MIT License. See license.txt
+
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+class DocType:
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
+
+ def validate(self):
+ """
+ Checks support ticket email settings
+ """
+ if self.doc.sync_support_mails and self.doc.mail_server:
+ from frappe.utils.email_lib.receive import POP3Mailbox
+ from frappe.model.doc import Document
+ import _socket, poplib
+
+ inc_email = Document('Incoming Email Settings')
+ inc_email.encode()
+ inc_email.host = self.doc.mail_server
+ inc_email.use_ssl = self.doc.use_ssl
+ try:
+ err_msg = 'User Name or Support Password missing. Please enter and try again.'
+ if not (self.doc.mail_login and self.doc.mail_password):
+ raise AttributeError, err_msg
+ inc_email.username = self.doc.mail_login
+ inc_email.password = self.doc.mail_password
+ except AttributeError, e:
+ frappe.msgprint(err_msg)
+ raise
+
+ pop_mb = POP3Mailbox(inc_email)
+
+ try:
+ pop_mb.connect()
+ except _socket.error, e:
+ # Invalid mail server -- due to refusing connection
+ frappe.msgprint('Invalid POP3 Mail Server. Please rectify and try again.')
+ raise
+ except poplib.error_proto, e:
+ frappe.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
+ raise
+
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.txt b/erpnext/support/doctype/support_email_settings/support_email_settings.txt
new file mode 100644
index 0000000..5775c28
--- /dev/null
+++ b/erpnext/support/doctype/support_email_settings/support_email_settings.txt
@@ -0,0 +1,111 @@
+[
+ {
+ "creation": "2014-03-03 19:48:46",
+ "docstatus": 0,
+ "modified": "2014-03-03 20:20:34",
+ "modified_by": "Administrator",
+ "owner": "Administrator"
+ },
+ {
+ "allow_copy": 1,
+ "description": "Email Settings for Outgoing and Incoming Emails.",
+ "doctype": "DocType",
+ "icon": "icon-cog",
+ "in_create": 1,
+ "issingle": 1,
+ "module": "Support",
+ "name": "__common__"
+ },
+ {
+ "doctype": "DocField",
+ "name": "__common__",
+ "parent": "Support Email Settings",
+ "parentfield": "fields",
+ "parenttype": "DocType",
+ "permlevel": 0
+ },
+ {
+ "create": 1,
+ "doctype": "DocPerm",
+ "name": "__common__",
+ "parent": "Support Email Settings",
+ "parentfield": "permissions",
+ "parenttype": "DocType",
+ "permlevel": 0,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ },
+ {
+ "doctype": "DocType",
+ "name": "Support Email Settings"
+ },
+ {
+ "description": "Check this to pull emails from your mailbox",
+ "doctype": "DocField",
+ "fieldname": "sync_support_mails",
+ "fieldtype": "Check",
+ "label": "Sync Support Mails"
+ },
+ {
+ "description": "Your support email id - must be a valid email - this is where your emails will come!",
+ "doctype": "DocField",
+ "fieldname": "support_email",
+ "fieldtype": "Data",
+ "label": "Support Email"
+ },
+ {
+ "description": "POP3 mail server (e.g. pop.gmail.com)",
+ "doctype": "DocField",
+ "fieldname": "mail_server",
+ "fieldtype": "Data",
+ "label": "POP3 Mail Server"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "use_ssl",
+ "fieldtype": "Check",
+ "label": "Use SSL"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "mail_login",
+ "fieldtype": "Data",
+ "label": "User Name"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "mail_password",
+ "fieldtype": "Password",
+ "label": "Support Password"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "cb1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "description": "Signature to be appended at the end of every email",
+ "doctype": "DocField",
+ "fieldname": "support_signature",
+ "fieldtype": "Text",
+ "label": "Signature"
+ },
+ {
+ "default": "1",
+ "doctype": "DocField",
+ "fieldname": "send_autoreply",
+ "fieldtype": "Check",
+ "label": "Send Autoreply"
+ },
+ {
+ "description": "Autoreply when a new mail is received",
+ "doctype": "DocField",
+ "fieldname": "support_autoreply",
+ "fieldtype": "Text",
+ "label": "Custom Autoreply Message"
+ },
+ {
+ "doctype": "DocPerm"
+ }
+]
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py
index 9dd9ac8..8ac5eba 100644
--- a/erpnext/support/doctype/support_ticket/get_support_mails.py
+++ b/erpnext/support/doctype/support_ticket/get_support_mails.py
@@ -10,12 +10,12 @@
class SupportMailbox(POP3Mailbox):
def setup(self, args=None):
- self.email_settings = frappe.doc("Email Settings", "Email Settings")
+ self.email_settings = frappe.doc("Support Email Settings", "Support Email Settings")
self.settings = args or frappe._dict({
- "use_ssl": self.email_settings.support_use_ssl,
- "host": self.email_settings.support_host,
- "username": self.email_settings.support_username,
- "password": self.email_settings.support_password
+ "use_ssl": self.email_settings.use_ssl,
+ "host": self.email_settings.mail_server,
+ "username": self.email_settings.mail_login,
+ "password": self.email_settings.mail_password
})
def process_message(self, mail):
@@ -53,7 +53,7 @@
msg = cstr(response))
def get_support_mails():
- if cint(frappe.db.get_value('Email Settings', None, 'sync_support_mails')):
+ if cint(frappe.db.get_value('Support Email Settings', None, 'sync_support_mails')):
SupportMailbox()
def add_support_communication(subject, content, sender, docname=None, mail=None):
@@ -72,6 +72,7 @@
"status": "Open",
})])
ticket.ignore_permissions = True
+ ticket.ignore_mandatory = True
ticket.insert()
_make(content=content, sender=sender, subject = subject,
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js
index 1807846..034fa86 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.js
+++ b/erpnext/support/doctype/support_ticket/support_ticket.js
@@ -11,7 +11,7 @@
$.extend(cur_frm.cscript, {
onload: function(doc, dt, dn) {
if(in_list(user_roles,'System Manager')) {
- cur_frm.footer.help_area.innerHTML = '<p><a href="#Form/Email Settings/Email Settings">'+frappe._("Email Settings")+'</a><br>\
+ cur_frm.footer.help_area.innerHTML = '<p><a href="#Form/Support Email Settings/Support Email Settings">'+frappe._("Support Email Settings")+'</a><br>\
<span class="help">'+frappe._("Integrate incoming support emails to Support Ticket")+'</span></p>';
}
},
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py
index 13ee178..57d141e 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.py
+++ b/erpnext/support/doctype/support_ticket/support_ticket.py
@@ -13,13 +13,13 @@
self.doclist = doclist
def get_sender(self, comm):
- return frappe.db.get_value('Email Settings',None,'support_email')
+ return frappe.db.get_value('Support Email Settings',None,'support_email')
def get_subject(self, comm):
return '[' + self.doc.name + '] ' + (comm.subject or 'No Subject Specified')
def get_content(self, comm):
- signature = frappe.db.get_value('Email Settings',None,'support_signature')
+ signature = frappe.db.get_value('Support Email Settings',None,'support_signature')
content = comm.content
if signature:
content += '<p>' + signature + '</p>'
diff --git a/erpnext/support/page/support_home/__init__.py b/erpnext/support/page/support_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/support/page/support_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/support/page/support_home/support_home.js b/erpnext/support/page/support_home/support_home.js
deleted file mode 100644
index 38d35d9..0000000
--- a/erpnext/support/page/support_home/support_home.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt"
-
-frappe.module_page["Support"] = [
- {
- title: frappe._("Top"),
- top: true,
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Support Ticket"),
- description: frappe._("Support queries from customers."),
- doctype:"Support Ticket"
- },
- {
- label: frappe._("Customer Issue"),
- description: frappe._("Customer Issue against Serial No."),
- doctype:"Customer Issue"
- },
- ]
- },
-
- {
- title: frappe._("Documents"),
- icon: "icon-copy",
- items: [
- {
- label: frappe._("Maintenance Schedule"),
- description: frappe._("Plan for maintenance visits."),
- doctype:"Maintenance Schedule"
- },
- {
- label: frappe._("Maintenance Visit"),
- description: frappe._("Visit report for maintenance call."),
- doctype:"Maintenance Visit"
- },
- {
- label: frappe._("Newsletter"),
- description: frappe._("Newsletters to contacts, leads."),
- doctype:"Newsletter"
- },
- {
- label: frappe._("Communication"),
- description: frappe._("Communication log."),
- doctype:"Communication"
- },
- ]
- },
- {
- title: frappe._("Masters"),
- icon: "icon-book",
- items: [
- {
- label: frappe._("Serial No"),
- description: frappe._("Single unit of an Item."),
- doctype:"Serial No"
- },
- ]
- },
- {
- title: frappe._("Setup"),
- icon: "icon-cog",
- items: [
- {
- "route":"Form/Email Settings/Email Settings",
- "label":frappe._("Email Settings"),
- "description":frappe._("Setup to pull emails from support email account"),
- doctype: "Email Settings"
- },
- ]
- },
- {
- title: frappe._("Analytics"),
- right: true,
- icon: "icon-bar-chart",
- items: [
- {
- "label":frappe._("Support Analytics"),
- page: "support-analytics"
- },
- ]
- },
- {
- title: frappe._("Reports"),
- right: true,
- icon: "icon-list",
- items: [
- {
- "label":frappe._("Maintenance Schedules"),
- route: "query-report/Maintenance Schedules",
- doctype: "Maintenance Schedule"
- }
- ]
- }
-]
-
-pscript['onload_support-home'] = function(wrapper) {
- frappe.views.moduleview.make(wrapper, "Support");
-}
diff --git a/erpnext/support/page/support_home/support_home.txt b/erpnext/support/page/support_home/support_home.txt
deleted file mode 100644
index 7d9fc9d..0000000
--- a/erpnext/support/page/support_home/support_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "creation": "2012-02-21 13:23:35",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-th",
- "module": "Support",
- "name": "__common__",
- "page_name": "support-home",
- "standard": "Yes",
- "title": "Support Home"
- },
- {
- "doctype": "Page",
- "name": "support-home"
- }
-]
\ No newline at end of file