fixed conflict
diff --git a/.travis.yml b/.travis.yml
index 966dfd3..eac53fd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@
install:
- sudo apt-get purge -y mysql-common
- wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
- - sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis
+ - sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis --bench-branch develop
- sudo pip install --upgrade pip
- rm $TRAVIS_BUILD_DIR/.git/shallow
- bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index ce03877..8fc7b55 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +42,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -64,6 +66,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Account Name",
@@ -90,6 +93,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Group",
@@ -114,6 +118,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -140,6 +145,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Root Type",
@@ -164,6 +170,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Report Type",
@@ -189,6 +196,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
@@ -214,6 +222,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -237,6 +246,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Account",
@@ -264,6 +274,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Account Type",
@@ -271,7 +282,7 @@
"no_copy": 0,
"oldfieldname": "account_type",
"oldfieldtype": "Select",
- "options": "\nBank\nCash\nDepreciation\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
+ "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary\nWarehouse",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -291,6 +302,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rate",
@@ -317,6 +329,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Frozen",
@@ -343,6 +356,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse",
@@ -367,6 +381,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Balance must be",
@@ -391,6 +406,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Lft",
@@ -414,6 +430,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rgt",
@@ -437,6 +454,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Old Parent",
@@ -463,7 +481,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-12-12 10:19:54.365839",
+ "modified": "2016-03-31 05:15:51.062604",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
@@ -572,5 +590,7 @@
],
"read_only": 0,
"read_only_onload": 0,
- "search_fields": ""
+ "search_fields": "",
+ "sort_order": "ASC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 1f9c74d..104bef7 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -189,9 +189,6 @@
def validate_trash(self):
"""checks gl entries and if child exists"""
- if not self.parent_account:
- throw(_("Root account can not be deleted"))
-
if self.check_gle_exists():
throw(_("Account with existing transaction can not be deleted"))
if self.check_if_child_exists():
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
index c300894..ab41039 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
@@ -48,7 +48,8 @@
},
"Plant and Machinery": {
"account_type": "Fixed Asset"
- }
+ },
+ "Accumulated Depreciations": {}
},
"Investments": {
"is_group": 1
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
index 481ada8..ee1d007 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
@@ -52,6 +52,9 @@
},
_("Plant and Machinery"): {
"account_type": "Fixed Asset"
+ },
+ _("Accumulated Depreciation"): {
+ "account_type": "Accumulated Depreciation"
}
},
_("Investments"): {
@@ -88,7 +91,7 @@
"account_type": "Expense Account"
},
_("Depreciation"): {
- "account_type": "Expense Account"
+ "account_type": "Depreciation"
},
_("Entertainment Expenses"): {
"account_type": "Expense Account"
diff --git a/erpnext/accounts/doctype/account/test_account.py b/erpnext/accounts/doctype/account/test_account.py
index 83516da..4580d02 100644
--- a/erpnext/accounts/doctype/account/test_account.py
+++ b/erpnext/accounts/doctype/account/test_account.py
@@ -35,7 +35,12 @@
# related to Account Inventory Integration
["_Test Account Stock In Hand", "Current Assets", 0, None, None],
- ["_Test Account Fixed Assets", "Current Assets", 0, None, None],
+
+ # fixed asset depreciation
+ ["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
+ ["_Test Accumulated Depreciations", "Current Assets", 0, None, None],
+ ["_Test Depreciations", "Expenses", 0, None, None],
+ ["_Test Gain/Loss on Asset Disposal", "Expenses", 0, None, None],
# Receivable / Payable Account
["_Test Receivable", "Current Assets", 0, "Receivable", None],
diff --git a/erpnext/accounts/doctype/asset/__init__.py b/erpnext/accounts/doctype/asset/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/__init__.py
diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/accounts/doctype/asset/asset.js
new file mode 100644
index 0000000..0b28a36
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/asset.js
@@ -0,0 +1,60 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.provide("erpnext.asset");
+
+frappe.ui.form.on('Asset', {
+ onload: function(frm) {
+ frm.set_query("item_code", function() {
+ return {
+ "filters": {
+ "is_stock_item": 0,
+ "is_fixed_asset": 1,
+ "disabled": 0
+ }
+ };
+ });
+ },
+
+ refresh: function(frm) {
+ if (frm.doc.docstatus==1) {
+ if (in_list(["Submittted", "Partially Depreciated", "Fully Depreciated"], frm.doc.status)) {
+ cur_frm.add_custom_button("Scrap Asset", function() {
+ erpnext.asset.scrap_asset(frm);
+ });
+ } else if (frm.doc.status=='Scrapped') {
+ cur_frm.add_custom_button("Restore Asset", function() {
+ erpnext.asset.restore_asset(frm);
+ });
+ }
+ }
+ }
+});
+
+erpnext.asset.scrap_asset = function(frm) {
+ frappe.confirm(__("Do you really want to scrap this asset?"), function () {
+ frappe.call({
+ args: {
+ "asset_name": frm.doc.name
+ },
+ method: "erpnext.accounts.doctype.asset.depreciation.scrap_asset",
+ callback: function(r) {
+ cur_frm.reload_doc();
+ }
+ })
+ })
+}
+
+erpnext.asset.restore_asset = function(frm) {
+ frappe.confirm(__("Do you really want to restore this scrapped asset?"), function () {
+ frappe.call({
+ args: {
+ "asset_name": frm.doc.name
+ },
+ method: "erpnext.accounts.doctype.asset.depreciation.restore_asset",
+ callback: function(r) {
+ cur_frm.reload_doc();
+ }
+ })
+ })
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/asset.json b/erpnext/accounts/doctype/asset/asset.json
new file mode 100644
index 0000000..b23b472
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/asset.json
@@ -0,0 +1,619 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:asset_name",
+ "creation": "2016-03-01 17:01:27.920130",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "asset_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "asset_category",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset Category",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Asset Category",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Draft\nSubmitted\nPartially Depreciated\nFully Depreciated\nSold\nScrapped",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Purchase Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_invoice",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Purchase Invoice",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Purchase Invoice",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "journal_entry_for_scrap",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Journal Entry for Scrap",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Journal Entry",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "",
+ "depends_on": "",
+ "fieldname": "depreciation_method",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depreciation Method",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nStraight Line\nDouble Declining Balance",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "number_of_depreciations",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Number of Depreciations",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "number_of_months_in_a_period",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Number of Months in a Period",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "",
+ "fieldname": "next_depreciation_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Next Depreciation Date",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_11",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "gross_purchase_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Gross Purchase Amount",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "expected_value_after_useful_life",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Expected Value After Useful Life",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "current_value",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Current Value (After Depreciation)",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_14",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depreciation Schedule",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "schedules",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depreciation Schedules",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Depreciation Schedule",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Asset",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 72,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-03-31 05:02:49.890116",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Asset",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py
new file mode 100644
index 0000000..3b141f6
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/asset.py
@@ -0,0 +1,135 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import flt, add_months, cint
+from frappe.model.document import Document
+
+class Asset(Document):
+ def validate(self):
+ self.status = self.get_status()
+ self.validate_fixed_asset_item()
+ self.validate_asset_values()
+ self.set_depreciation_settings()
+ self.make_depreciation_schedule()
+ self.validate_depreciation_settings_in_company()
+
+ def on_submit(self):
+ self.set_status()
+
+ def on_cancel(self):
+ self.validate_cancellation()
+ self.delete_depreciation_entries()
+ self.set_status()
+
+ def validate_fixed_asset_item(self):
+ item = frappe.get_doc("Item", self.item_code)
+ if item.disabled:
+ frappe.throw(_("Item {0} has been disabled").format(self.item_code))
+ if item.is_stock_item:
+ frappe.throw(_("Item {0} must be a non-stock item").format(self.item_code))
+
+ def validate_asset_values(self):
+ if flt(self.expected_value_after_useful_life) >= flt(self.gross_purchase_amount):
+ frappe.throw(_("Expected Value After Useful Life must be less than Gross Purchase Amount"))
+
+ if not flt(self.gross_purchase_amount):
+ frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
+
+ if not self.current_value and self.next_depreciation_date:
+ self.current_value = flt(self.gross_purchase_amount)
+ else:
+ if flt(self.current_value) > flt(self.gross_purchase_amount):
+ frappe.throw(_("Current Value After Depreciation must be less than equal to {0}")
+ .format(flt(self.gross_purchase_amount)))
+
+ def set_depreciation_settings(self):
+ asset_category = frappe.get_doc("Asset Category", self.asset_category)
+
+ for field in ("depreciation_method", "number_of_depreciations", "number_of_months_in_a_period"):
+ if not self.get(field):
+ self.set(field, asset_category.get(field))
+
+ def make_depreciation_schedule(self):
+ self.schedules = []
+ if not self.get("schedules") and self.next_depreciation_date:
+ accumulated_depreciation = 0
+ value_after_depreciation = flt(self.current_value)
+ for n in xrange(self.number_of_depreciations):
+ schedule_date = add_months(self.next_depreciation_date,
+ n * cint(self.number_of_months_in_a_period))
+
+ depreciation_amount = self.get_depreciation_amount(value_after_depreciation)
+
+ self.append("schedules", {
+ "schedule_date": schedule_date,
+ "depreciation_amount": depreciation_amount,
+ "accumulated_depreciation_amount": accumulated_depreciation + depreciation_amount
+ })
+ accumulated_depreciation += flt(depreciation_amount)
+ value_after_depreciation -= flt(depreciation_amount)
+
+ def get_depreciation_amount(self, depreciable_value):
+ if self.depreciation_method == "Straight Line":
+ depreciation_amount = (flt(self.current_value) -
+ flt(self.expected_value_after_useful_life)) / cint(self.number_of_depreciations)
+ else:
+ factor = 200.0 / cint(self.number_of_depreciations)
+ depreciation_amount = flt(depreciable_value * factor / 100, 0)
+
+ value_after_depreciation = flt(depreciable_value) - depreciation_amount
+ if value_after_depreciation < flt(self.expected_value_after_useful_life):
+ depreciation_amount = flt(depreciable_value) - flt(self.expected_value_after_useful_life)
+
+ return depreciation_amount
+
+ def validate_cancellation(self):
+ if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
+ frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
+
+ if self.purchase_invoice:
+ frappe.throw(_("Please cancel Purchase Invoice {0} first").format(self.purchase_invoice))
+
+ def delete_depreciation_entries(self):
+ total_depreciation_amount = 0
+ for d in self.get("schedules"):
+ if d.journal_entry:
+ frappe.get_doc("Journal Entry", d.journal_entry).cancel()
+
+ d.db_set("journal_entry", None)
+ total_depreciation_amount += flt(d.depreciation_amount)
+ self.db_set("current_value", (self.current_value + total_depreciation_amount))
+
+ def validate_depreciation_settings_in_company(self):
+ company = frappe.get_doc("Company", self.company)
+ for field in ("accumulated_depreciation_account", "depreciation_expense_account",
+ "disposal_account", "depreciation_cost_center"):
+ if not company.get(field):
+ frappe.throw(_("Please set {0} in Company {1}")
+ .format(company.meta.get_label(field), self.company))
+
+ def set_status(self, status=None):
+ '''Set asset and update status'''
+ if not status:
+ status = self.get_status()
+ self.db_set("status", status)
+
+ def get_status(self):
+ '''Returns status based on whether it is draft, submitted, scrapped or depreciated'''
+ if self.docstatus == 0:
+ status = "Draft"
+ elif self.docstatus == 1:
+ status = "Submitted"
+ if self.journal_entry_for_scrap:
+ status = "Scrapped"
+ elif flt(self.current_value) <= flt(self.expected_value_after_useful_life):
+ status = "Fully Depreciated"
+ elif flt(self.current_value) < flt(self.gross_purchase_amount):
+ status = 'Partially Depreciated'
+ elif self.docstatus == 2:
+ status = "Cancelled"
+
+ return status
diff --git a/erpnext/accounts/doctype/asset/depreciation.py b/erpnext/accounts/doctype/asset/depreciation.py
new file mode 100644
index 0000000..e60e872
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/depreciation.py
@@ -0,0 +1,172 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import flt, today, getdate
+
+def post_depreciation_entries(date=None):
+ if not date:
+ date = today()
+ for asset in get_depreciable_assets(date):
+ make_depreciation_entry(asset, date)
+ frappe.db.commit()
+
+def get_depreciable_assets(date):
+ return frappe.db.sql_list("""select a.name
+ from tabAsset a, `tabDepreciation Schedule` ds
+ where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s
+ and a.status in ('Submitted', 'Partially Depreciated')
+ and ifnull(ds.journal_entry, '')=''""", date)
+
+def make_depreciation_entry(asset_name, date=None):
+ if not date:
+ date = today()
+
+ asset = frappe.get_doc("Asset", asset_name)
+ fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
+ get_depreciation_accounts(asset)
+
+ depreciation_cost_center = frappe.db.get_value("Company", asset.company, "depreciation_cost_center")
+
+ for d in asset.get("schedules"):
+ if not d.journal_entry and getdate(d.schedule_date) <= getdate(date):
+ je = frappe.new_doc("Journal Entry")
+ je.voucher_type = "Depreciation Entry"
+ je.posting_date = d.schedule_date
+ je.company = asset.company
+ je.remark = "Depreciation Entry against {0} worth {1}".format(asset_name, d.depreciation_amount)
+
+ je.append("accounts", {
+ "account": accumulated_depreciation_account,
+ "credit_in_account_currency": d.depreciation_amount,
+ "reference_type": "Asset",
+ "reference_name": asset.name
+ })
+
+ je.append("accounts", {
+ "account": depreciation_expense_account,
+ "debit_in_account_currency": d.depreciation_amount,
+ "reference_type": "Asset",
+ "reference_name": asset.name,
+ "cost_center": depreciation_cost_center
+ })
+
+ je.flags.ignore_permissions = True
+ je.submit()
+
+ d.db_set("journal_entry", je.name)
+ asset.current_value -= d.depreciation_amount
+
+ asset.db_set("current_value", asset.current_value)
+ asset.set_status()
+
+def get_depreciation_accounts(asset):
+ fixed_asset_account = accumulated_depreciation_account = depreciation_expense_account = None
+
+ accounts = frappe.db.get_value("Asset Category Account",
+ filters={'parent': asset.asset_category, 'company_name': asset.company},
+ fieldname = ['fixed_asset_account', 'accumulated_depreciation_account',
+ 'depreciation_expense_account'], as_dict=1)
+
+ if accounts:
+ fixed_asset_account = accounts.fixed_asset_account
+ accumulated_depreciation_account = accounts.accumulated_depreciation_account
+ depreciation_expense_account = accounts.depreciation_expense_account
+
+ if not accumulated_depreciation_account or not depreciation_expense_account:
+ accounts = frappe.db.get_value("Company", asset.company,
+ ["accumulated_depreciation_account", "depreciation_expense_account"])
+
+ if not accumulated_depreciation_account:
+ accumulated_depreciation_account = accounts[0]
+ if not depreciation_expense_account:
+ depreciation_expense_account = accounts[1]
+
+ if not fixed_asset_account or not accumulated_depreciation_account or not depreciation_expense_account:
+ frappe.throw(_("Please set Depreciation related Accounts in Asset Category {0} or Company {1}")
+ .format(asset.asset_category, asset.company))
+
+ return fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account
+
+@frappe.whitelist()
+def scrap_asset(asset_name):
+ asset = frappe.get_doc("Asset", asset_name)
+
+ if asset.docstatus != 1:
+ frappe.throw(_("Asset {0} must be submitted").format(asset.name))
+ elif asset.status in ("Cancelled", "Sold", "Scrapped"):
+ frappe.throw(_("Asset {0} cannot be scrapped, as it is already {1}").format(asset.name, asset.status))
+
+ je = frappe.new_doc("Journal Entry")
+ je.voucher_type = "Journal Entry"
+ je.posting_date = today()
+ je.company = asset.company
+ je.remark = "Scrap Entry for asset {0}".format(asset_name)
+
+ for entry in get_gl_entries_on_asset_disposal(asset):
+ entry.update({
+ "reference_type": "Asset",
+ "reference_name": asset_name
+ })
+ je.append("accounts", entry)
+
+ je.flags.ignore_permissions = True
+ je.submit()
+
+ frappe.db.set_value("Asset", asset_name, "journal_entry_for_scrap", je.name)
+ asset.set_status("Scrapped")
+
+@frappe.whitelist()
+def restore_asset(asset_name):
+ asset = frappe.get_doc("Asset", asset_name)
+
+ je = asset.journal_entry_for_scrap
+ asset.db_set("journal_entry_for_scrap", None)
+ frappe.get_doc("Journal Entry", je).cancel()
+
+ asset.set_status()
+
+@frappe.whitelist()
+def get_gl_entries_on_asset_disposal(asset, selling_amount=0):
+ fixed_asset_account, accumulated_depr_account, depr_expense_account = get_depreciation_accounts(asset)
+ disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(asset.company)
+ accumulated_depr_amount = flt(asset.gross_purchase_amount) - flt(asset.current_value)
+
+ gl_entries = [
+ {
+ "account": fixed_asset_account,
+ "credit_in_account_currency": asset.gross_purchase_amount,
+ "credit": asset.gross_purchase_amount
+ },
+ {
+ "account": accumulated_depr_account,
+ "debit_in_account_currency": accumulated_depr_amount,
+ "debit": accumulated_depr_amount
+ }
+ ]
+
+ profit_amount = flt(selling_amount) - flt(asset.current_value)
+ if flt(asset.current_value) and profit_amount:
+ debit_or_credit = "debit" if profit_amount < 0 else "credit"
+ gl_entries.append({
+ "account": disposal_account,
+ "cost_center": depreciation_cost_center,
+ debit_or_credit: abs(profit_amount),
+ debit_or_credit + "_in_account_currency": abs(profit_amount)
+ })
+
+ return gl_entries
+
+def get_disposal_account_and_cost_center(company):
+ disposal_account, depreciation_cost_center = frappe.db.get_value("Company", company,
+ ["disposal_account", "depreciation_cost_center"])
+
+ if not disposal_account:
+ frappe.throw(_("Please set 'Asset Disposal Account' in Company {0}").format(company))
+ if not depreciation_cost_center:
+ frappe.throw(_("Please set 'Asset Depreciation Cost Center' in Company {0}").format(company))
+
+ return disposal_account, depreciation_cost_center
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
new file mode 100644
index 0000000..bd8aba1
--- /dev/null
+++ b/erpnext/accounts/doctype/asset/test_asset.py
@@ -0,0 +1,204 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+from frappe.utils import cstr
+from erpnext.accounts.doctype.asset.depreciation import post_depreciation_entries, scrap_asset, restore_asset
+from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+
+class TestAsset(unittest.TestCase):
+ def setUp(self):
+ set_depreciation_settings_in_company()
+ create_asset()
+
+ def test_fixed_asset_must_be_non_stock_item(self):
+ item = frappe.get_doc("Item", "Macbook Pro")
+ item.is_stock_item = 1
+ self.assertRaises(frappe.ValidationError, item.save)
+
+ def test_schedule_for_straight_line_method(self):
+ asset = frappe.get_doc("Asset", "Macbook Pro 1")
+
+ self.assertEqual(asset.status, "Draft")
+
+ expected_schedules = [
+ ["2015-12-31", 30000, 30000],
+ ["2016-03-31", 30000, 60000],
+ ["2016-06-30", 30000, 90000]
+ ]
+
+ schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
+ for d in asset.get("schedules")]
+
+ self.assertEqual(schedules, expected_schedules)
+
+
+ def test_schedule_for_double_declining_method(self):
+ asset = frappe.get_doc("Asset", "Macbook Pro 1")
+ asset.depreciation_method = "Double Declining Balance"
+ asset.save()
+
+ expected_schedules = [
+ ["2015-12-31", 66667, 66667],
+ ["2016-03-31", 22222, 88889],
+ ["2016-06-30", 1111, 90000]
+ ]
+
+ schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
+ for d in asset.get("schedules")]
+
+ self.assertEqual(schedules, expected_schedules)
+
+ def test_depreciation(self):
+ asset = frappe.get_doc("Asset", "Macbook Pro 1")
+ asset.submit()
+ asset.load_from_db()
+ self.assertEqual(asset.status, "Submitted")
+
+ post_depreciation_entries(date="2016-01-01")
+ asset.load_from_db()
+
+ self.assertEqual(asset.status, "Partially Depreciated")
+
+ expected_gle = (
+ ("_Test Accumulated Depreciations - _TC", 0.0, 30000.0),
+ ("_Test Depreciations - _TC", 30000.0, 0.0)
+ )
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+ where against_voucher_type='Asset' and against_voucher = %s
+ order by account""", asset.name)
+
+ self.assertEqual(gle, expected_gle)
+ self.assertEqual(asset.get("current_value"), 70000)
+
+
+ def test_scrap_asset(self):
+ asset = frappe.get_doc("Asset", "Macbook Pro 1")
+ asset.submit()
+ post_depreciation_entries(date="2016-01-01")
+
+ scrap_asset("Macbook Pro 1")
+
+ asset.load_from_db()
+ self.assertEqual(asset.status, "Scrapped")
+ self.assertTrue(asset.journal_entry_for_scrap)
+
+ expected_gle = (
+ ("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
+ ("_Test Fixed Asset - _TC", 0.0, 100000.0),
+ ("_Test Gain/Loss on Asset Disposal - _TC", 70000.0, 0.0)
+ )
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+ where voucher_type='Journal Entry' and voucher_no = %s
+ order by account""", asset.journal_entry_for_scrap)
+
+ self.assertEqual(gle, expected_gle)
+
+ restore_asset("Macbook Pro 1")
+
+ asset.load_from_db()
+ self.assertFalse(asset.journal_entry_for_scrap)
+ self.assertEqual(asset.status, "Partially Depreciated")
+
+ def test_asset_sale(self):
+ frappe.get_doc("Asset", "Macbook Pro 1").submit()
+ post_depreciation_entries(date="2016-01-01")
+
+ si = create_sales_invoice(item_code="Macbook Pro", rate=25000, do_not_save=True)
+ si.get("items")[0].asset = "Macbook Pro 1"
+ si.submit()
+
+ self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Sold")
+
+ expected_gle = (
+ ("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
+ ("_Test Fixed Asset - _TC", 0.0, 100000.0),
+ ("_Test Gain/Loss on Asset Disposal - _TC", 45000.0, 0.0),
+ ("Debtors - _TC", 25000.0, 0.0)
+ )
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+ where voucher_type='Sales Invoice' and voucher_no = %s
+ order by account""", si.name)
+
+ self.assertEqual(gle, expected_gle)
+
+ si.cancel()
+
+ self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Partially Depreciated")
+
+ def tearDown(self):
+ asset = frappe.get_doc("Asset", "Macbook Pro 1")
+
+ if asset.docstatus == 1 and asset.status not in ("Scrapped", "Sold", "Draft", "Cancelled"):
+ asset.cancel()
+
+ self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Cancelled")
+
+ frappe.delete_doc("Asset", "Macbook Pro 1")
+
+def create_asset():
+ if not frappe.db.exists("Asset Category", "Computers"):
+ create_asset_category()
+
+ if not frappe.db.exists("Item", "Macbook Pro"):
+ create_fixed_asset_item()
+
+ asset = frappe.get_doc({
+ "doctype": "Asset",
+ "asset_name": "Macbook Pro 1",
+ "asset_category": "Computers",
+ "item_code": "Macbook Pro",
+ "company": "_Test Company",
+ "purchase_date": "2015-01-01",
+ "next_depreciation_date": "2015-12-31",
+ "gross_purchase_amount": 100000,
+ "expected_value_after_useful_life": 10000
+ })
+ try:
+ asset.save()
+ except frappe.DuplicateEntryError:
+ pass
+
+ return asset
+
+def create_asset_category():
+ asset_category = frappe.new_doc("Asset Category")
+ asset_category.asset_category_name = "Computers"
+ asset_category.number_of_depreciations = 3
+ asset_category.number_of_months_in_a_period = 3
+ asset_category.append("accounts", {
+ "company_name": "_Test Company",
+ "fixed_asset_account": "_Test Fixed Asset - _TC",
+ "accumulated_depreciation_account": "_Test Accumulated Depreciations - _TC",
+ "depreciation_expense_account": "_Test Depreciations - _TC"
+ })
+ asset_category.insert()
+
+def create_fixed_asset_item():
+ try:
+ frappe.get_doc({
+ "doctype": "Item",
+ "item_code": "Macbook Pro",
+ "item_name": "Macbook Pro",
+ "description": "Macbook Pro Retina Display",
+ "item_group": "All Item Groups",
+ "stock_uom": "Nos",
+ "is_stock_item": 0,
+ "is_fixed_asset": 1
+ }).insert()
+ except frappe.DuplicateEntryError:
+ pass
+
+def set_depreciation_settings_in_company():
+ company = frappe.get_doc("Company", "_Test Company")
+ company.accumulated_depreciation_account = "_Test Accumulated Depreciations - _TC"
+ company.depreciation_expense_account = "_Test Depreciations - _TC"
+ company.disposal_account = "_Test Gain/Loss on Asset Disposal - _TC"
+ company.depreciation_cost_center = "_Test Cost Center - _TC"
+ company.save()
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/__init__.py b/erpnext/accounts/doctype/asset_category/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category/__init__.py
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.js b/erpnext/accounts/doctype/asset_category/asset_category.js
new file mode 100644
index 0000000..3130f6b
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category/asset_category.js
@@ -0,0 +1,44 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Asset Category', {
+ onload: function(frm) {
+ frm.add_fetch('company_name', 'accumulated_depreciation_account', 'accumulated_depreciation_account');
+ frm.add_fetch('company_name', 'depreciation_expense_account', 'depreciation_expense_account');
+
+ frm.set_query('fixed_asset_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "account_type": "Fixed Asset",
+ "root_type": "Asset",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
+
+ frm.set_query('accumulated_depreciation_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "root_type": "Asset",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
+
+ frm.set_query('depreciation_expense_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "root_type": "Expense",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
+
+ }
+});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.json b/erpnext/accounts/doctype/asset_category/asset_category.json
new file mode 100644
index 0000000..741147b
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category/asset_category.json
@@ -0,0 +1,252 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:asset_category_name",
+ "creation": "2016-03-01 17:41:39.778765",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "asset_category_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset Category Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Straight Line",
+ "fieldname": "depreciation_method",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depreciation Method",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nStraight Line\nDouble Declining Balance",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "number_of_depreciations",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Number of Depreciations",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "number_of_months_in_a_period",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Number of Months in a Period",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_2",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounts",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "accounts",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounts",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Asset Category Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-03-31 05:37:48.481012",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Asset Category",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.py b/erpnext/accounts/doctype/asset_category/asset_category.py
new file mode 100644
index 0000000..450d191
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category/asset_category.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import cint
+from frappe.model.document import Document
+
+class AssetCategory(Document):
+ def validate(self):
+ for field in ("number_of_depreciations", "number_of_months_in_a_period"):
+ if cint(self.get(field))<1:
+ frappe.throw(_("{0} must be greater than 0").format(self.meta.get_label(field)), frappe.MandatoryError)
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/accounts/doctype/asset_category/test_asset_category.py
new file mode 100644
index 0000000..855dc8f
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category/test_asset_category.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestAssetCategory(unittest.TestCase):
+ def test_mandatory_fields(self):
+ asset_category = frappe.new_doc("Asset Category")
+ asset_category.asset_category_name = "Computers"
+
+ self.assertRaises(frappe.MandatoryError, asset_category.insert)
+
+ asset_category.number_of_depreciations = 3
+ asset_category.number_of_months_in_a_period = 3
+ asset_category.append("accounts", {
+ "company_name": "_Test Company",
+ "fixed_asset_account": "_Test Fixed Asset - _TC",
+ "accumulated_depreciation_account": "_Test Accumulated Depreciations - _TC",
+ "depreciation_expense_account": "_Test Depreciations - _TC"
+ })
+
+ try:
+ asset_category.insert()
+ except frappe.DuplicateEntryError:
+ pass
+
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category_account/__init__.py b/erpnext/accounts/doctype/asset_category_account/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category_account/__init__.py
diff --git a/erpnext/accounts/doctype/asset_category_account/asset_category_account.json b/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
new file mode 100644
index 0000000..049b3e9
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
@@ -0,0 +1,137 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2016-03-07 15:55:18.806409",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "fixed_asset_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Fixed Asset Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "accumulated_depreciation_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Accumulated Depreciation Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "depreciation_expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Depreciation Expense Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-03-31 05:46:47.759015",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Asset Category Account",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category_account/asset_category_account.py b/erpnext/accounts/doctype/asset_category_account/asset_category_account.py
new file mode 100644
index 0000000..67925f4
--- /dev/null
+++ b/erpnext/accounts/doctype/asset_category_account/asset_category_account.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class AssetCategoryAccount(Document):
+ pass
diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py
index c14990a..2dcf958 100644
--- a/erpnext/accounts/doctype/c_form/c_form.py
+++ b/erpnext/accounts/doctype/c_form/c_form.py
@@ -18,17 +18,17 @@
`tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no)
if inv and inv[0][0] != 'Yes':
- frappe.throw("C-form is not applicable for Invoice: {0}".format(d.invoice_no))
+ frappe.throw(_("C-form is not applicable for Invoice: {0}".format(d.invoice_no)))
elif inv and inv[0][1] and inv[0][1] != self.name:
- frappe.throw("""Invoice {0} is tagged in another C-form: {1}.
+ frappe.throw(_("""Invoice {0} is tagged in another C-form: {1}.
If you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again"""\
- .format(d.invoice_no, inv[0][1]))
+ .format(d.invoice_no, inv[0][1])))
elif not inv:
- frappe.throw("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \
- Please enter a valid Invoice".format(d.idx, d.invoice_no))
+ frappe.throw(_("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \
+ Please enter a valid Invoice".format(d.idx, d.invoice_no)))
def on_update(self):
""" Update C-Form No on invoices"""
diff --git a/erpnext/accounts/doctype/depreciation_schedule/__init__.py b/erpnext/accounts/doctype/depreciation_schedule/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/depreciation_schedule/__init__.py
diff --git a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json
new file mode 100644
index 0000000..50fba88
--- /dev/null
+++ b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json
@@ -0,0 +1,160 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "autoname": "",
+ "creation": "2016-03-02 15:11:01.278862",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Schedule Date",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "depreciation_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Depreciation Amount",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "accumulated_depreciation_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Accumulated Depreciation Amount",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "journal_entry",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Journal Entry",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Journal Entry",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-03-09 12:21:27.938215",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Depreciation Schedule",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py
new file mode 100644
index 0000000..957d6d1
--- /dev/null
+++ b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class DepreciationSchedule(Document):
+ pass
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index 9456924..c3f399d 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -21,6 +21,7 @@
def validate(self):
self.validate_dates()
+ self.validate_overlap()
if not self.is_new():
year_start_end_dates = frappe.db.sql("""select year_start_date, year_end_date
@@ -41,6 +42,37 @@
def on_update(self):
check_duplicate_fiscal_year(self)
+ def validate_overlap(self):
+ existing_fiscal_years = frappe.db.sql("""select name from `tabFiscal Year`
+ where (
+ (%(year_start_date)s between year_start_date and year_end_date)
+ or (%(year_end_date)s between year_start_date and year_end_date)
+ or (year_start_date between %(year_start_date)s and %(year_end_date)s)
+ or (year_end_date between %(year_start_date)s and %(year_end_date)s)
+ ) and name!=%(name)s""",
+ {
+ "year_start_date": self.year_start_date,
+ "year_end_date": self.year_end_date,
+ "name": self.name or "No Name"
+ }, as_dict=True)
+
+ if existing_fiscal_years:
+ for existing in existing_fiscal_years:
+ company_for_existing = frappe.db.sql_list("""select company from `tabFiscal Year Company`
+ where parent=%s""", existing.name)
+
+ overlap = False
+ if not self.get("companies") or not company_for_existing:
+ overlap = True
+
+ for d in self.get("companies"):
+ if d.company in company_for_existing:
+ overlap = True
+
+ if overlap:
+ frappe.throw(_("Year start date or end date is overlapping with {0}. To avoid please set company")
+ .format(existing.name), frappe.NameError)
+
@frappe.whitelist()
def check_duplicate_fiscal_year(doc):
year_start_end_dates = frappe.db.sql("""select name, year_start_date, year_end_date from `tabFiscal Year` where name!=%s""", (doc.name))
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index 906c131..dd8d51e 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -41,7 +41,7 @@
mandatory = ['account','remarks','voucher_type','voucher_no','company']
for k in mandatory:
if not self.get(k):
- frappe.throw(_("{0} is required").format(self.meta.get_label(k)))
+ frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
account_type = frappe.db.get_value("Account", self.account, "account_type")
if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party):
@@ -88,8 +88,8 @@
"Cost Center", self.cost_center, "company")
return self.cost_center_company[self.cost_center]
-
- if self.cost_center and _get_cost_center_company() != self.company:
+
+ if self.cost_center and _get_cost_center_company() != self.company:
frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company))
def validate_party(self):
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 0a831ca..fc29bc7 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -50,6 +50,7 @@
},
load_defaults: function() {
+ this.frm.show_print_first = true;
if(this.frm.doc.__islocal && this.frm.doc.company) {
frappe.model.set_default_values(this.frm.doc);
$.each(this.frm.doc.accounts || [], function(i, jvd) {
@@ -360,7 +361,7 @@
credit: function(frm, dt, dn) {
cur_frm.cscript.update_totals(frm.doc);
},
-
+
exchange_rate: function(frm, cdt, cdn) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
@@ -368,7 +369,7 @@
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
}
-
+
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
})
@@ -463,6 +464,7 @@
},
{fieldtype: "Date", fieldname: "posting_date", label: __("Date"), reqd: 1,
default: frm.doc.posting_date},
+ {fieldtype: "Small Text", fieldname: "user_remark", label: __("User Remark"), reqd: 1},
{fieldtype: "Select", fieldname: "naming_series", label: __("Series"), reqd: 1,
options: naming_series_options, default: naming_series_default},
]
@@ -473,6 +475,7 @@
var values = dialog.get_values();
frm.set_value("posting_date", values.posting_date);
+ frm.set_value("user_remark", values.user_remark);
frm.set_value("naming_series", values.naming_series);
// clear table is used because there might've been an error while adding child
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index 63ba380..9d4ad48 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -1,1207 +1,1209 @@
{
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "creation": "2013-03-25 10:53:52",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2013-03-25 10:53:52",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "entry_type_and_date",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "options": "icon-flag",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "entry_type_and_date",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-flag",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "default": "",
- "fieldname": "title",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Title",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "",
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Title",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Journal Entry",
- "fieldname": "voucher_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Entry Type",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "voucher_type",
- "oldfieldtype": "Select",
- "options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Journal Entry",
+ "fieldname": "voucher_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Entry Type",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "voucher_type",
+ "oldfieldtype": "Select",
+ "options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Series",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "JV-",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "JV-",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Posting Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Posting Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "2_add_edit_gl_entries",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-table",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "2_add_edit_gl_entries",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-table",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "accounts",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Accounting Entries",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Journal Entry Account",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "accounts",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounting Entries",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Journal Entry Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break99",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break99",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "cheque_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Reference Number",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "cheque_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "cheque_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Reference Number",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "cheque_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "cheque_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Reference Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "cheque_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "cheque_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Reference Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "cheque_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "user_remark",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "User Remark",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "user_remark",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "user_remark",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "User Remark",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "user_remark",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break99",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break99",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_debit",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Total Debit",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "total_debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_debit",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Total Debit",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "total_debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_credit",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Total Credit",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "total_credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_credit",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Total Credit",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "total_credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "difference",
- "fieldname": "difference",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Difference (Dr - Cr)",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "difference",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "difference",
+ "fieldname": "difference",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Difference (Dr - Cr)",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "difference",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "difference",
- "fieldname": "get_balance",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Make Difference Entry",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Button",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "difference",
+ "fieldname": "get_balance",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Make Difference Entry",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Button",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "multi_currency",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Multi Currency",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "multi_currency",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Multi Currency",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Amount",
- "length": 0,
- "no_copy": 1,
- "options": "",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Total Amount",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_amount_in_words",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Amount in Words",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_amount_in_words",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Amount in Words",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Reference",
- "length": 0,
- "no_copy": 0,
- "options": "icon-pushpin",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Reference",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-pushpin",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "clearance_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Clearance Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "clearance_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "clearance_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Clearance Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "clearance_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "remark",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Remark",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "remark",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "remark",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Remark",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "remark",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break98",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break98",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "bill_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Bill No",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "bill_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "bill_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Bill No",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "bill_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "bill_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Bill Date",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "bill_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "bill_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Bill Date",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "bill_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "due_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Due Date",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Due Date",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
- "fieldname": "write_off",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
+ "fieldname": "write_off",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Accounts Receivable",
- "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
- "fieldname": "write_off_based_on",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Based On",
- "length": 0,
- "no_copy": 0,
- "options": "Accounts Receivable\nAccounts Payable",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Accounts Receivable",
+ "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
+ "fieldname": "write_off_based_on",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Based On",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Accounts Receivable\nAccounts Payable",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
- "fieldname": "get_outstanding_invoices",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Get Outstanding Invoices",
- "length": 0,
- "no_copy": 0,
- "options": "get_outstanding_invoices",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
+ "fieldname": "get_outstanding_invoices",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Get Outstanding Invoices",
+ "length": 0,
+ "no_copy": 0,
+ "options": "get_outstanding_invoices",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_30",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_30",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Amount",
- "length": 0,
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Amount",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "printing_settings",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Printing Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "printing_settings",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Printing Settings",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "pay_to_recd_from",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Pay To / Recd From",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "pay_to_recd_from",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Pay To / Recd From",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_35",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_35",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Letter Head",
- "length": 0,
- "no_copy": 0,
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Letter Head",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Print Heading",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Heading",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "addtional_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "More Information",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "addtional_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "No",
- "description": "",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Is Opening",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "No",
+ "description": "",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Is Opening",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:inList([\"Credit Note\", \"Debit Note\"], doc.voucher_type)",
- "fieldname": "stock_entry",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Stock Entry",
- "length": 0,
- "no_copy": 0,
- "options": "Stock Entry",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:inList([\"Credit Note\", \"Debit Note\"], doc.voucher_type)",
+ "fieldname": "stock_entry",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Stock Entry",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Stock Entry",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Amended From",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Journal Entry",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Journal Entry",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-file-text",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "menu_index": 0,
- "modified": "2016-03-11 01:38:50.944475",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Journal Entry",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-file-text",
+ "idx": 176,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "menu_index": 0,
+ "modified": "2016-04-06 05:33:21.851581",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Journal Entry",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Auditor",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Auditor",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
}
- ],
- "read_only": 0,
- "read_only_onload": 1,
- "search_fields": "voucher_type,posting_date, due_date, cheque_no",
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "title"
-}
+ ],
+ "read_only": 0,
+ "read_only_onload": 1,
+ "search_fields": "voucher_type,posting_date, due_date, cheque_no",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "title",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index aaf3318..5f9a915 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -507,7 +507,7 @@
def validate_empty_accounts_table(self):
if not self.get('accounts'):
- frappe.throw("Accounts table cannot be blank.")
+ frappe.throw(_("Accounts table cannot be blank."))
def set_account_and_party_balance(self):
account_balance = {}
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index 9277da5..28b57bd 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -16,6 +16,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Account",
@@ -44,6 +45,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Type",
@@ -68,6 +70,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Balance",
@@ -96,6 +99,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Cost Center",
@@ -124,6 +128,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -146,6 +151,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Type",
@@ -170,6 +176,7 @@
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Party",
@@ -194,6 +201,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Balance",
@@ -221,6 +229,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
@@ -245,6 +254,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Account Currency",
@@ -270,6 +280,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -293,6 +304,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exchange Rate",
@@ -317,6 +329,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amount",
@@ -340,6 +353,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Debit",
@@ -365,6 +379,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Debit in Company Currency",
@@ -392,6 +407,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -414,6 +430,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Credit",
@@ -439,6 +456,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit in Company Currency",
@@ -466,6 +484,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
@@ -489,12 +508,13 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Type",
"length": 0,
"no_copy": 0,
- "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim",
+ "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -514,6 +534,7 @@
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Reference Name",
@@ -539,6 +560,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -561,6 +583,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Advance",
@@ -587,6 +610,7 @@
"fieldtype": "Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Account",
@@ -614,12 +638,13 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2015-12-02 04:14:37.571883",
+ "modified": "2016-03-07 19:10:27.135795",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
index 854f5b3..70c0397 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
@@ -89,3 +89,8 @@
cur_frm.cscript.buying = function() {
cur_frm.cscript.set_options_for_applicable_for();
}
+
+//Dynamically change the description based on type of margin
+cur_frm.cscript.type = function(doc){
+ cur_frm.set_df_property('rate', 'description', doc.type=='Percentage'?'In Percentage %':'In Amount')
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index eb77ae2..23fc76d 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -40,6 +41,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
@@ -65,6 +67,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Apply On",
@@ -90,6 +93,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Code",
@@ -115,6 +119,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Brand",
@@ -140,6 +145,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Group",
@@ -164,6 +170,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -188,6 +195,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
@@ -212,6 +220,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disable",
@@ -235,6 +244,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -258,6 +268,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Selling",
@@ -281,6 +292,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Buying",
@@ -304,6 +316,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -328,6 +341,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Applicable For",
@@ -353,6 +367,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer",
@@ -378,6 +393,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
@@ -403,6 +419,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Territory",
@@ -428,6 +445,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Partner",
@@ -453,6 +471,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Campaign",
@@ -478,6 +497,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier",
@@ -503,6 +523,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Type",
@@ -527,6 +548,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -550,6 +572,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Min Qty",
@@ -573,6 +596,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -596,6 +620,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Max Qty",
@@ -619,6 +644,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -643,6 +669,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid From",
@@ -666,6 +693,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid Upto",
@@ -689,6 +717,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -711,6 +740,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
@@ -731,10 +761,115 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval: doc.selling == 1",
+ "fieldname": "margin",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Percentage",
+ "fieldname": "margin_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nPercentage\nAmount",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "0",
+ "depends_on": "eval:doc.margin_type",
+ "fieldname": "margin_rate_or_amount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Rate or Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "price_discount_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -759,6 +894,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price or Discount",
@@ -783,6 +919,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -806,6 +943,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price",
@@ -830,6 +968,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Discount on Price List Rate (%)",
@@ -854,6 +993,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "For Price List",
@@ -878,6 +1018,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -902,6 +1043,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Pricing Rule Help",
@@ -928,7 +1070,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-01-15 04:05:11.633824",
+ "modified": "2016-03-16 17:35:25.935271",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 736d03c..b4fe148 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -124,7 +124,7 @@
"name": args.name,
"pricing_rule": None
})
-
+
if args.ignore_pricing_rule or not args.item_code:
return item_details
@@ -155,6 +155,8 @@
if pricing_rule:
item_details.pricing_rule = pricing_rule.name
item_details.pricing_rule_for = pricing_rule.price_or_discount
+ item_details.margin_type = pricing_rule.margin_type
+ item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
if pricing_rule.price_or_discount == "Price":
item_details.update({
"price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
@@ -163,7 +165,6 @@
})
else:
item_details.discount_percentage = pricing_rule.discount_percentage
-
return item_details
def get_pricing_rules(args):
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
index d8d74bc..814c5c0 100644
--- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -86,6 +86,54 @@
frappe.db.sql("delete from `tabPricing Rule`")
+ def test_pricing_rule_for_margin(self):
+ from erpnext.stock.get_item_details import get_item_details
+ from frappe import MandatoryError
+
+ frappe.db.sql("delete from `tabPricing Rule`")
+
+ test_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Pricing Rule",
+ "apply_on": "Item Code",
+ "item_code": "_Test FG Item 2",
+ "selling": 1,
+ "price_or_discount": "Discount Percentage",
+ "price": 0,
+ "margin_type": "Percentage",
+ "margin_rate_or_amount": 10,
+ "company": "_Test Company"
+ }
+ frappe.get_doc(test_record.copy()).insert()
+
+ item_price = frappe.get_doc({
+ "doctype": "Item Price",
+ "price_list": "_Test Price List 2",
+ "item_code": "_Test FG Item 2",
+ "price_list_rate": 100
+ })
+
+ item_price.insert(ignore_permissions=True)
+
+ args = frappe._dict({
+ "item_code": "_Test FG Item 2",
+ "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",
+ "customer": "_Test Customer",
+ "name": None
+ })
+ details = get_item_details(args)
+ self.assertEquals(details.get("margin_type"), "Percentage")
+ self.assertEquals(details.get("margin_rate_or_amount"), 10)
+
+ frappe.db.sql("delete from `tabPricing Rule`")
+
def test_pricing_rule_for_variants(self):
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 4d865b8..bcb0503 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -196,7 +196,7 @@
// Get Print Heading
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
-return{
+ return {
filters:[
['Print Heading', 'docstatus', '!=', 2]
]
@@ -204,12 +204,24 @@
}
cur_frm.set_query("expense_account", "items", function(doc) {
- return{
- query: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.get_expense_account",
+ return {
+ query: "erpnext.controllers.queries.get_expense_account",
filters: {'company': doc.company}
}
});
+cur_frm.set_query("asset", "items", function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ filters: {
+ 'item_code': d.item_code,
+ 'docstatus': 1,
+ 'company': doc.company,
+ 'status': 'Submitted'
+ }
+ }
+});
+
cur_frm.cscript.expense_account = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.idx == 1 && d.expense_account){
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index a67f109..bba4a4a 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -26,7 +26,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -91,7 +91,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "supplier",
"fieldname": "supplier_name",
@@ -825,7 +825,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -1600,7 +1600,7 @@
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -2684,7 +2684,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 204,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2692,7 +2692,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-21 13:13:43.694604",
+ "modified": "2016-04-06 05:39:45.475873",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -2739,26 +2739,6 @@
"write": 0
},
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Supplier",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
@@ -2825,5 +2805,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "supplier",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 180831e..2699f44 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -55,14 +55,15 @@
self.set_against_expense_account()
self.validate_write_off_account()
self.update_valuation_rate("items")
- self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount",
- "items")
+ self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "items")
+ self.validate_fixed_asset_account()
self.create_remarks()
def create_remarks(self):
if not self.remarks:
if self.bill_no and self.bill_date:
- self.remarks = _("Against Supplier Invoice {0} dated {1}").format(self.bill_no, formatdate(self.bill_date))
+ self.remarks = _("Against Supplier Invoice {0} dated {1}").format(self.bill_no,
+ formatdate(self.bill_date))
else:
self.remarks = _("No Remarks")
@@ -152,12 +153,13 @@
stock_items = self.get_stock_items()
for item in self.get("items"):
# in case of auto inventory accounting,
- # against expense account is always "Stock Received But Not Billed"
- # for a stock item and if not epening entry and not drop-ship entry
+ # expense account is always "Stock Received But Not Billed" for a stock item
+ # except epening entry, drop-ship entry and fixed asset items
- if auto_accounting_for_stock and item.item_code in stock_items \
- and self.is_opening == 'No' and (not item.po_detail or
- not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")):
+ if auto_accounting_for_stock and item.item_code in stock_items and self.is_opening == 'No' \
+ and (not item.po_detail
+ or not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")
+ or not frappe.db.get_value("Item", item.item_code, "is_fixed_asset")):
item.expense_account = stock_not_billed_account
item.cost_center = None
@@ -235,6 +237,7 @@
def on_submit(self):
self.check_prev_docstatus()
+ self.validate_asset()
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
self.company, self.base_grand_total)
@@ -248,7 +251,34 @@
self.update_billing_status_in_pr()
self.update_project()
-
+
+ def validate_asset(self):
+ for d in self.get("items"):
+ if frappe.db.get_value("Item", d.item_code, "is_fixed_asset"):
+ if not d.asset:
+ frappe.throw(_("Row #{0}: Asset is mandatory against a Fixed Asset Item").format(d.idx))
+ else:
+ asset = frappe.get_doc("Asset", d.asset)
+
+ super(PurchaseInvoice, self).validate_asset(asset, d)
+
+ if getdate(asset.purchase_date) != getdate(self.posting_date):
+ frappe.throw(_("Purchase Date of asset {0} does not match with Purchase Invoice date")
+ .format(d.asset))
+
+ if asset.supplier and asset.supplier != self.supplier:
+ frappe.throw(_("Supplier of asset {0} does not match with the supplier in the Purchase Invoice").format(d.asset))
+
+ if asset.status != "Submitted":
+ frappe.throw(_("Row #{0}: Asset {1} is already {2}")
+ .format(d.idx, d.asset, asset.status))
+
+ frappe.db.set_value("Asset", asset.name, "purchase_invoice",
+ (self.name if self.docstatus==1 else None))
+
+ if self.docstatus==1 and not asset.supplier:
+ frappe.db.set_value("Asset", asset.name, "supplier", self.supplier)
+
def make_gl_entries(self):
auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
@@ -415,6 +445,7 @@
self.make_gl_entries_on_cancel()
self.update_project()
+ self.validate_asset()
def update_project(self):
project_list = []
@@ -429,7 +460,7 @@
def validate_supplier_invoice(self):
if self.bill_date:
if getdate(self.bill_date) > getdate(self.posting_date):
- frappe.throw("Supplier Invoice Date cannot be greater than Posting Date")
+ frappe.throw(_("Supplier Invoice Date cannot be greater than Posting Date"))
if self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
@@ -449,7 +480,7 @@
if pi:
pi = pi[0][0]
- frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
+ frappe.throw(_("Supplier Invoice No exists in Purchase Invoice {0}".format(pi)))
def update_billing_status_in_pr(self, update_modified=True):
updated_pr = []
@@ -465,28 +496,18 @@
for pr in set(updated_pr):
frappe.get_doc("Purchase Receipt", pr).update_billing_percentage(update_modified=update_modified)
+
+ def validate_fixed_asset_account(self):
+ for d in self.get('items'):
+ if frappe.db.get_value("Item", d.item_code, "is_fixed_asset"):
+ account_type = frappe.db.get_value("Account", d.expense_account, "account_type")
+ if account_type != 'Fixed Asset':
+ frappe.throw(_("Row {0}# Account must be of type 'Fixed Asset'").format(d.idx))
def on_recurring(self, reference_doc):
self.due_date = None
@frappe.whitelist()
-def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
- from erpnext.controllers.queries import get_match_cond
-
- # expense account can be any Debit account,
- # but can also be a Liability account with account_type='Expense Account' in special circumstances.
- # Hence the first condition is an "OR"
- return frappe.db.sql("""select tabAccount.name from `tabAccount`
- where (tabAccount.report_type = "Profit and Loss"
- or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary"))
- and tabAccount.is_group=0
- and tabAccount.docstatus!=2
- and tabAccount.company = %(company)s
- and tabAccount.{key} LIKE %(txt)s
- {mcond}""".format( key=frappe.db.escape(searchfield), mcond=get_match_cond(doctype) ),
- { 'company': filters['company'], 'txt': "%%%s%%" % frappe.db.escape(txt) })
-
-@frappe.whitelist()
def make_debit_note(source_name, target_doc=None):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
return make_return_doc("Purchase Invoice", source_name, target_doc)
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index ae44c1a..784c747 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -1080,6 +1080,32 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "asset",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Asset",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "po_detail",
"fieldtype": "Data",
"hidden": 1,
@@ -1239,7 +1265,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-03-18 05:05:27.752823",
+ "modified": "2016-03-28 05:05:27.752823",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 89af721..f6f746a 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -471,3 +471,15 @@
}
}
});
+
+cur_frm.set_query("asset", "items", function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ filters: [
+ ["Asset", "item_code", "=", d.item_code],
+ ["Asset", "docstatus", "=", 1],
+ ["Asset", "status", "in", ["Submitted", "Partially Depreciated", "Fully Depreciated"]],
+ ["Asset", "company", "=", doc.company]
+ ]
+ }
+});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 20b8d1b..6678583 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -52,7 +52,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -117,7 +117,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "customer",
"fieldname": "customer_name",
@@ -146,103 +146,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "is_pos",
"fieldtype": "Check",
"hidden": 0,
@@ -479,10 +382,207 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "depends_on": "",
+ "fieldname": "address_and_contact",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address and Contact",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "shipping_address_name",
"fieldtype": "Link",
- "hidden": 1,
+ "hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
@@ -508,7 +608,7 @@
"collapsible": 0,
"fieldname": "shipping_address",
"fieldtype": "Small Text",
- "hidden": 1,
+ "hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -530,7 +630,34 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 1,
+ "depends_on": "customer",
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -989,6 +1116,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Total",
+ "length": 0,
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
@@ -1015,31 +1167,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Total",
- "length": 0,
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "taxes_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1625,7 +1752,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
@@ -1667,7 +1794,7 @@
"oldfieldname": "in_words_export",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -2338,7 +2465,7 @@
"bold": 0,
"collapsible": 1,
"depends_on": "customer",
- "fieldname": "contact_section",
+ "fieldname": "more_information",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2348,7 +2475,7 @@
"label": "More Information",
"length": 0,
"no_copy": 0,
- "options": "icon-bullhorn",
+ "options": "",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -2390,58 +2517,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "length": 0,
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "col_break23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2466,56 +2541,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Person",
- "length": 0,
- "no_copy": 0,
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"depends_on": "eval:doc.source == 'Campaign'",
"fieldname": "campaign",
"fieldtype": "Link",
@@ -3410,7 +3435,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 181,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -3418,7 +3443,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-21 13:12:12.430038",
+ "modified": "2016-04-14 13:01:01.748816",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -3470,26 +3495,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -3531,5 +3536,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index a1144f2..bc1d73d 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -13,6 +13,7 @@
from erpnext.controllers.selling_controller import SellingController
from erpnext.accounts.utils import get_account_currency
from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so
+from erpnext.accounts.doctype.asset.depreciation import get_gl_entries_on_asset_disposal
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -55,11 +56,11 @@
self.validate_uom_is_integer("stock_uom", "qty")
self.check_close_sales_order("sales_order")
self.validate_debit_to_acc()
- self.validate_fixed_asset_account()
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
self.validate_advance_jv("Sales Order")
self.add_remarks()
self.validate_write_off_account()
+ self.set_income_account_for_fixed_assets()
if cint(self.is_pos):
self.validate_pos()
@@ -309,14 +310,6 @@
self.party_account_currency = account.account_currency
- def validate_fixed_asset_account(self):
- """Validate Fixed Asset and whether Income Account Entered Exists"""
- for d in self.get('items'):
- is_asset_item = frappe.db.get_value("Item", d.item_code, "is_asset_item")
- account_type = frappe.db.get_value("Account", d.income_account, "account_type")
- if is_asset_item == 1 and account_type != 'Fixed Asset':
- msgprint(_("Account {0} must be of type 'Fixed Asset' as Item {1} is an Asset Item").format(d.income_account, d.item_code), raise_exception=True)
-
def validate_with_previous_doc(self):
super(SalesInvoice, self).validate_with_previous_doc({
"Sales Order": {
@@ -456,6 +449,17 @@
msgprint(_("POS Profile required to make POS Entry"), raise_exception=True)
return warehouse
+
+ def set_income_account_for_fixed_assets(self):
+ disposal_account = None
+ for d in self.get("items"):
+ if frappe.db.get_value("Item", d.item_code, "is_fixed_asset"):
+ if not disposal_account:
+ disposal_account = frappe.db.get_value("Company", self.company, "disposal_account")
+ if not disposal_account:
+ frappe.throw(_("Please mention 'Gain/Loss Account on Asset Disposal' in Company"))
+
+ d.income_account = disposal_account
def on_update(self):
if cint(self.is_pos) == 1:
@@ -480,6 +484,13 @@
if d.delivery_note and frappe.db.get_value("Delivery Note", d.delivery_note, "docstatus") != 1:
throw(_("Delivery Note {0} is not submitted").format(d.delivery_note))
+
+ def validate_asset(self, asset, item_row):
+ super(SalesInvoice, self).validate_asset(asset, item_row)
+
+ if self.docstatus == 1 and asset.status in ("Scrapped", "Cancelled", "Sold"):
+ frappe.throw(_("Row #{0}: Asset {1} cannot be submitted, it is already {2}")
+ .format(item_row.idx, asset.name, asset.status))
def make_gl_entries(self, repost_future_gle=True):
gl_entries = self.get_gl_entries()
@@ -566,17 +577,31 @@
# income account gl entries
for item in self.get("items"):
if flt(item.base_net_amount):
- account_currency = get_account_currency(item.income_account)
- gl_entries.append(
- self.get_gl_dict({
- "account": item.income_account,
- "against": self.customer,
- "credit": item.base_net_amount,
- "credit_in_account_currency": item.base_net_amount \
- if account_currency==self.company_currency else item.net_amount,
- "cost_center": item.cost_center
- }, account_currency)
- )
+ if frappe.db.get_value("Item", item.item_code, "is_fixed_asset"):
+ if not item.asset:
+ frappe.throw(_("Row #{0}: Asset is mandatory against a Fixed Asset Item")
+ .format(item.idx))
+ else:
+ asset = frappe.get_doc("Asset", item.asset)
+ self.validate_asset(asset, item)
+
+ fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(asset, item.base_net_amount)
+ for gle in fixed_asset_gl_entries:
+ gl_entries.append(self.get_gl_dict(gle))
+
+ asset.set_status("Sold" if self.docstatus==1 else None)
+ else:
+ account_currency = get_account_currency(item.income_account)
+ gl_entries.append(
+ self.get_gl_dict({
+ "account": item.income_account,
+ "against": self.customer,
+ "credit": item.base_net_amount,
+ "credit_in_account_currency": item.base_net_amount \
+ if account_currency==self.company_currency else item.net_amount,
+ "cost_center": item.cost_center
+ }, account_currency)
+ )
# expense account gl entries
if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) \
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index fc8ca63..bac24d8 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -910,6 +910,19 @@
self.assertRaises(InvalidAccountCurrency, si5.submit)
+ def test_create_so_with_margin(self):
+ si = create_sales_invoice(item_code="_Test Item", qty=1, do_not_submit=True)
+ price_list_rate = si.items[0].price_list_rate
+ si.items[0].margin_type = 'Percentage'
+ si.items[0].margin_rate_or_amount = 25
+ si.insert()
+
+ self.assertNotEquals(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
+ si.items[0].margin_rate_or_amount = 25
+ si.submit()
+
+ self.assertNotEquals(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
+
def create_sales_invoice(**args):
si = frappe.new_doc("Sales Invoice")
args = frappe._dict(args)
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 79f5f55..a86d6a8 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -1,1458 +1,1671 @@
{
- "allow_copy": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "hash",
- "creation": "2013-06-04 11:02:19",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Document",
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "hash",
+ "creation": "2013-06-04 11:02:19",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "barcode",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Barcode",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Barcode",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "item_code",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "item_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Item Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_item_code",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer's Item Code",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_item_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer's Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Edit Description",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Edit Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Description",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "200px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "200px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "200px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_8",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_8",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "image_view",
- "fieldtype": "Image",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Image View",
- "length": 0,
- "no_copy": 0,
- "options": "image",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image View",
+ "length": 0,
+ "no_copy": 0,
+ "options": "image",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "image",
- "fieldtype": "Attach",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Image",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "qty",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Quantity",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Quantity",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Rate",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "price_list_rate",
- "fieldname": "discount_percentage",
- "fieldtype": "Percent",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Discount on Price List Rate (%)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "UOM",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "UOM",
- "length": 0,
- "no_copy": 0,
- "options": "UOM",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "base_ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "base_ref_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "discount_and_margin",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Discount and Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Percent",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Discount on Price List Rate (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Rate",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "export_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_19",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Amount",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "export_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "margin_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nPercentage\nAmount",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "margin_rate_or_amount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Rate or Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "total_margin",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "pricing_rule",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Pricing Rule",
- "length": 0,
- "no_copy": 0,
- "options": "Pricing Rule",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Rate",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "export_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break_21",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Amount",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "export_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "net_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Rate",
- "length": 0,
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "net_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Amount",
- "length": 0,
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_24",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_net_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Rate (Company Currency)",
- "length": 0,
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "pricing_rule",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Pricing Rule",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_net_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Amount (Company Currency)",
- "length": 0,
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_21",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "eval:doc.delivered_by_supplier==1",
- "fieldname": "drop_ship",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Drop Ship",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "net_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Rate",
+ "length": 0,
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivered_by_supplier",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivered By Supplier",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "net_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Amount",
+ "length": 0,
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "accounting",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Accounting Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_24",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "income_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Income Account",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "income_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "120px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_net_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Rate (Company Currency)",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_net_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Amount (Company Currency)",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:doc.delivered_by_supplier==1",
+ "fieldname": "drop_ship",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Drop Ship",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivered_by_supplier",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivered By Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "accounting",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounting Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "income_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "120px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "120px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Expense Account",
- "length": 0,
- "no_copy": 0,
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Expense Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "120px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": ":Company",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Cost Center",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "120px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "120px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "120px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Stock Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Stock Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Warehouse",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "target_warehouse",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 1,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer Warehouse (Optional)",
- "length": 0,
- "no_copy": 1,
- "options": "Warehouse",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "target_warehouse",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Warehouse (Optional)",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Warehouse",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Batch No",
- "length": 0,
- "no_copy": 0,
- "options": "Batch",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Batch No",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "brand",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Brand Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "brand",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "brand",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Brand Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "brand",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break5",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "actual_batch_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Available Batch Qty at Warehouse",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "150px",
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "actual_batch_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Available Batch Qty at Warehouse",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Available Qty at Warehouse",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Available Qty at Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "edit_references",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "References",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "edit_references",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "References",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "time_log_batch",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Time Log Batch",
- "length": 0,
- "no_copy": 0,
- "options": "Time Log Batch",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "time_log_batch",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Time Log Batch",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Time Log Batch",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_order",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Sales Order",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "sales_order",
- "oldfieldtype": "Link",
- "options": "Sales Order",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "sales_order",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Sales Order",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "sales_order",
+ "oldfieldtype": "Link",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "so_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Sales Order Item",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "so_detail",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "so_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Sales Order Item",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "so_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_50",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_50",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_note",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Delivery Note",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "delivery_note",
- "oldfieldtype": "Link",
- "options": "Delivery Note",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_note",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Delivery Note",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "delivery_note",
+ "oldfieldtype": "Link",
+ "options": "Delivery Note",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "dn_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Delivery Note Item",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "dn_detail",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "dn_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Delivery Note Item",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "dn_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivered_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivered Qty",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "delivered_qty",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivered_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivered Qty",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "delivered_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break_54",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "asset",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Asset",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "page_break",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Page Break",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_54",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Page Break",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2016-02-01 11:16:58.288462",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Sales Invoice Item",
- "owner": "Administrator",
- "permissions": [],
- "read_only": 0,
- "read_only_onload": 0,
- "sort_field": "modified",
- "sort_order": "DESC"
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-03-29 11:09:35.263924",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Item",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 7e64ea3..222682e 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -60,6 +60,9 @@
chart_area.get(0), wrapper.page);
})
+ if(frappe.defaults.get_default('company')) {
+ wrapper.$company_select.val(frappe.defaults.get_default('company'));
+ }
wrapper.$company_select.change();
}
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 2101a25..d348715 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -16,7 +16,7 @@
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None,
- posting_date=None, price_list=None, currency=None, doctype=None):
+ posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
if not party:
return {}
@@ -25,7 +25,7 @@
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
- company, posting_date, price_list, currency, doctype)
+ company, posting_date, price_list, currency, doctype, ignore_permissions)
def _get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
@@ -227,10 +227,16 @@
party_account_currency = frappe.db.get_value("Account", account.account, "account_currency")
existing_gle_currency = get_party_gle_currency(doc.doctype, doc.name, account.company)
+ company_default_currency = frappe.db.get_value("Company",
+ frappe.db.get_default("Company"), "default_currency", cache=True)
if existing_gle_currency and party_account_currency != existing_gle_currency:
frappe.throw(_("Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.").format(existing_gle_currency, account.company))
+ if doc.default_currency and party_account_currency and company_default_currency:
+ if doc.default_currency != party_account_currency and doc.default_currency != company_default_currency:
+ frappe.throw(_("Billing currency must be equal to either default comapany's currency or party's payble account currency"))
+
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company):
"""Set Due Date = Posting Date + Credit Days"""
@@ -317,8 +323,15 @@
if party_type and party_name:
party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
if party.disabled:
- frappe.throw("{0} {1} is disabled".format(party_type, party_name), PartyDisabled)
+ frappe.throw(_("{0} {1} is disabled").format(party_type, party_name), PartyDisabled)
elif party.is_frozen:
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
if not frozen_accounts_modifier in frappe.get_roles():
- frappe.throw("{0} {1} is frozen".format(party_type, party_name), PartyFrozen)
+ frappe.throw(_("{0} {1} is frozen").format(party_type, party_name), PartyFrozen)
+
+def get_timeline_data(doctype, name):
+ '''returns timeline data for the past one year'''
+ from frappe.desk.form.load import get_communication_data
+ data = get_communication_data(doctype, name, fields = 'unix_timestamp(date(creation)), count(name)',
+ group_by='group by date(creation)', as_dict=False)
+ return dict(data)
\ No newline at end of file
diff --git a/erpnext/accounts/party_status.py b/erpnext/accounts/party_status.py
new file mode 100644
index 0000000..ff095b1
--- /dev/null
+++ b/erpnext/accounts/party_status.py
@@ -0,0 +1,80 @@
+# Copyright (c) 2015, Frappe 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 evaluate_filters
+from frappe.desk.notifications import get_filters_for
+
+# NOTE: if you change this also update triggers in erpnext/hooks.py
+status_depends_on = {
+ 'Customer': ('Opportunity', 'Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice', 'Project', 'Issue'),
+ 'Supplier': ('Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice')
+}
+
+default_status = {
+ 'Customer': 'Active',
+ 'Supplier': None
+}
+
+def notify_status(doc, method):
+ '''Notify status to customer, supplier'''
+
+ party_type = None
+ for key, doctypes in status_depends_on.iteritems():
+ if doc.doctype in doctypes:
+ party_type = key
+ break
+
+ if not party_type:
+ return
+
+ name = doc.get(party_type.lower())
+ if not name:
+ return
+
+ party = frappe.get_doc(party_type, name)
+ filters = get_filters_for(doc.doctype)
+
+ status = None
+ if filters:
+ if evaluate_filters(doc, filters):
+ # filters match, passed document is open
+ status = 'Open'
+
+ if status=='Open':
+ if party.status != 'Open':
+ # party not open, make it open
+ party.status = 'Open'
+ party.save(ignore_permissions=True)
+
+ else:
+ if party.status == 'Open':
+ # may be open elsewhere, check
+ # default status
+ party.status = status
+ update_status(party)
+
+ party.update_modified()
+
+def get_party_status(doc):
+ '''return party status based on open documents'''
+ status = default_status[doc.doctype]
+ for doctype in status_depends_on[doc.doctype]:
+ filters = get_filters_for(doctype)
+ filters[doc.doctype.lower()] = doc.name
+ if filters:
+ open_count = frappe.get_all(doctype, fields='name', filters=filters, limit_page_length=1)
+ if len(open_count) > 0:
+ status = 'Open'
+ break
+
+ return status
+
+def update_status(doc):
+ '''Set status as open if there is any open notification'''
+ status = get_party_status(doc)
+ if doc.status != status:
+ doc.db_set('status', status)
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py
index 7e05b95..1f60f8f 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.py
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py
@@ -9,24 +9,26 @@
def execute(filters=None):
period_list = get_period_list(filters.fiscal_year, filters.periodicity)
-
+
asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
liability = get_data(filters.company, "Liability", "Credit", period_list, only_current_fiscal_year=False)
equity = get_data(filters.company, "Equity", "Credit", period_list, only_current_fiscal_year=False)
-
- provisional_profit_loss = get_provisional_profit_loss(asset, liability, equity,
+
+ provisional_profit_loss = get_provisional_profit_loss(asset, liability, equity,
period_list, filters.company)
+ message = check_opening_balance(asset, liability, equity)
+
data = []
data.extend(asset or [])
- data.extend(liability or [])
+ data.extend(liability or [])
data.extend(equity or [])
if provisional_profit_loss:
data.append(provisional_profit_loss)
columns = get_columns(filters.periodicity, period_list, company=filters.company)
- return columns, data
+ return columns, data, message
def get_provisional_profit_loss(asset, liability, equity, period_list, company):
if asset and (liability or equity):
@@ -51,9 +53,20 @@
if provisional_profit_loss[period.key]:
has_value = True
-
+
total += flt(provisional_profit_loss[period.key])
provisional_profit_loss["total"] = total
if has_value:
return provisional_profit_loss
+
+def check_opening_balance(asset, liability, equity):
+ # Check if previous year balance sheet closed
+ opening_balance = flt(asset[0].get("opening_balance", 0))
+ if liability:
+ opening_balance -= flt(liability[0].get("opening_balance", 0))
+ if equity:
+ opening_balance -= flt(asset[0].get("opening_balance", 0))
+
+ if opening_balance:
+ return _("Previous Financial Year is not closed")
\ No newline at end of file
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 3e70a0e..1a59a9d 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -125,14 +125,20 @@
if entry.posting_date <= period.to_date:
if accumulated_values or entry.posting_date >= period.from_date:
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
+
+ if entry.posting_date < period_list[0].year_start_date:
+ d["opening_balance"] = d.get("opening_balance", 0.0) + flt(entry.debit) - flt(entry.credit)
def accumulate_values_into_parents(accounts, accounts_by_name, period_list, accumulated_values):
"""accumulate children's values in parent accounts"""
for d in reversed(accounts):
if d.parent_account:
for period in period_list:
- accounts_by_name[d.parent_account][period.key] = accounts_by_name[d.parent_account].get(period.key, 0.0) + \
- d.get(period.key, 0.0)
+ accounts_by_name[d.parent_account][period.key] = \
+ accounts_by_name[d.parent_account].get(period.key, 0.0) + d.get(period.key, 0.0)
+
+ accounts_by_name[d.parent_account]["opening_balance"] = \
+ accounts_by_name[d.parent_account].get("opening_balance", 0.0) + d.get("opening_balance", 0.0)
def prepare_data(accounts, balance_must_be, period_list, company_currency):
data = []
@@ -150,13 +156,14 @@
"indent": flt(d.indent),
"year_start_date": year_start_date,
"year_end_date": year_end_date,
- "currency": company_currency
+ "currency": company_currency,
+ "opening_balance": d.get("opening_balance", 0.0) * (1 if balance_must_be=="Debit" else -1)
})
for period in period_list:
- if d.get(period.key):
+ if d.get(period.key) and balance_must_be=="Credit":
# change sign based on Debit or Credit, since calculation is done using (debit - credit)
- d[period.key] *= (1 if balance_must_be=="Debit" else -1)
-
+ d[period.key] *= -1
+
row[period.key] = flt(d.get(period.key, 0.0), 3)
if abs(row[period.key]) >= 0.005:
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index df63e29..be704e9 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -69,7 +69,7 @@
frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
# validate purchase item
- if not (obj.doctype=="Material Request" and getattr(obj, "material_request_type", None)=="Material Transfer"):
+ if obj.doctype=="Material Request" and getattr(obj, "material_request_type", None)=="Purchase":
if item.is_purchase_item != 1 and item.is_sub_contracted_item != 1:
frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 617beff..b6026fd 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -47,7 +47,7 @@
if(is_drop_ship && doc.status!="Delivered"){
cur_frm.add_custom_button(__('Delivered'),
- this.delivered_by_supplier, __("Status"));
+ this.delivered_by_supplier, __("Status"));
cur_frm.page.set_inner_btn_group_as_primary(__("Status"));
}
@@ -61,7 +61,7 @@
}
}
- if(doc.docstatus == 1 && doc.status != "Closed") {
+ if(doc.docstatus == 1 && !in_list(["Closed", "Completed"], doc.status)) {
if(flt(doc.per_received, 2) < 100 && allow_receipt) {
cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt, __("Make"));
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 2b4b989..d259cd3 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -51,7 +51,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -169,7 +169,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "supplier_name",
"fieldtype": "Data",
@@ -353,7 +353,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "customer_name",
@@ -1002,7 +1002,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -1829,7 +1829,7 @@
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -2686,14 +2686,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 105,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-21 13:13:07.334625",
+ "modified": "2016-04-06 05:39:44.569515",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
@@ -2765,26 +2765,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Supplier",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -2806,5 +2786,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "supplier",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 5dd59e8..924a7bd 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -103,10 +103,7 @@
d.price_list_rate = d.base_price_list_rate / conversion_rate
d.rate = d.base_rate / conversion_rate
else:
- # if no last purchase found, reset all values to 0
- for field in ("base_price_list_rate", "base_rate",
- "price_list_rate", "rate", "discount_percentage"):
- d.set(field, 0)
+ msgprint(_("Last purchase rate not found"))
item_last_purchase_rate = frappe.db.get_value("Item", d.item_code, "last_purchase_rate")
if item_last_purchase_rate:
diff --git a/erpnext/buying/doctype/request_for_quotation/__init__.py b/erpnext/buying/doctype/request_for_quotation/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation/__init__.py
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
new file mode 100644
index 0000000..a072bd7
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -0,0 +1,106 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+
+frappe.require("assets/erpnext/js/utils.js");
+
+frappe.ui.form.on("Request for Quotation",{
+ setup: function(frm){
+ frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function(doc, cdt, cdn){
+ var d =locals[cdt][cdn];
+ return {
+ filters: {'supplier': d.supplier}
+ }
+ }
+ },
+
+ onload: function(frm){
+ frm.add_fetch('standard_reply', 'response', 'response');
+
+ if(!frm.doc.message_for_supplier) {
+ frm.set_value("message_for_supplier", __("Please supply the specified items at the best possible rates"))
+ }
+ },
+
+ refresh: function(frm, cdt, cdn){
+ if (frm.doc.docstatus === 1) {
+ frm.add_custom_button(__("Make Supplier Quotation"),
+ function(){ frm.trigger("make_suppplier_quotation") });
+
+ frm.add_custom_button(__("Send Supplier Emails"), function() {
+ frappe.call({
+ method: 'erpnext.buying.doctype.request_for_quotation.request_for_quotation.send_supplier_emails',
+ freeze: true,
+ args: {
+ rfq_name: frm.doc.name
+ }
+ });
+ });
+ }
+ },
+
+ make_suppplier_quotation: function(frm){
+ var doc = frm.doc;
+ var dialog = new frappe.ui.Dialog({
+ title: __("For Supplier"),
+ fields: [
+ {"fieldtype": "Select", "label": __("Supplier"),
+ "fieldname": "supplier", "options":"Supplier",
+ "options": $.map(doc.suppliers,
+ function(d) { return d.supplier }), "reqd": 1 },
+ {"fieldtype": "Button", "label": __("Make Supplier Quotation"),
+ "fieldname": "make_supplier_quotation", "cssClass": "btn-primary"},
+ ]
+ });
+
+ dialog.fields_dict.make_supplier_quotation.$input.click(function() {
+ args = dialog.get_values();
+ if(!args) return;
+ dialog.hide();
+ return frappe.call({
+ type: "GET",
+ method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.make_supplier_quotation",
+ args: {
+ "source_name": doc.name,
+ "for_supplier": args.supplier
+ },
+ freeze: true,
+ callback: function(r) {
+ if(!r.exc) {
+ var doc = frappe.model.sync(r.message);
+ frappe.set_route("Form", r.message.doctype, r.message.name);
+ }
+ }
+ });
+ });
+ dialog.show()
+ }
+})
+
+frappe.ui.form.on("Request for Quotation Supplier",{
+ supplier: function(frm, cdt, cdn){
+ var d = locals[cdt][cdn]
+ frappe.model.set_value(cdt, cdn, 'contact', '')
+ frappe.model.set_value(cdt, cdn, 'email_id', '')
+ }
+})
+
+erpnext.buying.RequestforQuotationController = erpnext.buying.BuyingController.extend({
+ refresh: function() {
+ this._super();
+ },
+
+ calculate_taxes_and_totals: function() {
+ return;
+ },
+
+ tc_name: function() {
+ this.get_terms();
+ }
+});
+
+
+// for backward compatibility: combine new and previous states
+$.extend(cur_frm.cscript, new erpnext.buying.RequestforQuotationController({frm: cur_frm}));
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
new file mode 100644
index 0000000..7f1988a
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
@@ -0,0 +1,768 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2016-02-25 01:24:07.224790",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "RFQ-",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Date",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "suppliers_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "suppliers",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier Detail",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Request for Quotation Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Items",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "po_details",
+ "oldfieldtype": "Table",
+ "options": "Request for Quotation Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier_response_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "standard_reply",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Standard Reply",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Standard Reply",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "message_for_supplier",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Message for Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "terms",
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms and Conditions",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms and Conditions",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "printing_settings",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Printing Settings",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Heading",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Letter Head",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nCancelled",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Fiscal Year",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Request for Quotation",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-shopping-cart",
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-03-29 06:18:26.398938",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Request for Quotation",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Supplier",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Purchase Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "All",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "read_only": 0,
+ "read_only_onload": 1,
+ "search_fields": "status, transaction_date",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "timeline_field": "",
+ "title_field": "",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
new file mode 100644
index 0000000..4defbbb
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -0,0 +1,189 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, json
+from frappe import _
+from frappe.model.mapper import get_mapped_doc
+from frappe.utils import get_url, random_string
+from frappe.utils.user import get_user_fullname
+from erpnext.accounts.party import get_party_account_currency, get_party_details
+from erpnext.stock.doctype.material_request.material_request import set_missing_values
+from erpnext.controllers.buying_controller import BuyingController
+
+STANDARD_USERS = ("Guest", "Administrator")
+
+class RequestforQuotation(BuyingController):
+ def validate(self):
+ self.validate_duplicate_supplier()
+ self.validate_common()
+
+ def validate_duplicate_supplier(self):
+ supplier_list = [d.supplier for d in self.suppliers]
+ if len(supplier_list) != len(set(supplier_list)):
+ frappe.throw(_("Same supplier has been entered multiple times"))
+
+ def validate_common(self):
+ pc = frappe.get_doc('Purchase Common')
+ pc.validate_for_items(self)
+
+ def on_submit(self):
+ frappe.db.set(self, 'status', 'Submitted')
+
+ def on_cancel(self):
+ frappe.db.set(self, 'status', 'Cancelled')
+
+ def send_to_supplier(self):
+ link = get_url("/rfq/" + self.name)
+ for rfq_supplier in self.suppliers:
+ if rfq_supplier.email_id and rfq_supplier.send_email_to_supplier:
+
+ # make new user if required
+ update_password_link = self.create_supplier_user(rfq_supplier, link)
+
+ self.supplier_rfq_mail(rfq_supplier, update_password_link, link)
+
+ def create_supplier_user(self, rfq_supplier, link):
+ '''Create a new user for the supplier if not set in contact'''
+ update_password_link = ''
+
+ contact = frappe.get_doc("Contact", rfq_supplier.contact)
+ if not contact.user:
+ if frappe.db.exists("User", rfq_supplier.email_id):
+ user = frappe.get_doc("User", rfq_supplier.email_id)
+ else:
+ user, update_password_link = self.create_user(rfq_supplier, link)
+
+ # set user_id in contact
+ contact = frappe.get_doc('Contact', rfq_supplier.contact)
+ contact.user = user.name
+ contact.save()
+
+ return update_password_link
+
+ def create_user(self, rfq_supplier, link):
+ user = frappe.get_doc({
+ 'doctype': 'User',
+ 'send_welcome_email': 0,
+ 'email': rfq_supplier.email_id,
+ 'first_name': rfq_supplier.supplier_name,
+ 'user_type': 'Website User'
+ })
+
+ # reset password
+ key = random_string(32)
+ update_password_link = get_url("/update-password?key=" + key)
+ user.reset_password_key = key
+ user.redirect_url = link
+ user.save(ignore_permissions=True)
+
+ return user, update_password_link
+
+ def supplier_rfq_mail(self, data, update_password_link, rfq_link):
+ full_name = get_user_fullname(frappe.session['user'])
+ if full_name == "Guest":
+ full_name = "Administrator"
+
+ args = {
+ 'update_password_link': update_password_link,
+ 'message': frappe.render_template(self.message_for_supplier, data.as_dict()),
+ 'rfq_link': rfq_link,
+ 'user_fullname': full_name
+ }
+
+ subject = _("Request for Quotation")
+ template = "templates/emails/request_for_quotation.html"
+ sender = frappe.session.user not in STANDARD_USERS and frappe.session.user or None
+
+ frappe.sendmail(recipients=data.email_id, sender=sender, subject=subject,
+ message=frappe.get_template(template).render(args),
+ attachments = [frappe.attach_print('Request for Quotation', self.name)],as_bulk=True)
+ frappe.msgprint(_("Email sent to supplier {0}").format(data.supplier))
+
+@frappe.whitelist()
+def send_supplier_emails(rfq_name):
+ rfq = frappe.get_doc("Request for Quotation", rfq_name)
+ if rfq.docstatus==1:
+ rfq.send_to_supplier()
+
+
+def get_list_context(context=None):
+ from erpnext.controllers.website_list_for_contact import get_list_context
+ list_context = get_list_context(context)
+ return list_context
+
+
+# This method is used to make supplier quotation from material request form.
+@frappe.whitelist()
+def make_supplier_quotation(source_name, for_supplier, target_doc=None):
+ def postprocess(source, target_doc):
+ target_doc.supplier = for_supplier
+ args = get_party_details(for_supplier, party_type="Supplier", ignore_permissions=True)
+ target_doc.currency = args.currency or get_party_account_currency('Supplier', for_supplier, source.company)
+ target_doc.buying_price_list = args.buying_price_list or frappe.db.get_value('Buying Settings', None, 'buying_price_list')
+ set_missing_values(source, target_doc)
+
+ doclist = get_mapped_doc("Request for Quotation", source_name, {
+ "Request for Quotation": {
+ "doctype": "Supplier Quotation",
+ "validation": {
+ "docstatus": ["=", 1]
+ }
+ },
+ "Request for Quotation Item": {
+ "doctype": "Supplier Quotation Item",
+ "field_map": [
+ ["name", "request_for_quotation_item"],
+ ["parent", "request_for_quotation"],
+ ["uom", "uom"]
+ ],
+ }
+ }, target_doc, postprocess)
+
+ return doclist
+
+# This method is used to make supplier quotation from supplier's portal.
+@frappe.whitelist()
+def create_supplier_quotation(doc):
+ if isinstance(doc, basestring):
+ doc = json.loads(doc)
+
+ try:
+ sq_doc = frappe.get_doc({
+ "doctype": "Supplier Quotation",
+ "supplier": doc.get('supplier'),
+ "terms": doc.get("terms"),
+ "company": doc.get("company"),
+ "currency": doc.get('currency') or get_party_account_currency('Supplier', doc.get('supplier'), doc.get('company')),
+ "buying_price_list": doc.get('buying_price_list') or frappe.db.get_value('Buying Settings', None, 'buying_price_list')
+ })
+ add_items(sq_doc, doc.get('supplier'), doc.get('items'))
+ sq_doc.flags.ignore_permissions = True
+ sq_doc.run_method("set_missing_values")
+ sq_doc.save()
+ frappe.msgprint(_("Supplier Quotation {0} created").format(sq_doc.name))
+ return sq_doc.name
+ except Exception:
+ return
+
+def add_items(sq_doc, supplier, items):
+ for data in items:
+ if data.get("qty") > 0:
+ if isinstance(data, dict):
+ data = frappe._dict(data)
+
+ create_rfq_items(sq_doc, supplier, data)
+
+def create_rfq_items(sq_doc, supplier, data):
+ sq_doc.append('items', {
+ "item_code": data.item_code,
+ "item_name": data.item_name,
+ "description": data.description,
+ "qty": data.qty,
+ "rate": data.rate,
+ "supplier_part_no": frappe.db.get_value("Item Supplier", {'parent': data.item_code, 'supplier': supplier}, "supplier_part_no"),
+ "warehouse": data.warehouse or '',
+ "request_for_quotation_item": data.name,
+ "request_for_quotation": data.parent
+ })
diff --git a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py
new file mode 100644
index 0000000..4f205c5
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+from frappe.utils import nowdate
+
+class TestRequestforQuotation(unittest.TestCase):
+ def test_make_supplier_quotation(self):
+ from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation
+ rfq = make_request_for_quotation()
+
+ sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier)
+ sq.submit()
+
+ sq1 = make_supplier_quotation(rfq.name, rfq.get('suppliers')[1].supplier)
+ sq1.submit()
+
+ self.assertEquals(sq.supplier, rfq.get('suppliers')[0].supplier)
+ self.assertEquals(sq.get('items')[0].request_for_quotation, rfq.name)
+ self.assertEquals(sq.get('items')[0].item_code, "_Test Item")
+ self.assertEquals(sq.get('items')[0].qty, 5)
+
+ self.assertEquals(sq1.supplier, rfq.get('suppliers')[1].supplier)
+ self.assertEquals(sq1.get('items')[0].request_for_quotation, rfq.name)
+ self.assertEquals(sq1.get('items')[0].item_code, "_Test Item")
+ self.assertEquals(sq1.get('items')[0].qty, 5)
+
+ def test_make_supplier_quotation_from_portal(self):
+ from erpnext.buying.doctype.request_for_quotation.request_for_quotation import create_supplier_quotation
+ rfq = make_request_for_quotation()
+ rfq.get('items')[0].rate = 100
+ rfq.supplier = rfq.suppliers[0].supplier
+ supplier_quotation_name = create_supplier_quotation(rfq)
+
+ supplier_quotation_doc = frappe.get_doc('Supplier Quotation', supplier_quotation_name)
+
+ self.assertEquals(supplier_quotation_doc.supplier, rfq.get('suppliers')[0].supplier)
+ self.assertEquals(supplier_quotation_doc.get('items')[0].request_for_quotation, rfq.name)
+ self.assertEquals(supplier_quotation_doc.get('items')[0].item_code, "_Test Item")
+ self.assertEquals(supplier_quotation_doc.get('items')[0].qty, 5)
+ self.assertEquals(supplier_quotation_doc.get('items')[0].amount, 500)
+
+
+def make_request_for_quotation():
+ supplier_data = get_supplier_data()
+ rfq = frappe.new_doc('Request for Quotation')
+ rfq.transaction_date = nowdate()
+ rfq.status = 'Draft'
+ rfq.company = '_Test Company'
+ rfq.message_for_supplier = 'Please supply the specified items at the best possible rates.'
+
+ for data in supplier_data:
+ rfq.append('suppliers', data)
+
+ rfq.append("items", {
+ "item_code": "_Test Item",
+ "description": "_Test Item",
+ "uom": "_Test UOM",
+ "qty": 5,
+ "warehouse": "_Test Warehouse - _TC",
+ "schedule_date": nowdate()
+ })
+
+ rfq.submit()
+
+ return rfq
+
+def get_supplier_data():
+ return [{
+ "supplier": "_Test Supplier",
+ "supplier_name": "_Test Supplier"
+ },
+ {
+ "supplier": "_Test Supplier 1",
+ "supplier_name": "_Test Supplier 1"
+ }]
diff --git a/erpnext/buying/doctype/request_for_quotation_item/__init__.py b/erpnext/buying/doctype/request_for_quotation_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_item/__init__.py
diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
new file mode 100644
index 0000000..2892e3b
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
@@ -0,0 +1,614 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "hash",
+ "creation": "2016-02-25 08:04:02.452958",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "300px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image View",
+ "length": 0,
+ "no_copy": 0,
+ "options": "image",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "quantity",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Quantity",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Quantity",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "60px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "60px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Today",
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Required Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "UOM",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "material_request",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Material Request",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Material Request",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "material_request_item",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Material Request Item",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Brand",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Page Break",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-03-29 05:28:39.203232",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Request for Quotation Item",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py
new file mode 100644
index 0000000..cc897af
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class RequestforQuotationItem(Document):
+ pass
diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/__init__.py b/erpnext/buying/doctype/request_for_quotation_supplier/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_supplier/__init__.py
diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
new file mode 100644
index 0000000..f78e5e2
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
@@ -0,0 +1,188 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2016-03-29 05:59:11.896885",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Contact",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Contact",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "1",
+ "description": "",
+ "fieldname": "send_email_to_supplier",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Send Email to Supplier",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "supplier_name",
+ "fieldtype": "Read Only",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Supplier Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "supplier.supplier_name",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "email_id",
+ "fieldtype": "Read Only",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Email Id",
+ "length": 0,
+ "no_copy": 1,
+ "options": "contact.email_id",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-04-06 05:39:47.516470",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Request for Quotation Supplier",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py
new file mode 100644
index 0000000..4b0bbbe
--- /dev/null
+++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class RequestforQuotationSupplier(Document):
+ pass
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index 95a1aff..0b8b8ef 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -3,10 +3,11 @@
frappe.ui.form.on("Supplier", {
before_load: function(frm) {
+ frm.hide_first = true;
frappe.setup_language_field(frm);
},
refresh: function(frm) {
- frm.cscript.make_dashboard(frm.doc);
+ frm.dashboard.show_links();
if(frappe.defaults.get_default("supp_master_name")!="Naming Series") {
frm.toggle_display("naming_series", false);
@@ -26,55 +27,23 @@
frm.events.add_custom_buttons(frm);
},
add_custom_buttons: function(frm) {
- ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"].forEach(function(doctype, i) {
- if(frappe.model.can_read(doctype)) {
- frm.add_custom_button(__(doctype), function() {
- frappe.route_options = {"supplier": frm.doc.name};
- frappe.set_route("List", doctype);
- }, __("View"));
- }
- if(frappe.model.can_create(doctype)) {
- frm.add_custom_button(__(doctype), function() {
- frappe.route_options = {"supplier": frm.doc.name};
- new_doc(doctype);
- }, __("Make"));
- }
- });
+ // ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"].forEach(function(doctype, i) {
+ // if(frappe.model.can_read(doctype)) {
+ // frm.add_custom_button(__(doctype), function() {
+ // frappe.route_options = {"supplier": frm.doc.name};
+ // frappe.set_route("List", doctype);
+ // }, __("View"));
+ // }
+ // if(frappe.model.can_create(doctype)) {
+ // frm.add_custom_button(__(doctype), function() {
+ // frappe.route_options = {"supplier": frm.doc.name};
+ // new_doc(doctype);
+ // }, __("Make"));
+ // }
+ // });
},
});
-cur_frm.cscript.make_dashboard = function(doc) {
- cur_frm.dashboard.reset();
- if(doc.__islocal)
- return;
- if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager"))
- cur_frm.dashboard.set_headline('<span class="text-muted">' + __('Loading') + '</span>')
-
- cur_frm.dashboard.add_doctype_badge("Supplier Quotation", "supplier");
- cur_frm.dashboard.add_doctype_badge("Purchase Order", "supplier");
- cur_frm.dashboard.add_doctype_badge("Purchase Receipt", "supplier");
- cur_frm.dashboard.add_doctype_badge("Purchase Invoice", "supplier");
-
- return frappe.call({
- type: "GET",
- method: "erpnext.buying.doctype.supplier.supplier.get_dashboard_info",
- args: {
- supplier: cur_frm.doc.name
- },
- callback: function(r) {
- if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
- cur_frm.dashboard.set_headline(
- __("Total billing this year") + ": <b>"
- + format_currency(r.message.billing_this_year, cur_frm.doc.party_account_currency)
- + '</b> / <span class="text-muted">' + __("Total Unpaid") + ": <b>"
- + format_currency(r.message.total_unpaid, cur_frm.doc.party_account_currency)
- + '</b></span>');
- }
- cur_frm.dashboard.set_badge_count(r.message);
- }
- })
-}
-
cur_frm.fields_dict['default_price_list'].get_query = function(doc, cdt, cdn) {
return{
filters:{'buying': 1}
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 3542c9e..26a2c98 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -18,9 +18,10 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "",
+ "label": "Name and Type",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
@@ -43,6 +44,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -63,12 +65,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "supplier_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Name",
@@ -90,10 +93,62 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nOpen",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -117,6 +172,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Supplier Type",
@@ -137,6 +193,32 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "language",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Language",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Loading...",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"default": "0",
@@ -144,6 +226,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
@@ -163,13 +246,15 @@
{
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 0,
+ "collapsible": 1,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
+ "label": "Currency and Price List",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -191,6 +276,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billing Currency",
@@ -211,10 +297,35 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "default_price_list",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price List",
@@ -234,59 +345,12 @@
{
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_10",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "language",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Print Language",
- "length": 0,
- "no_copy": 0,
- "options": "Loading...",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
"collapsible": 1,
"fieldname": "section_credit_limit",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Limit",
@@ -311,6 +375,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Days Based On",
@@ -337,6 +402,7 @@
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Days",
@@ -361,6 +427,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address and Contacts",
@@ -386,6 +453,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address HTML",
@@ -409,6 +477,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -432,6 +501,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact HTML",
@@ -456,6 +526,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Payable Accounts",
@@ -481,6 +552,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Accounts",
@@ -506,6 +578,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -530,6 +603,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Website",
@@ -556,6 +630,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Details",
@@ -581,6 +656,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Frozen",
@@ -601,14 +677,15 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-user",
- "idx": 1,
+ "idx": 370,
+ "image_field": "image",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-22 16:50:55.710869",
+ "modified": "2016-04-13 05:47:43.797061",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
@@ -759,5 +836,6 @@
"read_only_onload": 0,
"search_fields": "supplier_name, supplier_type",
"sort_order": "ASC",
- "title_field": "supplier_name"
-}
+ "title_field": "supplier_name",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index f010626..9a3d58c 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -8,7 +8,8 @@
from frappe.model.naming import make_autoname
from erpnext.utilities.address_and_contact import load_address_and_contact
from erpnext.utilities.transaction_base import TransactionBase
-from erpnext.accounts.party import validate_party_accounts
+from erpnext.accounts.party import validate_party_accounts, get_timeline_data
+from erpnext.accounts.party_status import get_party_status
class Supplier(TransactionBase):
def get_feed(self):
@@ -17,6 +18,7 @@
def onload(self):
"""Load address and contacts in `__onload`"""
load_address_and_contact(self, "supplier")
+ self.set_onload('links', self.meta.get_links_setup())
def autoname(self):
supp_master_name = frappe.defaults.get_global_default('supp_master_name')
@@ -47,6 +49,7 @@
msgprint(_("Series is mandatory"), raise_exception=1)
validate_party_accounts(self)
+ self.status = get_party_status(self)
def get_contacts(self,nm):
if nm:
@@ -83,29 +86,12 @@
.format(set_field=set_field), ({"newdn": newdn}))
@frappe.whitelist()
-def get_dashboard_info(supplier):
- if not frappe.has_permission("Supplier", "read", supplier):
- frappe.throw(_("No permission"))
+def get_dashboard_data(name):
+ '''load dashboard related data'''
+ frappe.has_permission(doc=frappe.get_doc('Supplier', name), throw=True)
- out = {}
- for doctype in ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"]:
- out[doctype] = frappe.db.get_value(doctype,
- {"supplier": supplier, "docstatus": ["!=", 2] }, "count(*)")
-
- billing_this_year = frappe.db.sql("""
- select sum(credit_in_account_currency) - sum(debit_in_account_currency)
- from `tabGL Entry`
- where voucher_type='Purchase Invoice' and party_type = 'Supplier'
- and party=%s and fiscal_year = %s""",
- (supplier, frappe.db.get_default("fiscal_year")))
-
- total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
- from `tabPurchase Invoice`
- where supplier=%s and docstatus = 1""", supplier)
-
-
- out["billing_this_year"] = billing_this_year[0][0] if billing_this_year else 0
- out["total_unpaid"] = total_unpaid[0][0] if total_unpaid else 0
- out["company_currency"] = frappe.db.sql_list("select distinct default_currency from tabCompany")
-
- return out
+ from frappe.desk.notifications import get_open_count
+ return {
+ 'count': get_open_count('Supplier', name),
+ 'timeline_data': get_timeline_data('Supplier', name),
+ }
diff --git a/erpnext/buying/doctype/supplier/supplier_links.py b/erpnext/buying/doctype/supplier/supplier_links.py
new file mode 100644
index 0000000..10cf3fa
--- /dev/null
+++ b/erpnext/buying/doctype/supplier/supplier_links.py
@@ -0,0 +1,15 @@
+from frappe import _
+
+links = {
+ 'fieldname': 'supplier',
+ 'transactions': [
+ {
+ 'label': _('Procurement'),
+ 'items': ['Request for Quotation', 'Supplier Quotation']
+ },
+ {
+ 'label': _('Orders'),
+ 'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier/supplier_list.js b/erpnext/buying/doctype/supplier/supplier_list.js
index d26932c..acf8e68 100644
--- a/erpnext/buying/doctype/supplier/supplier_list.js
+++ b/erpnext/buying/doctype/supplier/supplier_list.js
@@ -1,3 +1,8 @@
frappe.listview_settings['Supplier'] = {
- add_fields: ["supplier_name", "supplier_type"]
+ add_fields: ["supplier_name", "supplier_type", 'status'],
+ get_indicator: function(doc) {
+ if(doc.status==="Open") {
+ return [doc.status, "red", "status,=," + doc.status];
+ }
+ }
};
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 6466643..f8c5935 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -51,7 +51,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
@@ -117,7 +117,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "supplier_name",
"fieldtype": "Data",
@@ -672,7 +672,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -1473,7 +1473,7 @@
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -1772,7 +1772,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-shopping-cart",
- "idx": 1,
+ "idx": 29,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -1780,7 +1780,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-16 15:36:05.481917",
+ "modified": "2016-04-06 05:39:45.107820",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
@@ -1872,19 +1872,19 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
+ "email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
- "permlevel": 0,
- "print": 1,
+ "permlevel": 1,
+ "print": 0,
"read": 1,
- "report": 1,
- "role": "Supplier",
+ "report": 0,
+ "role": "Purchase Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
- "write": 0
+ "write": 1
},
{
"amend": 0,
@@ -1900,11 +1900,11 @@
"print": 0,
"read": 1,
"report": 0,
- "role": "Purchase Manager",
+ "role": "All",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
- "write": 1
+ "write": 0
}
],
"read_only": 0,
@@ -1913,5 +1913,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "supplier",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
index b09667b..1275fcd 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
@@ -883,6 +883,32 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "request_for_quotation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Request for Quotation",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Request for Quotation",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "col_break4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -932,6 +958,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "request_for_quotation_item",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Request for Quotation Item",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "brand",
"fieldtype": "Link",
"hidden": 0,
@@ -1046,7 +1097,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-03-18 05:15:03.936587",
+ "modified": "2016-03-25 17:01:59.632826",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index bbc8671..3d6fb54 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -83,6 +83,14 @@
"type": "doctype",
"name": "Item",
},
+ {
+ "type": "doctype",
+ "name": "Asset",
+ },
+ {
+ "type": "doctype",
+ "name": "Asset Category",
+ }
]
},
{
diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py
index c259f06..0dc51f6 100644
--- a/erpnext/config/buying.py
+++ b/erpnext/config/buying.py
@@ -14,6 +14,11 @@
},
{
"type": "doctype",
+ "name": "Request for Quotation",
+ "description": _("Request for quotation."),
+ },
+ {
+ "type": "doctype",
"name": "Supplier Quotation",
"description": _("Quotations received from Suppliers."),
},
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index e15f2b6..a3cb5d4 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -4,37 +4,108 @@
def get_data():
return [
{
+ "module_name": "Item",
+ "_doctype": "Item",
+ "color": "#f39c12",
+ "icon": "octicon octicon-package",
+ "type": "link",
+ "link": "List/Item"
+ },
+ {
+ "module_name": "Customer",
+ "_doctype": "Customer",
+ "color": "#1abc9c",
+ "icon": "octicon octicon-tag",
+ "type": "link",
+ "link": "List/Customer"
+ },
+ {
+ "module_name": "Supplier",
+ "_doctype": "Supplier",
+ "color": "#c0392b",
+ "icon": "octicon octicon-briefcase",
+ "type": "link",
+ "link": "List/Supplier"
+ },
+ {
+ "module_name": "Income Statement",
+ "_doctype": "Account",
+ "color": "#3498db",
+ "icon": "octicon octicon-repo",
+ "type": "link",
+ "link": "query-report/Profit and Loss Statement"
+ },
+ {
+ "_doctype": "Employee",
+ "module_name": "Employee",
+ "color": "#2ecc71",
+ "icon": "octicon octicon-organization",
+ "type": "link",
+ "link": "List/Employee"
+ },
+ {
+ "module_name": "Project",
+ "_doctype": "Project",
+ "color": "#8e44ad",
+ "icon": "octicon octicon-rocket",
+ "type": "link",
+ "link": "List/Project"
+ },
+ {
+ "module_name": "Issue",
+ "color": "#2c3e50",
+ "icon": "octicon octicon-issue-opened",
+ "_doctype": "Issue",
+ "type": "link",
+ "link": "List/Issue"
+ },
+ {
+ "module_name": "Lead",
+ "icon": "octicon octicon-broadcast",
+ "type": "module",
+ "_doctype": "Lead",
+ "type": "link",
+ "link": "List/Lead"
+ },
+
+ # old
+ {
"module_name": "Accounts",
"color": "#3498db",
"icon": "octicon octicon-repo",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Stock",
"color": "#f39c12",
"icon": "icon-truck",
"icon": "octicon octicon-package",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "CRM",
"color": "#EF4DB6",
"icon": "octicon octicon-broadcast",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Selling",
"color": "#1abc9c",
"icon": "icon-tag",
"icon": "octicon octicon-tag",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Buying",
"color": "#c0392b",
"icon": "icon-shopping-cart",
"icon": "octicon octicon-briefcase",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "HR",
@@ -42,14 +113,16 @@
"icon": "icon-group",
"icon": "octicon octicon-organization",
"label": _("Human Resources"),
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Manufacturing",
"color": "#7f8c8d",
"icon": "icon-cogs",
"icon": "octicon octicon-tools",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "POS",
@@ -58,21 +131,24 @@
"icon": "octicon octicon-credit-card",
"type": "page",
"link": "pos",
- "label": _("POS")
+ "label": _("POS"),
+ "hidden": 1
},
{
"module_name": "Projects",
"color": "#8e44ad",
"icon": "icon-puzzle-piece",
"icon": "octicon octicon-rocket",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Support",
"color": "#2c3e50",
"icon": "icon-phone",
"icon": "octicon octicon-issue-opened",
- "type": "module"
+ "type": "module",
+ "hidden": 1
},
{
"module_name": "Learn",
@@ -80,6 +156,7 @@
"icon": "octicon octicon-device-camera-video",
"type": "module",
"is_help": True,
- "label": _("Learn")
+ "label": _("Learn"),
+ "hidden": 1
}
]
diff --git a/erpnext/config/website.py b/erpnext/config/website.py
index 45fad66..5f77d9f 100644
--- a/erpnext/config/website.py
+++ b/erpnext/config/website.py
@@ -3,8 +3,7 @@
def get_data():
return [
{
- "label": _("Shopping Cart"),
- "icon": "icon-wrench",
+ "label": _("Portal"),
"items": [
{
"type": "doctype",
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index bcaa9fb..50d4d8a 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -4,9 +4,9 @@
from __future__ import unicode_literals
import frappe
from frappe import _, throw
-from frappe.utils import today, flt, cint, fmt_money
+from frappe.utils import today, flt, cint, fmt_money, formatdate
from erpnext.setup.utils import get_company_currency, get_exchange_rate
-from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year, get_account_currency
+from erpnext.accounts.utils import get_fiscal_years, validate_fiscal_year, get_account_currency
from erpnext.utilities.transaction_base import TransactionBase
from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document
from erpnext.controllers.sales_and_purchase_return import validate_return
@@ -48,9 +48,12 @@
self.validate_party()
self.validate_currency()
- if self.meta.get_field("is_recurring") and not self.get("__islocal"):
- validate_recurring_document(self)
- convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
+ if self.meta.get_field("is_recurring"):
+ if self.amended_from and self.recurring_id:
+ self.recurring_id = None
+ if not self.get("__islocal"):
+ validate_recurring_document(self)
+ convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
def on_update_after_submit(self):
if self.meta.get_field("is_recurring"):
@@ -61,8 +64,6 @@
for fieldname in ["posting_date", "transaction_date"]:
if not self.get(fieldname) and self.meta.get_field(fieldname):
self.set(fieldname, today())
- if self.meta.get_field("fiscal_year") and not self.fiscal_year:
- self.fiscal_year = get_fiscal_year(self.get(fieldname))[0]
break
def calculate_taxes_and_totals(self):
@@ -138,6 +139,10 @@
for fieldname in self.meta.get_valid_columns():
parent_dict[fieldname] = self.get(fieldname)
+ if self.doctype in ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]:
+ document_type = "{} Item".format(self.doctype)
+ parent_dict.update({"document_type": document_type})
+
for item in self.get("items"):
if item.get("item_code"):
args = parent_dict.copy()
@@ -166,6 +171,7 @@
item.set(fieldname, value)
if ret.get("pricing_rule"):
+ # if user changed the discount percentage then set user's discount percentage ?
item.set("discount_percentage", ret.get("discount_percentage"))
if ret.get("pricing_rule_for") == "Price":
item.set("pricing_list_rate", ret.get("pricing_list_rate"))
@@ -214,10 +220,17 @@
def get_gl_dict(self, args, account_currency=None):
"""this method populates the common properties of a gl entry record"""
+
+ fiscal_years = get_fiscal_years(self.posting_date, company=self.company)
+ if len(fiscal_years) > 1:
+ frappe.throw(_("Multiple fiscal years exist for the date {0}. Please set company in Fiscal Year").format(formatdate(self.posting_date)))
+ else:
+ fiscal_year = fiscal_years[0][0]
+
gl_dict = frappe._dict({
'company': self.company,
'posting_date': self.posting_date,
- 'fiscal_year': get_fiscal_year(self.posting_date, company=self.company)[0],
+ 'fiscal_year': fiscal_year,
'voucher_type': self.doctype,
'voucher_no': self.name,
'remarks': self.get("remarks"),
@@ -271,7 +284,7 @@
res = frappe.db.sql("""
select
t1.name as jv_no, t1.remark, t2.{0} as amount, t2.name as jv_detail_no,
- reference_name as against_order
+ t2.reference_name as against_order
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
@@ -450,7 +463,20 @@
# Note: not validating with gle account because we don't have the account
# at quotation / sales order level and we shouldn't stop someone
# from creating a sales invoice if sales order is already created
-
+
+ def validate_asset(self, asset, item_row):
+ if asset.company != self.company:
+ frappe.throw(_("Row #{0}: Asset {1} does not belong to company {2}")
+ .format(item_row.idx, item_row.asset, self.company))
+
+ elif asset.item_code != item_row.item_code:
+ frappe.throw(_("Row #{0}: Asset {1} does not linked to Item {2}")
+ .format(item_row.idx, item_row.asset, item_row.item_code))
+ elif asset.docstatus != 1:
+ frappe.throw(_("Row #{0}: Asset {1} must be submitted").format(item_row.idx, item_row.asset))
+ elif item_row.qty > 1:
+ frappe.throw(_("Row #{0}: Qty must be 1, as item is linked to an asset").format(item_row.idx))
+
@frappe.whitelist()
def get_tax_rate(account_head):
return frappe.db.get_value("Account", account_head, "tax_rate")
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index c9b660d..5361126 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -20,8 +20,9 @@
}
def get_feed(self):
- return _("From {0} | {1} {2}").format(self.supplier_name, self.currency,
- self.grand_total)
+ if self.get("supplier_name"):
+ return _("From {0} | {1} {2}").format(self.supplier_name, self.currency,
+ self.grand_total)
def validate(self):
super(BuyingController, self).validate()
@@ -40,7 +41,7 @@
# set contact and address details for supplier, if they are not mentioned
if getattr(self, "supplier", None):
- self.update_if_missing(get_party_details(self.supplier, party_type="Supplier"))
+ self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions))
self.set_missing_item_details()
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 91cd0da..f53ad53 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -160,10 +160,10 @@
return tax_accounts
-def item_query(doctype, txt, searchfield, start, page_len, filters):
+def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False):
conditions = []
- return frappe.db.sql("""select tabItem.name,tabItem.item_group,
+ return frappe.db.sql("""select tabItem.name, tabItem.item_group, tabItem.image,
if(length(tabItem.item_name) > 40,
concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name,
if(length(tabItem.description) > 40, \
@@ -192,7 +192,7 @@
"_txt": txt.replace("%", ""),
"start": start,
"page_len": page_len
- })
+ }, as_dict=as_dict)
def bom(doctype, txt, searchfield, start, page_len, filters):
conditions = []
@@ -209,11 +209,11 @@
limit %(start)s, %(page_len)s """.format(
fcond=get_filters_cond(doctype, filters, conditions),
mcond=get_match_cond(doctype),
- key=frappe.db.escape(searchfield)),
+ key=frappe.db.escape(searchfield)),
{
'txt': "%%%s%%" % frappe.db.escape(txt),
'_txt': txt.replace("%", ""),
- 'start': start,
+ 'start': start,
'page_len': page_len
})
@@ -341,3 +341,27 @@
'txt': "%%%s%%" % frappe.db.escape(txt),
'company': filters.get("company", "")
})
+
+
+@frappe.whitelist()
+def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
+ from erpnext.controllers.queries import get_match_cond
+
+ if not filters: filters = {}
+
+ condition = ""
+ if filters.get("company"):
+ condition += "and tabAccount.company = %(company)s"
+
+ return frappe.db.sql("""select tabAccount.name from `tabAccount`
+ where (tabAccount.report_type = "Profit and Loss"
+ or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary"))
+ and tabAccount.is_group=0
+ and tabAccount.docstatus!=2
+ and tabAccount.{key} LIKE %(txt)s
+ {condition} {match_condition}"""
+ .format(condition=condition, key=frappe.db.escape(searchfield),
+ match_condition=get_match_cond(doctype)), {
+ 'company': filters.get("company", ""),
+ 'txt': "%%%s%%" % frappe.db.escape(txt)
+ })
\ No newline at end of file
diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py
index 2df7352..a036760 100644
--- a/erpnext/controllers/recurring_document.py
+++ b/erpnext/controllers/recurring_document.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import frappe
+import calendar
import frappe.utils
import frappe.defaults
@@ -166,14 +167,24 @@
elif not (doc.from_date and doc.to_date):
frappe.throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype))
-
+
def validate_recurring_next_date(doc):
posting_date = doc.get("posting_date") or doc.get("transaction_date")
if getdate(posting_date) > getdate(doc.next_date):
frappe.throw(_("Next Date must be greater than Posting Date"))
- if getdate(doc.next_date).day != doc.repeat_on_day_of_month:
- frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
+ next_date = getdate(doc.next_date)
+ if next_date.day != doc.repeat_on_day_of_month:
+
+ # if the repeat day is the last day of the month (31)
+ # and the current month does not have as many days,
+ # then the last day of the current month is a valid date
+ lastday = calendar.monthrange(next_date.year, next_date.month)[1]
+ if doc.repeat_on_day_of_month < lastday:
+
+ # the specified day of the month is not same as the day specified
+ # or the last day of the month
+ frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
def convert_to_recurring(doc, posting_date):
if doc.is_recurring:
@@ -182,12 +193,11 @@
set_next_date(doc, posting_date)
+ if doc.next_date:
+ validate_recurring_next_date(doc)
+
elif doc.recurring_id:
- frappe.db.sql("""update `tab%s` set is_recurring = 0
- where recurring_id = %s""" % (doc.doctype, '%s'), (doc.recurring_id))
-
- if doc.next_date:
- validate_recurring_next_date(doc)
+ doc.db_set("recurring_id", None)
def validate_notification_email_id(doc):
if doc.notify_by_email:
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 5c5719e..254d9a6 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -17,9 +17,11 @@
["Opportunity", "has_opportunity"],
],
"Opportunity": [
- ["Lost", "eval:self.status=='Lost'"],
["Quotation", "has_quotation"],
- ["Converted", "has_ordered_quotation"]
+ ["Converted", "has_ordered_quotation"],
+ ["Lost", "eval:self.status=='Lost'"],
+ ["Closed", "eval:self.status=='Closed'"]
+
],
"Quotation": [
["Draft", None],
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 49e0bd3..7210d76 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -59,6 +59,11 @@
item.rate = flt(item.price_list_rate *
(1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
+ if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
+ item.total_margin = self.calculate_margin(item)
+ item.rate = flt(item.total_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
+ if item.total_margin > 0 else item.rate
+
item.net_rate = item.rate
item.amount = flt(item.rate * item.qty, item.precision("amount"))
item.net_amount = item.amount
@@ -437,3 +442,17 @@
self.doc.precision("outstanding_amount"))
elif self.doc.doctype == "Purchase Invoice":
self.doc.outstanding_amount = flt(total_amount_to_pay, self.doc.precision("outstanding_amount"))
+
+ def calculate_margin(self, item):
+ total_margin = 0.0
+ if item.price_list_rate:
+ if item.pricing_rule and not self.doc.ignore_pricing_rule:
+ pricing_rule = frappe.get_doc('Pricing Rule', item.pricing_rule)
+ item.margin_type = pricing_rule.margin_type
+ item.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
+
+ if item.margin_type and item.margin_rate_or_amount:
+ margin_value = item.margin_rate_or_amount if item.margin_type == 'Amount' else flt(item.price_list_rate) * flt(item.margin_rate_or_amount) / 100
+ total_margin = flt(item.price_list_rate) + flt(margin_value)
+
+ return total_margin
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index ae6e9e4..6b514b2 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -28,15 +28,16 @@
filters.append((doctype, "docstatus", "=", 1))
if user != "Guest" and is_website_user():
+ parties_doctype = 'Request for Quotation Supplier' if doctype == 'Request for Quotation' else doctype
# find party for this contact
- customers, suppliers = get_customers_suppliers(doctype, user)
+ customers, suppliers = get_customers_suppliers(parties_doctype, user)
- if customers:
- key, parties = "customer", customers
- elif suppliers:
- key, parties = "supplier", suppliers
- else:
- key, parties = "customer", []
+ if not customers and not suppliers: return []
+
+ key, parties = get_party_details(customers, suppliers)
+
+ if doctype == 'Request for Quotation':
+ return rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length)
filters.append((doctype, key, "in", parties))
@@ -52,6 +53,23 @@
return post_process(doctype, get_list(doctype, txt, filters, limit_start, limit_page_length,
fields="name", order_by = "modified desc"))
+def get_party_details(customers, suppliers):
+ if customers:
+ key, parties = "customer", customers
+ elif suppliers:
+ key, parties = "supplier", suppliers
+ else:
+ key, parties = "customer", []
+
+ return key, parties
+
+def rfq_transaction_list(parties_doctype, doctype, parties, limit_start, limit_page_length):
+ data = frappe.db.sql("""select distinct parent as name, supplier from `tab{doctype}`
+ where supplier = '{supplier}' and docstatus=1 order by modified desc limit {start}, {len}""".
+ format(doctype=parties_doctype, supplier=parties[0], start=limit_start, len = limit_page_length), as_dict=1)
+
+ return post_process(doctype, data)
+
def post_process(doctype, data):
result = []
for d in data:
diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json
index dd62821..ecca722 100644
--- a/erpnext/crm/doctype/lead/lead.json
+++ b/erpnext/crm/doctype/lead/lead.json
@@ -1,1019 +1,1046 @@
{
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "creation": "2013-04-10 11:45:37",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Document",
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2013-04-10 11:45:37",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "lead_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "options": "icon-user",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "lead_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-user",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Series",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "LEAD-",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "LEAD-",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "lead_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Person Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "lead_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "lead_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Person Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "lead_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "company_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Organization Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "company_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Organization Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "email_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Email Id",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "email_id",
- "oldfieldtype": "Data",
- "options": "Email",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Email Id",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "email_id",
+ "oldfieldtype": "Data",
+ "options": "Email",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break123",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break123",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Lead",
- "fieldname": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Lead",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "source",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Source",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Source",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.source == 'Customer'",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "From Customer",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.source == 'Customer'",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "From Customer",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.source == 'Campaign'",
- "description": "",
- "fieldname": "campaign_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Campaign Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "campaign_name",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "description": "",
+ "fieldname": "campaign_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Campaign Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "campaign_name",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break_12",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "__user",
- "fieldname": "lead_owner",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Lead Owner",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "lead_owner",
- "oldfieldtype": "Link",
- "options": "User",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_12",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_14",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "__user",
+ "fieldname": "lead_owner",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Lead Owner",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "lead_owner",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_by",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Next Contact By",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "contact_by",
- "oldfieldtype": "Link",
- "options": "User",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_by",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Next Contact By",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "contact_by",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Add to calendar on this date",
- "fieldname": "contact_date",
- "fieldtype": "Datetime",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Next Contact Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "contact_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Add to calendar on this date",
+ "fieldname": "contact_date",
+ "fieldtype": "Datetime",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Next Contact Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "contact_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address & Contact",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "options": "icon-map-marker",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address & Contact",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "options": "icon-map-marker",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.__islocal",
- "fieldname": "address_desc",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address Desc",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "address_desc",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address Desc",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address HTML",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address HTML",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "phone",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Phone",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "contact_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "phone",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Phone",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "contact_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "mobile_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No.",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "mobile_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "mobile_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No.",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "mobile_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "fax",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Fax",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "fax",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "fax",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Fax",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "fax",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "website",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Website",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "website",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "website",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Website",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "website",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Territory",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Territory",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "More Information",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Lead Type",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "type",
- "oldfieldtype": "Select",
- "options": "\nClient\nChannel Partner\nConsultant",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Lead Type",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "type",
+ "oldfieldtype": "Select",
+ "options": "\nClient\nChannel Partner\nConsultant",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "market_segment",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Market Segment",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "market_segment",
- "oldfieldtype": "Select",
- "options": "\nLower Income\nMiddle Income\nUpper Income",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "market_segment",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Market Segment",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "market_segment",
+ "oldfieldtype": "Select",
+ "options": "\nLower Income\nMiddle Income\nUpper Income",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "industry",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Industry",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "industry",
- "oldfieldtype": "Link",
- "options": "Industry Type",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "industry",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Industry",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "industry",
+ "oldfieldtype": "Link",
+ "options": "Industry Type",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "request_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Request Type",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "request_type",
- "oldfieldtype": "Select",
- "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "request_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Request Type",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "request_type",
+ "oldfieldtype": "Select",
+ "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "unsubscribed",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Unsubscribed",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "unsubscribed",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Unsubscribed",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "blog_subscriber",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Blog Subscriber",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "blog_subscriber",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Blog Subscriber",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-user",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2016-03-03 04:03:54.822184",
- "modified_by": "Administrator",
- "module": "CRM",
- "name": "Lead",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-user",
+ "idx": 5,
+ "image_field": "image",
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-04-04 07:23:47.804915",
+ "modified_by": "Administrator",
+ "module": "CRM",
+ "name": "Lead",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "All",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
}
- ],
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "lead_name,lead_owner,status",
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "lead_name"
-}
\ No newline at end of file
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "lead_name,lead_owner,status",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "lead_name",
+ "track_seen": 0
+}
diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py
index a743e56..0c3652f 100644
--- a/erpnext/crm/doctype/lead/lead.py
+++ b/erpnext/crm/doctype/lead/lead.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
-from frappe.utils import cstr, validate_email_add, cint, comma_and
+from frappe.utils import cstr, validate_email_add, cint, comma_and, has_gravatar
from frappe import session
from frappe.model.mapper import get_mapped_doc
@@ -44,6 +44,8 @@
# Lead Owner cannot be same as the Lead
self.lead_owner = None
+ self.image = has_gravatar(self.email_id)
+
def on_update(self):
self.add_calendar_event()
diff --git a/erpnext/crm/doctype/newsletter/newsletter.py b/erpnext/crm/doctype/newsletter/newsletter.py
old mode 100644
new mode 100755
index 52d3178..be1235b
--- a/erpnext/crm/doctype/newsletter/newsletter.py
+++ b/erpnext/crm/doctype/newsletter/newsletter.py
@@ -9,7 +9,9 @@
from frappe.model.document import Document
from frappe.email.bulk import check_bulk_limit
from frappe.utils.verified_command import get_signed_params, verify_request
-import erpnext.tasks
+from frappe.utils.background_jobs import enqueue
+from frappe.utils.scheduler import log
+from frappe.email.bulk import send
from erpnext.crm.doctype.newsletter_list.newsletter_list import add_subscribers
class Newsletter(Document):
@@ -32,11 +34,11 @@
self.recipients = self.get_recipients()
if getattr(frappe.local, "is_ajax", False):
- # to avoid request timed out!
self.validate_send()
- # hack! event="bulk_long" to queue in longjob queue
- erpnext.tasks.send_newsletter.delay(frappe.local.site, self.name, event="bulk_long")
+ # using default queue with a longer timeout as this isn't a scheduled task
+ enqueue(send_newsletter, queue='default', timeout=1500, event='send_newsletter', newsletter=self.name)
+
else:
self.send_bulk()
@@ -53,8 +55,6 @@
sender = self.send_from or frappe.utils.get_formatted_email(self.owner)
- from frappe.email.bulk import send
-
if not frappe.flags.in_test:
frappe.db.auto_commit_on_many_writes = True
@@ -166,4 +166,24 @@
frappe.respond_as_web_page(_("Confirmed"), _("{0} has been successfully added to our Newsletter list.").format(email))
+def send_newsletter(newsletter):
+ try:
+ doc = frappe.get_doc("Newsletter", newsletter)
+ doc.send_bulk()
+
+ except:
+ frappe.db.rollback()
+
+ # wasn't able to send emails :(
+ doc.db_set("email_sent", 0)
+ frappe.db.commit()
+
+ log("send_newsletter")
+
+ raise
+
+ else:
+ frappe.db.commit()
+
+
diff --git a/erpnext/crm/doctype/newsletter_list/newsletter_list.py b/erpnext/crm/doctype/newsletter_list/newsletter_list.py
index d56b5ad..c3604f8 100644
--- a/erpnext/crm/doctype/newsletter_list/newsletter_list.py
+++ b/erpnext/crm/doctype/newsletter_list/newsletter_list.py
@@ -13,12 +13,14 @@
def onload(self):
singles = [d.name for d in frappe.db.get_all("DocType", "name", {"issingle": 1})]
self.get("__onload").import_types = [{"value": d.parent, "label": "{0} ({1})".format(d.parent, d.label)} \
- for d in frappe.db.get_all("DocField", ("parent", "label"), {"options": "Email"}) if d.parent not in singles]
+ for d in frappe.db.get_all("DocField", ("parent", "label"), {"options": "Email"})
+ if d.parent not in singles]
def import_from(self, doctype):
"""Extract email ids from given doctype and add them to the current list"""
meta = frappe.get_meta(doctype)
- email_field = [d.fieldname for d in meta.fields if d.fieldtype in ("Data", "Small Text") and d.options=="Email"][0]
+ email_field = [d.fieldname for d in meta.fields
+ if d.fieldtype in ("Data", "Small Text", "Text", "Code") and d.options=="Email"][0]
unsubscribed_field = "unsubscribed" if meta.get_field("unsubscribed") else None
added = 0
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index d117d06..0f45c60 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -147,7 +147,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "customer_name",
@@ -967,14 +967,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-info-sign",
- "idx": 1,
+ "idx": 195,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-03 06:13:49.728079",
+ "modified": "2016-04-06 03:15:24.676978",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",
@@ -1027,5 +1027,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/docs/assets/img/accounts/asset-category.png b/erpnext/docs/assets/img/accounts/asset-category.png
new file mode 100644
index 0000000..ccbb6ec
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/asset-category.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/asset-purchase-invoice.png b/erpnext/docs/assets/img/accounts/asset-purchase-invoice.png
new file mode 100644
index 0000000..a421bc9
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/asset-purchase-invoice.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/asset-sales.png b/erpnext/docs/assets/img/accounts/asset-sales.png
new file mode 100644
index 0000000..329c0e2
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/asset-sales.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/asset.png b/erpnext/docs/assets/img/accounts/asset.png
new file mode 100644
index 0000000..5d741a2
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/asset.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/depreciation-entry.png b/erpnext/docs/assets/img/accounts/depreciation-entry.png
new file mode 100644
index 0000000..e35180c
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/depreciation-entry.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/depreciation-schedule.png b/erpnext/docs/assets/img/accounts/depreciation-schedule.png
new file mode 100644
index 0000000..400e4c8
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/depreciation-schedule.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/scrap-journal-entry.png b/erpnext/docs/assets/img/accounts/scrap-journal-entry.png
new file mode 100644
index 0000000..f4ba533
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/scrap-journal-entry.png
Binary files differ
diff --git a/erpnext/docs/assets/img/buying/make-supplier-quotation-from-rfq.png b/erpnext/docs/assets/img/buying/make-supplier-quotation-from-rfq.png
new file mode 100644
index 0000000..135e9fc
--- /dev/null
+++ b/erpnext/docs/assets/img/buying/make-supplier-quotation-from-rfq.png
Binary files differ
diff --git a/erpnext/docs/assets/img/buying/request-for-quotation.png b/erpnext/docs/assets/img/buying/request-for-quotation.png
new file mode 100644
index 0000000..b8b1ec2
--- /dev/null
+++ b/erpnext/docs/assets/img/buying/request-for-quotation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/selling/margin-item-price-list.png b/erpnext/docs/assets/img/selling/margin-item-price-list.png
new file mode 100644
index 0000000..4961755
--- /dev/null
+++ b/erpnext/docs/assets/img/selling/margin-item-price-list.png
Binary files differ
diff --git a/erpnext/docs/assets/img/selling/margin-pricing-rule.png b/erpnext/docs/assets/img/selling/margin-pricing-rule.png
new file mode 100644
index 0000000..6dba884
--- /dev/null
+++ b/erpnext/docs/assets/img/selling/margin-pricing-rule.png
Binary files differ
diff --git a/erpnext/docs/assets/img/selling/margin-quotation-item.png b/erpnext/docs/assets/img/selling/margin-quotation-item.png
new file mode 100644
index 0000000..d5ee8a3
--- /dev/null
+++ b/erpnext/docs/assets/img/selling/margin-quotation-item.png
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/budgeting-1.png b/erpnext/docs/assets/old_images/erpnext/budgeting-1.png
deleted file mode 100644
index 29038a0..0000000
--- a/erpnext/docs/assets/old_images/erpnext/budgeting-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/budgeting-2-1.png b/erpnext/docs/assets/old_images/erpnext/budgeting-2-1.png
deleted file mode 100644
index 7cd431e..0000000
--- a/erpnext/docs/assets/old_images/erpnext/budgeting-2-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/budgeting-3.png b/erpnext/docs/assets/old_images/erpnext/budgeting-3.png
deleted file mode 100644
index 29037c7..0000000
--- a/erpnext/docs/assets/old_images/erpnext/budgeting-3.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/budgeting-4-1.png b/erpnext/docs/assets/old_images/erpnext/budgeting-4-1.png
deleted file mode 100644
index 6348f1e..0000000
--- a/erpnext/docs/assets/old_images/erpnext/budgeting-4-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/advance-payment-entry.md b/erpnext/docs/user/manual/en/accounts/advance-payment-entry.md
index 042e800..010d897 100644
--- a/erpnext/docs/user/manual/en/accounts/advance-payment-entry.md
+++ b/erpnext/docs/user/manual/en/accounts/advance-payment-entry.md
@@ -7,19 +7,17 @@
bed costing $10000 She is asked to give some advance before the furniture
house begins work on her order. She gives them $5000 in cash.
-
-Go to Accounts and open a new Journal Entry to make the advance entry.
+Once Sales Order or Purchase Order is submitted, you will find option to create Advance Payment entry against it.
+
+To directly create Advance Payment Entry, Go to:
> Accounts > Documents > Journal Entry > New Journal Entry
-Mention the voucher type as cash voucher. This differs for different
-customers. If somebody pays by cheque the voucher type will be Bank Voucher.
-Then select the customer account and make the respective debit and credit
-entries.
+Select a Voucher Type based on a mode in which advance payment is made.
Since the customer has given $5000 as cash advance,it will be recorded as a
-credit entry against the customer. To balance it with the debit entry [Double
-accounting Entry] enter $5000 as debit against the company's cash account. In
+credit entry against the customer. To balance it with the debit entry [as per the Double
+accounting system] enter $5000 as debit against the company's cash account. In
the row "Is Advance" click 'Yes'.
#### Figure 1 : Journal Entry -Advance Entry
@@ -43,7 +41,7 @@
<img class="screenshot" alt="Advace Payment" src="{{docs_base_url}}/assets/img/accounts/advance-payment-2.png">
-Save and submit the JV. If this document is not saved it will not be pulled in
+Save and submit the Journal Entry. If this document is not saved it will not be pulled in
other accounting documents.
When you make a new Sales Invoice for the same customer, mention the advance
diff --git a/erpnext/docs/user/manual/en/accounts/budgeting.md b/erpnext/docs/user/manual/en/accounts/budgeting.md
index a5f35d2..49a73ac 100644
--- a/erpnext/docs/user/manual/en/accounts/budgeting.md
+++ b/erpnext/docs/user/manual/en/accounts/budgeting.md
@@ -11,48 +11,35 @@
You can define it in the Cost Center. If you have seasonal sales you can also
define a budget distribution that the budget will follow.
-In order to allocate budget, go to Accounts > Setup > Chart of Cost Centers and click on Chart of Cost Center.
-Select a Cost Center and click on Open.
+In order to allocate budget, go to:
-#### Step 1: Click on Edit.
+> Accounts > Setup > Chart of Cost Centers
-![]({{docs_base_url}}/assets/old_images/erpnext/budgeting-1.png)
+and click on Chart of Cost Center. Select a Cost Center and click on Open.
-<img alt="Accounts Receivable" class="screenshot" src="{{docs_base_url}}/assets/img/accounts/accounts-receivable.png">
+#### Step 1: Click on Edit.
-#### Step 2: Enter Monthly Distribution.
+<img alt="Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/accounts/cost-center-1.gif">
-![]({{docs_base_url}}/assets/old_images/erpnext/budgeting-2-1.png)
+#### Step 3:Add New Row and select budget account.
+<img alt="Cost Center Account" class="screenshot" src="{{docs_base_url}}/assets/img/accounts/cost-center-2.png">
+
+#### Step 3: Enter Monthly Distribution (optional)
+
+<img alt="Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/accounts/cost-center-distribution.gif">
If you leave the** **distribution ID blank, ERPNext will calculate on a yearly
basis or in equal proportion for every month.
-#### Step 3:Add New Row and select budget account.
-
-
-
-![]({{docs_base_url}}/assets/old_images/erpnext/budgeting-3.png)
-
-
-
### To Create New Distribution ID
-ERPNext allows you to take a few budget actions. It signifies whether to stop
-, warn or Ignore if you exceed budgets.
-
-![]({{docs_base_url}}/assets/old_images/erpnext/budgeting-4.png)
-
-
+ERPNext allows you to take a few budget actions. It signifies whether to stop, warn or Ignore if you exceed budgets.
These can be defined from the Company record.
-![]({{docs_base_url}}/assets/old_images/erpnext/budgeting-4-1.png)
+<img alt="Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/accounts/cost-center-company.gif">
-
-
-Even if you choose to “ignore” budget overruns, you will get a wealth of
-information from the “Budget vs Actual” variance report. This report shows
-month wise actual expenses as compared to the budgeted expenses.
+Even if you choose to “ignore” budget overruns, you will get a wealth of information from the “Budget vs Actual” variance report. This report shows month wise actual expenses as compared to the budgeted expenses.
{next}
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index 1a1d5d5..fcb7441 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -10,6 +10,7 @@
opening-entry
accounting-reports
accounting-entries
+managing-fixed-assets
budgeting
opening-accounts
item-wise-tax
diff --git a/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
new file mode 100644
index 0000000..35b83aa
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
@@ -0,0 +1,71 @@
+In ERPNext, you can maintain your fixed asset records like Computers, Building, Cars etc and manage depreciations, sell or disposal of those assets.
+
+## Asset Category
+
+To start first you should create Asset Category, depending on the type of assets. For example, all your desktops and laptops can be part of a Asset Category named "Computers". Here, you can set default depreciation method, periodicity and depreciation related accounts, which will be applicable to all the assets under the category.
+
+<img class="screenshot" alt="Asset Category" src="{{docs_base_url}}/assets/img/accounts/asset-category.png">
+
+> **Note:** You can also set default depreciation related Accounts and Cost Centers in Company.
+
+
+## Asset
+
+Next step will be creating the fixed asset records. The assets which are partially / fully depreciated can also be created/maintained for the future reference.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/asset.png">
+
+Explanation of the fields:
+
+1. Asset Category: The category of assets it belongs to.
+2. Item Code: The item/product code for the asset, which must be marked as a fixed asset and a non-stock item.
+3. Status: The options are - Draft, Submitted, Partially Depreciated, Fully Depreciated, Sold and Scrapped.
+4. Gross Purchase Amount: The purchase cost of the asset
+5. Expected Value After Useful Life: Useful Life is the time period over in which the company expects that the asset will be productive. After that period, either the asset is scrapped or sold. In case it is sold, mention the estimated value here. This value is also known as Salvage Value, Scrap Value or Residual Value.
+6. Current Value (After Depreciation): In case you are creating record of an existing asset which has already been partially/fully depreciated, mention the currect value of the asset. In case of new asset, mention the purchase amount or leave it blank.
+7. Depreciation Method: There are two options: Straight Line and Double Declining Balance.
+ - Straight Line: This method spreads the cost of the fixed asset evenly over its useful life.
+ - Double Declining Method: An accelerated method of depreciation, it results in higher depreciation expense in the earlier years of ownership.
+8. Number of Depreciations: The number of depreciations during the useful life. In case of existing assets which are partially depreciated, mention the number of pending depreciations.
+9. Number of Months in a Period: The number of months between two depreciations.
+10. Next Depreciation Date: Mention the next depreciation date, even if it is the first one. If depreciation already completed, leave it blank.
+
+### Depreciations
+
+The system automatically creates a schedule for depreciation based on depreciation method and other related inputs in the Asset record.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/depreciation-schedule.png">
+
+On the scheduled date, system creates depreciation entry by creating a Journal Entry and the same Journal Entry is updated in the depreciation table for reference. Next Depreciation Date and Current Value are also updated on submission of depreciation entry.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/depreciation-entry.png">
+
+In the depreciation entry, the "Accumulated Depreciation Account" is credited and "Depreciation Expense Account" is debited. The related accounts can be set in the Asset Category or Company.
+
+
+## Purchase an asset
+
+For purchasing an asset, first create an item for the asset with "Is Fixed Asset" checked. Then create a Purchase Invoice against that item. In the Purchase Invoice Item row, you have to mention Asset name and associated fixed asset account should be set as Expense Account. Fixed asset accounts are identified based on "Fixed Asset" account type.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/asset-purchase-invoice.png">
+
+System will validate purchase date, supplier with the value mentioned in the Asset record. On submission of the Invoice, the "Fixed Asset Account" will be debited. It will also update Purchase Invoice number in the Asset.
+
+
+## Sell an ssset
+
+To sale an asset, create a Sales Invoice against the item linked with the asset. On submission of Sales Invoice, following entries will take place:
+
+- "Receivable Account" (Debtors) will be debited by the sales amount.
+- "Fixed Asset Account" will be credited by the purchase amount of asset.
+- "Accumulated Depreciation Account" will be debited by the total depreciated amount till now.
+- "Gain/Loss Account on Asset Disposal" will be credited/debited based on gain/loss amount. The Gain/Loss account can be set in Company record.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/asset-sales.png">
+
+
+## Scrap an Asset
+
+You can scrap an asset anytime using the "Scrap Asset" button in the Asset record. The "Gain/Loss Account on Asset Disposal" mentioned in the Company is debited by the Current Value (After Depreciation) of the asset. , After scrapping, you can also restore the asset using "Restore Asset" button.
+
+<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/scrap-journal-entry.png">
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/opening-accounts.md b/erpnext/docs/user/manual/en/accounts/opening-accounts.md
index 28ba0c2..fc86cdd 100644
--- a/erpnext/docs/user/manual/en/accounts/opening-accounts.md
+++ b/erpnext/docs/user/manual/en/accounts/opening-accounts.md
@@ -1,4 +1,4 @@
-Now that you have completed most of the setup, its time to start moving in!
+ Now that you have completed most of the setup, its time to start moving in!
There are two important sets of data you need to enter before you start your
operations.
@@ -29,11 +29,7 @@
#### Temporary Accounts
-A nice way to simplify opening is to use a temporary account
-just for opening. These accounts will become zero once all your old
-invoices and opening balances of bank, debt stock etc are entered.
-In the standard chart of accounts, a **Temporary Opening** account is created under
-assets
+A nice way to simplify opening is to use a temporary account just for opening. These accounts will become zero once all your old invoices and opening balances of bank, debt stock etc are entered. In the standard chart of accounts, a **Temporary Opening** account is created under assets
#### The Opening Entry
@@ -54,7 +50,6 @@
![Opening Temp Entry]({{docs_base_url}}/assets/old_images/erpnext/image-temp-opening.png)
-
![Opening Entry]({{docs_base_url}}/assets/old_images/erpnext/opening-entry-2.png)
Temporary Asset and Liability account is used for balancing purpose. When you update opening balance in Liability Account, you can use Temporary Asset Account for balancing.
@@ -68,26 +63,19 @@
* In this method you can update opening balance of specific balancesheet accounts and not for all.
* Opening entry is only for balance sheet accounts and not for expense or Income accounts.
-After completing the accounting entries, the trial balance report will look
-like the one given below:
-
+After completing the accounting entries, the trial balance report will look like the one given below:
![Trial Balance]({{docs_base_url}}/assets/old_images/erpnext/trial-balance-1.png)
#### Outstanding Invoices
-After your Opening Journal Entrys are made, you will need to enter each
-Sales Invoice and Purchase Invoice that is yet to be paid.
+After your Opening Journal Entrys are made, you will need to enter each Sales Invoice and Purchase Invoice that is yet to be paid.
-Since you have already booked the income or expense on these invoices in the
-previous period, select the temp opening account **Temporary Opening** in the “Income” and
-“Expense” accounts.
+Since you have already booked the income or expense on these invoices in the previous period, select the temp opening account **Temporary Opening** in the “Income” and “Expense” accounts.
> Note: Make sure to set each invoice as “Is Opening”!
-If you don’t care what items are in that invoice, just make a dummy item entry
-in the Invoice. Item code in the Invoice is not necessary, so it should not be
-such a problem.
+If you don’t care what items are in that invoice, just make a dummy item entry in the Invoice. Item code in the Invoice is not necessary, so it should not be such a problem.
Once all your invoices are entered, your **Temporary Opening** account will have a balance of zero!
diff --git a/erpnext/docs/user/manual/en/buying/index.txt b/erpnext/docs/user/manual/en/buying/index.txt
index a12bb06..25c8797 100644
--- a/erpnext/docs/user/manual/en/buying/index.txt
+++ b/erpnext/docs/user/manual/en/buying/index.txt
@@ -1,4 +1,5 @@
supplier
+request-for-quotation
supplier-quotation
purchase-order
setup
diff --git a/erpnext/docs/user/manual/en/buying/request-for-quotation.md b/erpnext/docs/user/manual/en/buying/request-for-quotation.md
new file mode 100644
index 0000000..379cdb5
--- /dev/null
+++ b/erpnext/docs/user/manual/en/buying/request-for-quotation.md
@@ -0,0 +1,14 @@
+A Request for Quotation is a document that an organization submits to one or more suppliers eliciting quotation for items.
+
+In ERPNext, You can create request for quotation directly by going to:
+
+`Buying > Documents > Request for Quotation > New Request for Quotation`
+
+Create Request for Quotation:
+
+![Request For Quotation]({{docs_base_url}}/assets/img/buying/request-for-quotation.png)
+
+Create Supplier Quotation from Request for Quotation form:
+
+![Request For Quotation]({{docs_base_url}}/assets/img/buying/make-supplier-quotation-from-rfq.png)
+
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/print-format.md b/erpnext/docs/user/manual/en/customize-erpnext/print-format.md
index 34ef16d..f0ca942 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/print-format.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/print-format.md
@@ -29,7 +29,7 @@
Print Formats are rendered on the server side using the [Jinja Templating Language](http://jinja.pocoo.org/docs/templates/). All forms have access to the doc object which contains information about the document that is being formatted. You can also access common utilities via the frappe module.
-For styling, the [Boostrap CSS Framework](http://getbootstrap.com/) is provided and you can enjoy the full range of classes.
+For styling, the [Bootstrap CSS Framework](http://getbootstrap.com/) is provided and you can enjoy the full range of classes.
> Note: Pre-printed stationary is usually not a good idea because your Prints
will look incomplete (inconsistent) when you send them by mail.
diff --git a/erpnext/docs/user/manual/en/selling/articles/adding-margin.md b/erpnext/docs/user/manual/en/selling/articles/adding-margin.md
new file mode 100644
index 0000000..2a9ddfa
--- /dev/null
+++ b/erpnext/docs/user/manual/en/selling/articles/adding-margin.md
@@ -0,0 +1,37 @@
+#Adding Margin
+
+User Can apply the margin on Quotation Item and Sales Order Item using following two options.
+1)Price Rule: With the help of this method user can apply the margin on Quotation and Sales Order based on condition. you can find the section margin on pricing rule where a user has to select the type of margin whether it is Percentage or Amount and rate or amount. The system will apply the margin on quotation item and sales order item if pricing rule is enabled.
+
+To setup Pricing Rule, go to:
+
+`Selling > Setup > Pricing Rule` or `Accounts > Setup > Pricing Rule`
+
+####Adding Margin in Pricing Rule
+
+<img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-pricing-rule.png">
+
+Total Margin is calculated as follows:
+`Rate = Price List Rate + Margin Rate`
+
+So, In order to apply the Margin you need to add the Price List for the Item
+
+To add Price List, go to:
+
+`Selling > Setup > Item Price` or `Stock > Setup > Item Price`
+
+####Adding Item Price
+
+<img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-item-price-list.png">
+
+2) Apply margin direct on Item: If user wants to apply the margin without pricing rule, they can use this option. In Quotation Item and Sales Order Item, user can select the margin type and rate or amount. The system will calculate the margin and apply it on price list rate to calculate the rate of the product.
+
+To add margin directly on Quotation or Sales Order, go to:
+
+`Selling > Document > Quotation`
+
+add item and scroll down to section where you can find the Margin Type
+
+####Adding Margin in Quotation
+
+<img alt="Adding Margin in Quotation" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-quotation-item.png">
diff --git a/erpnext/docs/user/manual/en/selling/quotation.md b/erpnext/docs/user/manual/en/selling/quotation.md
index 027a515..6f5cc5e 100644
--- a/erpnext/docs/user/manual/en/selling/quotation.md
+++ b/erpnext/docs/user/manual/en/selling/quotation.md
@@ -7,7 +7,7 @@
> Selling > Quotation > New Quotation
-###Creating Quotation from Oppurtunity
+###Creating Quotation from Opportunity
You can also create a Quotation from an Opportunity.
@@ -35,7 +35,7 @@
The rates you quote may depend on two things.
- * The Price List: If you have multiple Price Lists, you can select a Price List or tag it to the Customer (so that it is auto-selected). Your Item prices will automatically be updated from the Price List.For details refer [Price List]({{docs_base_url}}/user/manual/en/setting-up/price-lists.html)
+ * The Price List: If you have multiple Price Lists, you can select a Price List or tag it to the Customer (so that it is auto-selected). Your Item prices will automatically be updated from the Price List. For details refer [Price List]({{docs_base_url}}/user/manual/en/setting-up/price-lists.html)
* The Currency: If you are quoting to a Customer in a different currency, you will have to update the conversion rates to enable ERPNext to save the information in your standard Currency. This will help you to analyze the value of your Quotations in standard Currency.
diff --git a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
index fbe880f..80970bf 100644
--- a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
+++ b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
@@ -143,11 +143,11 @@
<p><strong>Stock Ledger</strong>
</p>
-![pr<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-2.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-2.png">
**General Ledger**
-![pr<em>general</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-3.png)
+<img alt="Leger" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-3.png">
As stock balance increases through Purchase Receipt, "Store" and "Fixed Asset
Warehouse" accounts are debited and a temporary account "Stock Receipt But Not
@@ -162,7 +162,7 @@
**General Ledger**
-![pi<em>general</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-4.png)
+<img alt="General" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-4.png">
Here "Stock Received But Not Billed" account is debited and nullified the
effect of Purchase Receipt.
@@ -220,11 +220,11 @@
**Stock Ledger**
-![dn<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-5.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-5.png">
**General Ledger**
-![dn<em>general</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-6.png)
+<img alt="General" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-6.png">
As item is delivered from "Stores" warehouse, "Stores" account is credited and
equal amount is debited to the expense account "Cost of Goods Sold". The
@@ -254,11 +254,11 @@
**Stock Ledger**
-![si<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-7.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-7.png">
**General Ledger**
-![si<em>general</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-8.png)
+<img alt="General" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-8.png">
Here, apart from normal account entries for invoice, "Stores" and "Cost of
Goods Sold" accounts are also affected based on the valuation amount.
@@ -292,11 +292,11 @@
**Stock Ledger**
-![mr<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-9.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-9.png">
**General Ledger**
-![mr<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-10.png)
+<img alt="General" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-10.png">
* * *
@@ -327,11 +327,11 @@
**Stock Ledger**
-![mi<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-11.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-11.png">
**General Ledger**
-![mi<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-12.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-12.png">
* * *
@@ -364,8 +364,10 @@
**Stock Ledger**
-![mtn<em>stock</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-13.png)
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-13.png">
**General Ledger**
-![mtn<em>general</em>ledger]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-14.png)
\ No newline at end of file
+<img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-14.png">
+
+{ next }
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/stock/articles/managing-assets.md b/erpnext/docs/user/manual/en/stock/articles/managing-assets.md
index 0be7860..1e1fcf4 100644
--- a/erpnext/docs/user/manual/en/stock/articles/managing-assets.md
+++ b/erpnext/docs/user/manual/en/stock/articles/managing-assets.md
@@ -18,6 +18,6 @@
Separate Warehouse should be created for the fixed asset items. All the sales, purchase and stock transactions for asset items should be done for fixed asset warehouse only.
-As per the perpetual inventory valuation system, accounting ledger is auto-created for a warehouse. You can move the accounting ledger of fixed asset asset from Stock Asset (default group) to Fixed Asset's group account.
+As per the perpetual inventory valuation system, accounting ledger is auto-created for a warehouse. You can move the accounting ledger of fixed asset from Stock Asset (default group) to Fixed Asset's group account.
-<!-- markdown -->
\ No newline at end of file
+<!-- markdown -->
diff --git a/erpnext/docs/user/manual/en/stock/articles/managing-batch-wise-inventory.md b/erpnext/docs/user/manual/en/stock/articles/managing-batch-wise-inventory.md
index 7ae102b..ccf39c1 100644
--- a/erpnext/docs/user/manual/en/stock/articles/managing-batch-wise-inventory.md
+++ b/erpnext/docs/user/manual/en/stock/articles/managing-batch-wise-inventory.md
@@ -1,6 +1,6 @@
#Managing Batch wise Inventory
-Set of items which has same properties and attributes can be group in a single Batch. For example, pharceuticals items are batch, so that it's manufacturing and expiry date can be tracked together.
+Set of items which has same properties and attributes can be group in a single Batch. For example, pharmaceuticals items are batch, so that it's manufacturing and expiry date can be tracked together.
To maintain batches against an Item you need to mention 'Has Batch No' as yes in the Item Master.
diff --git a/erpnext/docs/user/manual/en/stock/opening-stock.md b/erpnext/docs/user/manual/en/stock/opening-stock.md
index 4d2d727..e59fb42 100644
--- a/erpnext/docs/user/manual/en/stock/opening-stock.md
+++ b/erpnext/docs/user/manual/en/stock/opening-stock.md
@@ -10,6 +10,6 @@
If you are not making opening Stock Entry, you can select "Stock Adjustment" account in Difference/Expense Account field which is an expense account.
-To understand Opening Stock for serialzed Items visit [Stock Reconciliation]({{docs_base_url}}/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.html)
+To understand Opening Stock for serialized Items visit [Stock Reconciliation]({{docs_base_url}}/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.html)
{next}
diff --git a/erpnext/fixtures/web_form.json b/erpnext/fixtures/web_form.json
index a248886..d8b79f3 100644
--- a/erpnext/fixtures/web_form.json
+++ b/erpnext/fixtures/web_form.json
@@ -4,6 +4,228 @@
"allow_delete": 1,
"allow_edit": 1,
"allow_multiple": 1,
+ "breadcrumbs": "[{\"title\":\"Collaborative Project Management\", \"name\":\"projects?project=Collaborative Project Management\"}]",
+ "doc_type": "Task",
+ "docstatus": 0,
+ "doctype": "Web Form",
+ "introduction_text": null,
+ "is_standard": 1,
+ "login_required": 1,
+ "modified": "2016-03-30 01:27:27.469840",
+ "name": "tasks",
+ "page_name": "tasks",
+ "published": 1,
+ "success_message": null,
+ "success_url": "/projects?project=Collaborative Project Management",
+ "title": "Task",
+ "web_form_fields": [
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Project",
+ "options": "Project",
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "subject",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Subject",
+ "options": null,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Status",
+ "options": "Open\nClosed\nCancelled",
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "label": "Details",
+ "options": null,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "priority",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Priority",
+ "options": "Low\nMedium\nHigh\nUrgent",
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "exp_start_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Expected Start Date",
+ "options": null,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "exp_end_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Expected End Date",
+ "options": null,
+ "read_only": 0,
+ "reqd": 0
+ }
+ ],
+ "web_page_link_text": null
+ },
+ {
+ "allow_comments": 0,
+ "allow_delete": 1,
+ "allow_edit": 0,
+ "allow_multiple": 0,
+ "breadcrumbs": "[{\"title\":\"Collaborative Project Management\", \"name\":\"project?project=Collaborative Project Management\"}]",
+ "doc_type": "Time Log",
+ "docstatus": 0,
+ "doctype": "Web Form",
+ "introduction_text": null,
+ "is_standard": 0,
+ "login_required": 1,
+ "modified": "2016-03-30 01:28:00.061700",
+ "name": "time-log",
+ "page_name": "time-log",
+ "published": 1,
+ "success_message": null,
+ "success_url": "/test?project=Collaborative Project Management",
+ "title": "Time Log",
+ "web_form_fields": [
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Project",
+ "options": "Project",
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Title",
+ "options": null,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "default": "Open",
+ "description": null,
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Status",
+ "options": "Open\nWorking\nPending Review\nClosed\nCancelled",
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Employee",
+ "options": "Employee",
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "from_time",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "From Time",
+ "options": null,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "to_time",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "To Time",
+ "options": null,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": "0",
+ "description": null,
+ "fieldname": "hours",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Hours",
+ "options": null,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": "Will be updated when batched.",
+ "fieldname": "time_log_batch",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Time Log Batch",
+ "options": "Time Log Batch",
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "default": null,
+ "description": null,
+ "fieldname": "note",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "label": "Note",
+ "options": null,
+ "read_only": 1,
+ "reqd": 0
+ }
+ ],
+ "web_page_link_text": null
+ },
+ {
+ "allow_comments": 1,
+ "allow_delete": 1,
+ "allow_edit": 1,
+ "allow_multiple": 1,
"breadcrumbs": "[{\"title\":\"Issues\", \"name\":\"issues\"}]",
"doc_type": "Issue",
"docstatus": 0,
@@ -11,13 +233,13 @@
"introduction_text": null,
"is_standard": 1,
"login_required": 1,
- "modified": "2015-06-01 08:14:26.350792",
+ "modified": "2016-03-30 01:22:09.921515",
"name": "issues",
"page_name": "issues",
"published": 1,
"success_message": "",
"success_url": "/issues",
- "title": "Issues",
+ "title": "Issue",
"web_form_fields": [
{
"default": null,
@@ -78,13 +300,13 @@
"introduction_text": null,
"is_standard": 1,
"login_required": 1,
- "modified": "2015-11-23 08:21:53.924318",
+ "modified": "2016-03-30 01:22:04.728685",
"name": "addresses",
"page_name": "addresses",
"published": 1,
"success_message": null,
"success_url": "/addresses",
- "title": "Addresses",
+ "title": "Address",
"web_form_fields": [
{
"default": null,
@@ -244,13 +466,13 @@
"introduction_text": null,
"is_standard": 0,
"login_required": 0,
- "modified": "2016-02-19 16:46:57.448416",
+ "modified": "2016-03-30 01:21:57.425828",
"name": "job_application",
"page_name": "job_application",
"published": 1,
"success_message": "Thank you for applying.",
"success_url": "/jobs",
- "title": "Job Application",
+ "title": "Job Applicant",
"web_form_fields": [
{
"default": null,
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 0d235e3..be19aff 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -71,9 +71,26 @@
"parents": [{"title": _("Shipments"), "name": "shipments"}]
}
},
+ {"from_route": "/rfq", "to_route": "Request for Quotation"},
+ {"from_route": "/rfq/<path:name>", "to_route": "rfq",
+ "defaults": {
+ "doctype": "Request for Quotation",
+ "parents": [{"title": _("Request for Quotation"), "name": "rfq"}]
+ }
+ },
{"from_route": "/jobs", "to_route": "Job Opening"},
]
+portal_menu_items = [
+ {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
+ {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation"},
+ {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order"},
+ {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice"},
+ {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note"},
+ {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue"},
+ {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"}
+]
+
has_website_permission = {
"Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
@@ -107,17 +124,22 @@
},
"User": {
"validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
- "on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions"
+ "on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions",
+ "on_update": "erpnext.utilities.doctype.contact.contact.update_contact"
},
- "Sales Taxes and Charges Template": {
- "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
- },
- "Price List": {
+ ("Sales Taxes and Charges Template", 'Price List'): {
"on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
},
"Address": {
"validate": "erpnext.shopping_cart.cart.set_customer_in_address"
- }
+ },
+
+ # bubble transaction notification on master
+ ('Opportunity', 'Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice',
+ 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt',
+ 'Purchase Invoice', 'Project', 'Issue'): {
+ 'on_change': 'erpnext.accounts.party_status.notify_status'
+ }
}
scheduler_events = {
@@ -130,7 +152,8 @@
"erpnext.support.doctype.issue.issue.auto_close_tickets",
"erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
"erpnext.hr.doctype.employee.employee.send_birthday_reminders",
- "erpnext.projects.doctype.task.task.set_tasks_as_overdue"
+ "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
+ "erpnext.accounts.doctype.asset.depreciation.post_depreciation_entries"
]
}
@@ -143,3 +166,7 @@
get_translated_dict = {
("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
}
+
+bot_parsers = [
+ 'erpnext.utilities.bot.FindItemBot',
+]
diff --git a/erpnext/hr/doctype/appraisal/appraisal.json b/erpnext/hr/doctype/appraisal/appraisal.json
index e353e34..3ca987b 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.json
+++ b/erpnext/hr/doctype/appraisal/appraisal.json
@@ -38,7 +38,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Select template from which you want to get the Goals",
+ "description": "",
"fieldname": "kra_template",
"fieldtype": "Link",
"hidden": 0,
@@ -67,7 +67,7 @@
"bold": 0,
"collapsible": 0,
"depends_on": "kra_template",
- "description": "Select the Employee for whom you are creating the Appraisal.",
+ "description": "",
"fieldname": "employee",
"fieldtype": "Link",
"hidden": 0,
@@ -276,7 +276,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -497,7 +497,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-04 02:08:11.258389",
+ "modified": "2016-04-13 01:49:09.748819",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",
@@ -570,5 +570,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "employee",
- "title_field": "employee_name"
+ "title_field": "employee_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.js b/erpnext/hr/doctype/appraisal_template/appraisal_template.js
new file mode 100644
index 0000000..cc77292
--- /dev/null
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Appraisal Template', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.json b/erpnext/hr/doctype/appraisal_template/appraisal_template.json
index 4903c58..4ecd838 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template.json
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.json
@@ -17,6 +17,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Appraisal Template Title",
@@ -26,6 +27,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -41,6 +43,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Description",
@@ -50,6 +53,7 @@
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"report_hide": 0,
@@ -67,6 +71,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Goals",
@@ -77,9 +82,10 @@
"options": "Appraisal Template Goal",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -95,7 +101,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:41.974626",
+ "modified": "2016-04-13 01:49:21.815151",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal Template",
@@ -123,5 +129,7 @@
}
],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 0fedfd6..5c241fb 100755
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -4,6 +4,7 @@
frappe.provide("erpnext.hr");
erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
setup: function() {
+ this.frm.hide_first = true;
this.frm.fields_dict.user_id.get_query = function(doc, cdt, cdn) {
return { query:"frappe.core.doctype.user.user.user_query"} }
this.frm.fields_dict.reports_to.get_query = function(doc, cdt, cdn) {
@@ -24,12 +25,7 @@
refresh: function() {
var me = this;
erpnext.toggle_naming_series();
- if(!this.frm.doc.__islocal && this.frm.doc.__onload &&
- !this.frm.doc.__onload.salary_structure_exists) {
- cur_frm.add_custom_button(__('Salary Structure'), function() {
- me.make_salary_structure(this); }, __("Make"));
- cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
- }
+ this.frm.dashboard.show_links();
},
date_of_birth: function() {
diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json
index 9e5a533..2677ac0 100644
--- a/erpnext/hr/doctype/employee/employee.json
+++ b/erpnext/hr/doctype/employee/employee.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +42,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Employee",
@@ -64,6 +66,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -90,6 +93,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Salutation",
@@ -116,6 +120,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Full Name",
@@ -137,10 +142,62 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "image",
- "fieldtype": "Attach Image",
+ "fieldname": "company",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "System User (login) ID. If set, it will become default for all HR forms.",
+ "fieldname": "user_id",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "User ID",
+ "length": 0,
+ "no_copy": 0,
+ "options": "User",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
@@ -165,6 +222,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -184,35 +242,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "System User (login) ID. If set, it will become default for all HR forms.",
- "fieldname": "user_id",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "User ID",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "employee_number",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Employee Number",
@@ -238,6 +272,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Date of Joining",
@@ -264,6 +299,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Date of Birth",
@@ -289,6 +325,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Gender",
@@ -311,34 +348,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "employment_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Employment Details",
@@ -363,6 +377,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Status",
@@ -389,6 +404,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Employment Type",
@@ -416,6 +432,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Holiday List",
@@ -442,6 +459,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -464,6 +482,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Offer Date",
@@ -489,6 +508,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Confirmation Date",
@@ -514,6 +534,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Contract End Date",
@@ -539,6 +560,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Date Of Retirement",
@@ -564,6 +586,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Job Profile",
@@ -587,6 +610,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Branch",
@@ -613,6 +637,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Department",
@@ -639,6 +664,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Designation",
@@ -666,6 +692,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company Email",
@@ -692,6 +719,7 @@
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Notice (days)",
@@ -717,6 +745,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Salary Information",
@@ -742,6 +771,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Salary Mode",
@@ -769,6 +799,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Bank Name",
@@ -795,6 +826,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Bank A/C No.",
@@ -820,6 +852,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Organization Profile",
@@ -843,6 +876,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reports to",
@@ -870,6 +904,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Leave Approvers",
@@ -894,6 +929,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Details",
@@ -917,6 +953,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Cell Number",
@@ -940,6 +977,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Personal Email",
@@ -964,6 +1002,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Unsubscribed",
@@ -987,6 +1026,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Emergency Contact",
@@ -1010,6 +1050,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Relation",
@@ -1033,6 +1074,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Emergency Phone",
@@ -1056,6 +1098,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -1079,6 +1122,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Permanent Address Is",
@@ -1103,6 +1147,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Permanent Address",
@@ -1126,6 +1171,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Address Is",
@@ -1150,6 +1196,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Address",
@@ -1173,6 +1220,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -1197,6 +1245,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Bio",
@@ -1220,6 +1269,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Personal Details",
@@ -1243,6 +1293,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Passport Number",
@@ -1266,6 +1317,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Date of Issue",
@@ -1289,6 +1341,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid Upto",
@@ -1312,6 +1365,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Place of Issue",
@@ -1335,6 +1389,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -1358,6 +1413,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Marital Status",
@@ -1382,6 +1438,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Blood Group",
@@ -1407,6 +1464,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Family Background",
@@ -1431,6 +1489,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Health Details",
@@ -1454,6 +1513,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Educational Qualification",
@@ -1477,6 +1537,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Education",
@@ -1501,6 +1562,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Previous Work Experience",
@@ -1525,6 +1587,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "External Work History",
@@ -1549,6 +1612,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "History In Company",
@@ -1573,6 +1637,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Internal Work History",
@@ -1597,6 +1662,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exit",
@@ -1621,6 +1687,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Resignation Letter Date",
@@ -1646,6 +1713,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Relieving Date",
@@ -1671,6 +1739,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reason for Leaving",
@@ -1696,6 +1765,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Leave Encashed?",
@@ -1722,6 +1792,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Encashment Date",
@@ -1747,6 +1818,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exit Interview Details",
@@ -1773,6 +1845,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Held On",
@@ -1798,6 +1871,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reason for Resignation",
@@ -1824,6 +1898,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "New Workplace",
@@ -1849,6 +1924,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Feedback",
@@ -1870,14 +1946,15 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-user",
- "idx": 1,
+ "idx": 24,
+ "image_field": "image",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-17 02:08:05.979565",
+ "modified": "2016-04-04 06:44:59.778649",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee",
@@ -1950,5 +2027,6 @@
"search_fields": "employee_name",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "employee_name"
+ "title_field": "employee_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 9e6afff..9e02baf 100755
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -19,8 +19,7 @@
class Employee(Document):
def onload(self):
- self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
- {"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]})
+ self.set_onload('links', self.meta.get_links_setup())
def autoname(self):
naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by")
@@ -133,11 +132,11 @@
def validate_for_enabled_user_id(self):
if not self.status == 'Active':
return
- enabled = frappe.db.sql("""select name from `tabUser` where
- name=%s and enabled=1""", self.user_id)
- if not enabled:
- throw(_("User {0} is disabled").format(
- self.user_id), EmployeeUserDisabledError)
+ enabled = frappe.db.get_value("User", self.user_id, "enabled")
+ if enabled is None:
+ frappe.throw(_("User {0} does not exist").format(self.user_id))
+ if enabled == 0:
+ frappe.throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
def validate_duplicate_user_id(self):
employee = frappe.db.sql_list("""select name from `tabEmployee` where
@@ -158,6 +157,28 @@
def on_trash(self):
delete_events(self.doctype, self.name)
+ def get_timeline_data(self):
+ '''returns timeline data based on attendance'''
+ return
+
+@frappe.whitelist()
+def get_dashboard_data(name):
+ '''load dashboard related data'''
+ frappe.has_permission(doc=frappe.get_doc('Employee', name), throw=True)
+
+ from frappe.desk.notifications import get_open_count
+ return {
+ 'count': get_open_count('Employee', name),
+ 'timeline_data': get_timeline_data(name),
+ }
+
+def get_timeline_data(name):
+ '''Return timeline for attendance'''
+ return dict(frappe.db.sql('''select unix_timestamp(att_date), count(*)
+ from `tabAttendance` where employee=%s
+ and att_date > date_sub(curdate(), interval 1 year)
+ and status in ('Present', 'Half Day')
+ group by att_date''', name))
@frappe.whitelist()
def get_retirement_date(date_of_birth=None):
diff --git a/erpnext/hr/doctype/employee/employee_links.py b/erpnext/hr/doctype/employee/employee_links.py
new file mode 100644
index 0000000..0e13c31
--- /dev/null
+++ b/erpnext/hr/doctype/employee/employee_links.py
@@ -0,0 +1,23 @@
+from frappe import _
+
+links = {
+ 'fieldname': 'employee',
+ 'transactions': [
+ {
+ 'label': _('Leave and Attendance'),
+ 'items': ['Attendance', 'Leave Application', 'Leave Allocation']
+ },
+ {
+ 'label': _('Payroll'),
+ 'items': ['Salary Structure', 'Salary Slip']
+ },
+ {
+ 'label': _('Expense'),
+ 'items': ['Expense Claim']
+ },
+ {
+ 'label': _('Evaluation'),
+ 'items': ['Appraisal']
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index 16e78a6..d6bb12e 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -39,7 +39,7 @@
d1.account_type = r.message.account_type;
}
- loaddoc('Journal Entry', jv.name);
+ frappe.set_route('Form', 'Journal Entry', jv.name);
}
});
}
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 6882034..fee39aa 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -239,7 +239,7 @@
def notify(self, args):
args = frappe._dict(args)
- from frappe.desk.page.messages.messages import post
+ from frappe.desk.page.chat.chat import post
post(**{"txt": args.message, "contact": args.message_to, "subject": args.subject,
"notify": cint(self.follow_via_email)})
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 905ec21..88796a2 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -2,7 +2,16 @@
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch('employee', 'company', 'company');
-cur_frm.add_fetch('company', 'default_letter_head', 'letter_head');
+
+frappe.ui.form.on("Salary Slip", {
+ company: function(frm) {
+ var company = locals[':Company'][frm.doc.company];
+ if(!frm.doc.letter_head && company.default_letter_head) {
+ frm.set_value('letter_head', company.default_letter_head);
+ }
+ }
+})
+
// On load
// -------------------------------------------------------------------
@@ -76,8 +85,8 @@
var total_earn = 0;
for(var i = 0; i < tbl.length; i++){
if(cint(tbl[i].e_depends_on_lwp) == 1) {
- tbl[i].e_modified_amount = Math.round(tbl[i].e_amount)*(flt(doc.payment_days) /
- cint(doc.total_days_in_month)*100)/100;
+ tbl[i].e_modified_amount = Math.round(tbl[i].e_amount)*(flt(doc.payment_days) /
+ cint(doc.total_days_in_month)*100)/100;
refresh_field('e_modified_amount', tbl[i].name, 'earnings');
} else if(reset_amount) {
tbl[i].e_modified_amount = tbl[i].e_amount;
@@ -106,7 +115,7 @@
total_ded += flt(tbl[i].d_modified_amount);
}
doc.total_deduction = total_ded;
- refresh_field('total_deduction');
+ refresh_field('total_deduction');
}
// Calculate net payable amount
@@ -137,5 +146,5 @@
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
return{
query: "erpnext.controllers.queries.employee_query"
- }
+ }
}
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index e83d442..76ad96e 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -820,7 +820,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
@@ -874,14 +874,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 9,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-18 16:02:55.254165",
+ "modified": "2016-04-06 03:10:12.181480",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip",
@@ -954,5 +954,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "employee",
- "title_field": "employee_name"
+ "title_field": "employee_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index bd379e2..e833e46 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -315,7 +315,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -807,7 +807,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-18 05:09:50.749754",
+ "modified": "2016-03-30 03:50:02.164476",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
@@ -858,5 +858,6 @@
"read_only_onload": 0,
"search_fields": "item",
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 24a21d9..94990fe 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -15,14 +15,23 @@
class BOM(Document):
def autoname(self):
- last_name = frappe.db.sql("""select max(name) from `tabBOM`
- where name like "BOM/{0}/%%" and item=%s
- """.format(frappe.db.escape(self.item, percent=False)), self.item)
- if last_name:
- idx = cint(cstr(last_name[0][0]).split('/')[-1].split('-')[0]) + 1
+ names = frappe.db.sql("""select name from `tabBOM`
+ where item=%s""", self.item)
+
+ if names:
+ # name can be BOM/ITEM/001, BOM/ITEM/001-1, BOM-ITEM-001, BOM-ITEM-001-1
+
+ # split by item
+ names = [name[0].split(self.item)[-1][1:] for name in names]
+
+ # split by (-) if cancelled
+ names = [cint(name.split('-')[-1]) for name in names]
+
+ idx = max(names) + 1
else:
idx = 1
- self.name = 'BOM/' + self.item + ('/%.3i' % idx)
+
+ self.name = 'BOM-' + self.item + ('-%.3i' % idx)
def validate(self):
self.clear_operations()
@@ -56,7 +65,7 @@
self.manage_default_bom()
def get_item_det(self, item_code):
- item = frappe.db.sql("""select name, item_name, is_asset_item, is_purchase_item,
+ item = frappe.db.sql("""select name, item_name, is_fixed_asset, is_purchase_item,
docstatus, description, image, is_sub_contracted_item, stock_uom, default_bom,
last_purchase_rate
from `tabItem` where name=%s""", item_code, as_dict = 1)
diff --git a/erpnext/manufacturing/doctype/bom/test_records.json b/erpnext/manufacturing/doctype/bom/test_records.json
index ecd14ab..30be2a7 100644
--- a/erpnext/manufacturing/doctype/bom/test_records.json
+++ b/erpnext/manufacturing/doctype/bom/test_records.json
@@ -77,7 +77,7 @@
},
{
"amount": 2000.0,
- "bom_no": "BOM/_Test Item Home Desktop Manufactured/001",
+ "bom_no": "BOM-_Test Item Home Desktop Manufactured-001",
"doctype": "BOM Item",
"item_code": "_Test Item Home Desktop Manufactured",
"parentfield": "items",
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index d2e95fa..404ae38 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -6,6 +6,7 @@
frm.doc.status = 'Draft';
frm.add_fetch("sales_order", "delivery_date", "expected_delivery_date");
+ frm.add_fetch("sales_order", "project", "project");
if(frm.doc.__islocal) {
frm.set_value({
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json
index 02467ef..14e3674 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.json
+++ b/erpnext/manufacturing/doctype/production_order/production_order.json
@@ -51,7 +51,7 @@
"no_copy": 0,
"options": "PRO-",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -162,7 +162,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -1036,7 +1036,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-18 05:10:07.951138",
+ "modified": "2016-04-06 05:44:08.681263",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",
@@ -1086,5 +1086,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
- "title_field": "production_item"
+ "title_field": "production_item",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 5614f37..e20019c 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -42,7 +42,6 @@
self.validate_sales_order()
self.validate_warehouse()
self.calculate_operating_cost()
- self.validate_delivery_date()
self.validate_qty()
self.validate_operation_time()
@@ -51,13 +50,15 @@
def validate_sales_order(self):
if self.sales_order:
- so = frappe.db.sql("""select name, delivery_date from `tabSales Order`
+ so = frappe.db.sql("""select name, delivery_date, project from `tabSales Order`
where name=%s and docstatus = 1""", self.sales_order, as_dict=1)
if len(so):
if not self.expected_delivery_date:
self.expected_delivery_date = so[0].delivery_date
+ self.project = so[0].project
+
self.validate_production_order_against_so()
else:
frappe.throw(_("Sales Order {0} is not valid").format(self.sales_order))
@@ -152,7 +153,7 @@
frappe.throw(_("Work-in-Progress Warehouse is required before Submit"))
if not self.fg_warehouse:
frappe.throw(_("For Warehouse is required before Submit"))
-
+
frappe.db.set(self,'status', 'Submitted')
self.make_time_logs()
self.update_completed_qty_in_material_request()
@@ -180,11 +181,11 @@
update_bin_qty(self.production_item, self.fg_warehouse, {
"planned_qty": get_planned_qty(self.production_item, self.fg_warehouse)
})
-
+
if self.material_request:
mr_obj = frappe.get_doc("Material Request", self.material_request)
mr_obj.update_requested_qty([self.material_request_item])
-
+
def update_completed_qty_in_material_request(self):
if self.material_request:
frappe.get_doc("Material Request", self.material_request).update_completed_qty([self.material_request_item])
@@ -265,7 +266,7 @@
# if time log needs to be moved, make sure that the from time is not the same
if _from_time == time_log.from_time:
- frappe.throw("Capacity Planning Error")
+ frappe.throw(_("Capacity Planning Error"))
d.planned_start_time = time_log.from_time
d.planned_end_time = time_log.to_time
@@ -323,11 +324,6 @@
self.actual_start_date = None
self.actual_end_date = None
- def validate_delivery_date(self):
- if self.planned_start_date and self.expected_delivery_date \
- and getdate(self.expected_delivery_date) < getdate(self.planned_start_date):
- frappe.msgprint(_("Expected Delivery Date is lesser than Planned Start Date."))
-
def delete_time_logs(self):
for time_log in frappe.get_all("Time Log", ["name"], {"production_order": self.name}):
frappe.delete_doc("Time Log", time_log.name)
diff --git a/erpnext/manufacturing/doctype/production_order/test_records.json b/erpnext/manufacturing/doctype/production_order/test_records.json
index e744e3b..720787b 100644
--- a/erpnext/manufacturing/doctype/production_order/test_records.json
+++ b/erpnext/manufacturing/doctype/production_order/test_records.json
@@ -1,12 +1,12 @@
[
{
- "bom_no": "BOM/_Test FG Item/001",
- "company": "_Test Company",
- "doctype": "Production Order",
- "fg_warehouse": "_Test Warehouse 1 - _TC",
- "production_item": "_Test FG Item",
- "qty": 10.0,
- "stock_uom": "_Test UOM",
+ "bom_no": "BOM-_Test FG Item-001",
+ "company": "_Test Company",
+ "doctype": "Production Order",
+ "fg_warehouse": "_Test Warehouse 1 - _TC",
+ "production_item": "_Test FG Item",
+ "qty": 10.0,
+ "stock_uom": "_Test UOM",
"wip_warehouse": "_Test Warehouse - _TC"
}
-]
\ No newline at end of file
+]
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
index 6824013..5b97397 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
@@ -18,6 +18,10 @@
cur_frm.add_fetch("sales_order", "base_grand_total", "grand_total");
frappe.ui.form.on("Production Planning Tool", {
+ onload_post_render: function(frm) {
+ frm.get_field("items").grid.set_multiple_add("item_code", "planned_qty");
+ },
+
get_sales_orders: function(frm) {
frappe.call({
doc: frm.doc,
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json
index 9ccd55e..8817f65 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json
@@ -12,11 +12,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "default": "Sales Order",
+ "default": "",
"fieldname": "get_items_from",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items From",
@@ -44,6 +45,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Filters",
@@ -67,6 +69,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item",
@@ -92,6 +95,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Customer",
@@ -117,6 +121,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse",
@@ -143,6 +148,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
@@ -167,6 +173,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -190,6 +197,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "From Date",
@@ -213,6 +221,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "To Date",
@@ -233,10 +242,38 @@
"bold": 0,
"collapsible": 0,
"depends_on": "eval: doc.get_items_from == \"Sales Order\"",
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Project",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval: doc.get_items_from == \"Sales Order\"",
"fieldname": "section_break1",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -261,6 +298,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Sales Orders",
@@ -285,6 +323,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Orders",
@@ -310,6 +349,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -334,6 +374,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Material Request",
@@ -359,6 +400,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Requests",
@@ -384,6 +426,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Select Items",
@@ -408,6 +451,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items",
@@ -435,6 +479,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Use Multi-Level BOM",
@@ -458,6 +503,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -483,6 +529,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Production Orders",
@@ -507,6 +554,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Create Production Orders",
@@ -532,6 +580,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Requirement",
@@ -555,6 +604,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Request For Warehouse",
@@ -580,6 +630,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Create Material Requests",
@@ -605,6 +656,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Download Materials Required",
@@ -631,7 +683,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-23 02:37:51.260645",
+ "modified": "2016-03-16 06:18:50.179089",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Planning Tool",
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index e424695..e482cc3 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -32,6 +32,8 @@
so_filter += " and so.transaction_date <= %(to_date)s"
if self.customer:
so_filter += " and so.customer = %(customer)s"
+ if self.project:
+ so_filter += " and so.project = %(project)s"
if self.fg_item:
item_filter += " and item.name = %(item)s"
@@ -53,6 +55,7 @@
"from_date": self.from_date,
"to_date": self.to_date,
"customer": self.customer,
+ "project": self.project,
"item": self.fg_item,
"company": self.company
}, as_dict=1)
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 1b9cbe5..125be60 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -258,4 +258,8 @@
erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list
erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po
erpnext.patches.v6_27.fix_recurring_order_status
+erpnext.patches.v6_20x.remove_customer_supplier_roles
+erpnext.patches.v6_24.rename_item_field
+erpnext.patches.v7_0.update_party_status
+erpnext.patches.v7_0.update_item_projected
erpnext.patches.v6_20x.update_product_bundle_description
diff --git a/erpnext/patches/v6_20x/remove_customer_supplier_roles.py b/erpnext/patches/v6_20x/remove_customer_supplier_roles.py
new file mode 100644
index 0000000..e5e3d3f
--- /dev/null
+++ b/erpnext/patches/v6_20x/remove_customer_supplier_roles.py
@@ -0,0 +1,18 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ for role in ('Customer', 'Supplier'):
+ frappe.db.sql('''delete from `tabUserRole`
+ where role=%s and parent in ("Administrator", "Guest")''', role)
+
+ if not frappe.db.sql('select name from `tabUserRole` where role=%s', role):
+
+ # delete DocPerm
+ for doctype in frappe.db.sql('select parent from tabDocPerm where role=%s', role):
+ d = frappe.get_doc("DocType", doctype[0])
+ d.permissions = [p for p in d.permissions if p.role != role]
+ d.save()
+
+ # delete Role
+ frappe.delete_doc_if_exists('Role', role)
diff --git a/erpnext/patches/v6_24/rename_item_field.py b/erpnext/patches/v6_24/rename_item_field.py
new file mode 100644
index 0000000..1425d8f
--- /dev/null
+++ b/erpnext/patches/v6_24/rename_item_field.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
+from frappe.model.utils.rename_field import rename_field
+
+def execute():
+ frappe.reload_doctype("Item")
+ rename_field("Item", "is_asset_item", "is_fixed_asset")
\ No newline at end of file
diff --git a/erpnext/patches/v6_27/fix_recurring_order_status.py b/erpnext/patches/v6_27/fix_recurring_order_status.py
index c67973a..5843c9f 100644
--- a/erpnext/patches/v6_27/fix_recurring_order_status.py
+++ b/erpnext/patches/v6_27/fix_recurring_order_status.py
@@ -11,41 +11,44 @@
"stock_doctype": "Delivery Note",
"invoice_doctype": "Sales Invoice",
"stock_doctype_ref_field": "against_sales_order",
- "invoice_ref_field": "sales_order"
+ "invoice_ref_field": "sales_order",
+ "qty_field": "delivered_qty"
},
{
"doctype": "Purchase Order",
"stock_doctype": "Purchase Receipt",
"invoice_doctype": "Purchase Invoice",
"stock_doctype_ref_field": "prevdoc_docname",
- "invoice_ref_field": "purchase_order"
+ "invoice_ref_field": "purchase_order",
+ "qty_field": "received_qty"
}):
-
- order_list = frappe.db.sql("""select name from `tab{0}`
- where docstatus=1 and is_recurring=1
+
+ order_list = frappe.db.sql("""select name from `tab{0}`
+ where docstatus=1 and is_recurring=1
and ifnull(recurring_id, '') != name and creation >= '2016-01-25'"""
.format(doc["doctype"]), as_dict=1)
-
+
for order in order_list:
- frappe.db.sql("""update `tab{0} Item`
- set delivered_qty=0, billed_amt=0 where parent=%s""".format(doc["doctype"]), order.name)
-
+ frappe.db.sql("""update `tab{0} Item`
+ set {1}=0, billed_amt=0 where parent=%s""".format(doc["doctype"],
+ doc["qty_field"]), order.name)
+
# Check against Delivery Note and Purchase Receipt
- stock_doc_list = frappe.db.sql("""select distinct parent from `tab{0} Item`
+ stock_doc_list = frappe.db.sql("""select distinct parent from `tab{0} Item`
where docstatus=1 and ifnull({1}, '')=%s"""
.format(doc["stock_doctype"], doc["stock_doctype_ref_field"]), order.name)
-
+
if stock_doc_list:
for dn in stock_doc_list:
frappe.get_doc(doc["stock_doctype"], dn[0]).update_qty(update_modified=False)
-
+
# Check against Invoice
- invoice_list = frappe.db.sql("""select distinct parent from `tab{0} Item`
+ invoice_list = frappe.db.sql("""select distinct parent from `tab{0} Item`
where docstatus=1 and ifnull({1}, '')=%s"""
.format(doc["invoice_doctype"], doc["invoice_ref_field"]), order.name)
-
+
if invoice_list:
for dn in invoice_list:
frappe.get_doc(doc["invoice_doctype"], dn[0]).update_qty(update_modified=False)
-
+
frappe.get_doc(doc["doctype"], order.name).set_status(update=True, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/__init__.py b/erpnext/patches/v7_0/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v7_0/__init__.py
diff --git a/erpnext/patches/v7_0/update_item_projected.py b/erpnext/patches/v7_0/update_item_projected.py
new file mode 100644
index 0000000..71b54af
--- /dev/null
+++ b/erpnext/patches/v7_0/update_item_projected.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ frappe.reload_doctype("Item")
+ from erpnext.stock.doctype.bin.bin import update_item_projected_qty
+ for item in frappe.get_all("Item", filters={"is_stock_item": 1}):
+ update_item_projected_qty(item.name)
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/update_party_status.py b/erpnext/patches/v7_0/update_party_status.py
new file mode 100644
index 0000000..1307377
--- /dev/null
+++ b/erpnext/patches/v7_0/update_party_status.py
@@ -0,0 +1,9 @@
+import frappe
+from erpnext.accounts.party_status import update_status
+
+def execute():
+ for doctype in ('Customer', 'Supplier'):
+ frappe.reload_doctype(doctype)
+ for doc in frappe.get_all(doctype):
+ doc = frappe.get_doc(doctype, doc.name)
+ update_status(doc)
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index d190f34..e4ac864 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -11,6 +11,57 @@
"project_name": frm.doc.name
}
}
+
+ frm.set_query('customer', 'erpnext.controllers.queries.customer_query');
+
+ // sales order
+ frm.set_query('sales_order', function() {
+ var filters = {
+ 'project': ["in", frm.doc.__islocal ? [""] : [frm.doc.name, ""]]
+ };
+
+ if (frm.doc.customer) {
+ filters["customer"] = frm.doc.customer;
+ }
+
+ return {
+ filters: filters
+ }
+ });
+ },
+ refresh: function(frm) {
+ if(frm.doc.__islocal) {
+ frm.web_link && frm.web_link.remove();
+ } else {
+ frm.add_web_link("/projects?project=" + encodeURIComponent(frm.doc.name));
+
+ if(frappe.model.can_read("Task")) {
+ frm.add_custom_button(__("Gantt Chart"), function() {
+ frappe.route_options = {"project": frm.doc.name,
+ "start": frm.doc.expected_start_date, "end": frm.doc.expected_end_date};
+ frappe.set_route("Gantt", "Task");
+ }, __("View"), true);
+ frm.add_custom_button(__("Tasks"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Task");
+ }, __("View"), true);
+ }
+
+ if(frappe.model.can_read("Time Log")) {
+ frm.add_custom_button(__("Time Logs"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Time Log");
+ }, __("View"), true);
+ }
+
+ if(frappe.model.can_read("Expense Claim")) {
+ frm.add_custom_button(__("Expense Claims"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Expense Claim");
+ }, __("View"), true);
+ }
+ }
+
}
});
@@ -23,51 +74,3 @@
}
})
-// show tasks
-cur_frm.cscript.refresh = function(doc) {
- if(!doc.__islocal) {
- if(frappe.model.can_read("Task")) {
- cur_frm.add_custom_button(__("Gantt Chart"), function() {
- frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date};
- frappe.set_route("Gantt", "Task");
- }, __("View"), true);
- cur_frm.add_custom_button(__("Tasks"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Task");
- }, __("View"), true);
- }
- if(frappe.model.can_read("Time Log")) {
- cur_frm.add_custom_button(__("Time Logs"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Time Log");
- }, __("View"), true);
- }
-
- if(frappe.model.can_read("Expense Claim")) {
- cur_frm.add_custom_button(__("Expense Claims"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Expense Claim");
- }, __("View"), true);
- }
- }
-}
-
-cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
- return{
- query: "erpnext.controllers.queries.customer_query"
- }
-}
-
-cur_frm.fields_dict['sales_order'].get_query = function(doc) {
- var filters = {
- 'project': ["in", doc.__islocal ? [""] : [doc.name, ""]]
- };
-
- if (doc.customer) {
- filters["customer"] = doc.customer;
- }
-
- return {
- filters: filters
- }
-}
diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json
index 1f1943c..ada5909 100644
--- a/erpnext/projects/doctype/project/project.json
+++ b/erpnext/projects/doctype/project/project.json
@@ -326,6 +326,58 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "fieldname": "users_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Users",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Project will be accessible on the website to these users",
+ "fieldname": "users",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Users",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project User",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "sb_milestones",
"fieldtype": "Section Break",
@@ -914,14 +966,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-puzzle-piece",
- "idx": 1,
+ "idx": 24,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 4,
- "modified": "2016-03-10 05:10:21.779365",
+ "modified": "2016-03-31 01:34:05.703925",
"modified_by": "Administrator",
"module": "Projects",
"name": "Project",
@@ -972,5 +1024,6 @@
"read_only_onload": 0,
"search_fields": "customer, status, priority, is_active",
"sort_order": "DESC",
- "timeline_field": "customer"
+ "timeline_field": "customer",
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index ec4f523..a74cbee 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.utils import flt, getdate
+from frappe.utils import flt, getdate, get_url
from frappe import _
from frappe.model.document import Document
@@ -36,6 +36,7 @@
self.validate_dates()
self.sync_tasks()
self.tasks = []
+ self.send_welcome_email()
def validate_dates(self):
if self.expected_start_date and self.expected_end_date:
@@ -79,7 +80,7 @@
self.update_percent_complete()
self.update_costing()
self.flags.dont_sync_tasks = True
- self.save()
+ self.save(ignore_permissions = True)
def update_percent_complete(self):
total = frappe.db.sql("""select count(*) from tabTask where project=%s""", self.name)[0][0]
@@ -124,6 +125,46 @@
self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0
+ def send_welcome_email(self):
+ url = get_url("/project/?name={0}".format(self.name))
+ messages = (
+ _("You have been invited to collaborate on the project: {0}".format(self.name)),
+ url,
+ _("Join")
+ )
+
+ content = """
+ <p>{0}.</p>
+ <p><a href="{1}">{2}</a></p>
+ """
+
+ for user in self.users:
+ if user.welcome_email_sent==0:
+ frappe.sendmail(user.user, subject=_("Project Collaboration Invitation"), content=content.format(*messages), bulk=True)
+ user.welcome_email_sent=1
+
+
+def get_project_list(doctype, txt, filters, limit_start, limit_page_length=20):
+ return frappe.db.sql('''select distinct project.*
+ from tabProject project, `tabProject User` project_user
+ where
+ (project_user.user = %(user)s
+ and project_user.parent = project.name)
+ or project.owner = %(user)s
+ order by project.modified desc
+ limit {0}, {1}
+ '''.format(limit_start, limit_page_length),
+ {'user':frappe.session.user},
+ as_dict=True,
+ update={'doctype':'Project'})
+
+def get_list_context(context=None):
+ return {
+ "title": _("My Projects"),
+ "get_list": get_project_list,
+ "row_template": "templates/includes/projects/project_row.html"
+ }
+
@frappe.whitelist()
def get_cost_center_name(project):
return frappe.db.get_value("Project", project, "cost_center")
diff --git a/erpnext/projects/doctype/project_user/__init__.py b/erpnext/projects/doctype/project_user/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/projects/doctype/project_user/__init__.py
diff --git a/erpnext/projects/doctype/project_user/project_user.json b/erpnext/projects/doctype/project_user/project_user.json
new file mode 100644
index 0000000..39863fd
--- /dev/null
+++ b/erpnext/projects/doctype/project_user/project_user.json
@@ -0,0 +1,84 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2016-03-25 02:52:19.283003",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "User",
+ "length": 0,
+ "no_copy": 0,
+ "options": "User",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "welcome_email_sent",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Welcome email sent",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2016-03-28 17:33:08.621181",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Project User",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project_user/project_user.py b/erpnext/projects/doctype/project_user/project_user.py
new file mode 100644
index 0000000..3198f3b
--- /dev/null
+++ b/erpnext/projects/doctype/project_user/project_user.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class ProjectUser(Document):
+ pass
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index 9816df8..31d6538 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -17,6 +17,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Subject",
@@ -36,12 +37,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "project",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Project",
@@ -68,6 +70,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -93,6 +96,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
@@ -119,6 +123,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Priority",
@@ -145,6 +150,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -168,6 +174,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expected Start Date",
@@ -195,6 +202,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expected Time (in hours)",
@@ -220,6 +228,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -243,6 +252,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Expected End Date",
@@ -268,6 +278,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -292,6 +303,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Details",
@@ -319,6 +331,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Depends On",
@@ -343,6 +356,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "depends_on",
@@ -369,6 +383,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -395,6 +410,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Start Date (via Time Logs)",
@@ -422,6 +438,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual Time (in hours)",
@@ -447,6 +464,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -470,6 +488,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actual End Date (via Time Logs)",
@@ -495,6 +514,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -518,6 +538,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Costing Amount (via Time Logs)",
@@ -544,6 +565,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Expense Claim (via Expense Claim)",
@@ -569,6 +591,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -592,6 +615,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Billing Amount (via Time Logs)",
@@ -616,6 +640,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -640,6 +665,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Review Date",
@@ -666,6 +692,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Closing Date",
@@ -691,6 +718,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -713,6 +741,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
@@ -741,7 +770,7 @@
"istable": 0,
"max_attachments": 5,
"menu_index": 0,
- "modified": "2016-02-03 01:11:46.043538",
+ "modified": "2016-03-29 01:01:50.074252",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
@@ -773,5 +802,6 @@
"search_fields": "subject",
"sort_order": "DESC",
"timeline_field": "project",
- "title_field": "subject"
+ "title_field": "subject",
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js
index 48a4655..212aec0 100644
--- a/erpnext/projects/doctype/task/task_list.js
+++ b/erpnext/projects/doctype/task/task_list.js
@@ -1,5 +1,6 @@
frappe.listview_settings['Task'] = {
add_fields: ["project", "status", "priority", "exp_end_date"],
+ filters: [["status", "=", "Open"]],
onload: function(listview) {
var method = "erpnext.projects.doctype.task.task.set_multiple_status";
diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json
index fb1a710..21e68cc 100644
--- a/erpnext/projects/doctype/time_log/time_log.json
+++ b/erpnext/projects/doctype/time_log/time_log.json
@@ -19,6 +19,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Activity Type",
@@ -43,6 +44,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -68,6 +70,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Project",
@@ -93,6 +96,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Task",
@@ -117,6 +121,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Status",
@@ -141,6 +146,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -164,6 +170,7 @@
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "From Time",
@@ -188,6 +195,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Hours",
@@ -211,6 +219,7 @@
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "To Time",
@@ -234,6 +243,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billable",
@@ -257,6 +267,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -279,6 +290,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Note",
@@ -302,6 +314,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -325,6 +338,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "User",
@@ -350,6 +364,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Employee",
@@ -375,6 +390,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -397,6 +413,7 @@
"fieldtype": "Check",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "For Manufacturing",
@@ -422,6 +439,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -446,6 +464,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Production Order",
@@ -472,6 +491,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operation",
@@ -498,6 +518,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Operation ID",
@@ -523,6 +544,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -547,6 +569,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Workstation",
@@ -574,6 +597,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Completed Qty",
@@ -599,6 +623,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -624,6 +649,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Costing Rate based on Activity Type (per hour)",
@@ -649,6 +675,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Costing Amount",
@@ -673,6 +700,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -698,6 +726,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billing Rate based on Activity Type (per hour)",
@@ -723,6 +752,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Additional Cost",
@@ -749,6 +779,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billing Amount",
@@ -773,6 +804,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -797,6 +829,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Time Log Batch",
@@ -822,6 +855,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Invoice",
@@ -846,6 +880,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -870,6 +905,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
@@ -897,7 +933,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-01-29 04:05:43.489154",
+ "modified": "2016-03-29 15:55:12.780956",
"modified_by": "Administrator",
"module": "Projects",
"name": "Time Log",
@@ -905,7 +941,7 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -917,6 +953,8 @@
"print": 1,
"read": 1,
"report": 1,
+ "restrict": 0,
+ "restricted": 1,
"role": "Projects User",
"set_user_permissions": 0,
"share": 1,
@@ -937,6 +975,8 @@
"print": 1,
"read": 1,
"report": 1,
+ "restrict": 0,
+ "restricted": 0,
"role": "Projects Manager",
"set_user_permissions": 0,
"share": 1,
@@ -947,5 +987,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py
index b2a855d..1d523d9 100644
--- a/erpnext/projects/doctype/time_log/time_log.py
+++ b/erpnext/projects/doctype/time_log/time_log.py
@@ -193,7 +193,7 @@
or self.get_overlap_for("user")
if not overlapping:
- frappe.throw("Logical error: Must find overlapping")
+ frappe.throw(_("Logical error: Must find overlapping"))
self.from_time = get_datetime(overlapping.to_time) + get_mins_between_operations()
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index ff8bf94..b3da719 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -18,6 +18,8 @@
"public/js/pos/pos_bill_item.html",
"public/js/pos/pos_item.html",
"public/js/pos/pos_tax_row.html",
- "public/js/pos/pos.js"
+ "public/js/pos/pos.js",
+ "public/js/utils/item_selector.js",
+ "public/js/templates/item_selector.html"
]
}
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index 621efb5..75fab56 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -13,17 +13,20 @@
margin: -10px auto;
}
/* pos */
+.pos-item-area {
+ padding: 0px 10px;
+}
+.pos-item-wrapper {
+ padding: 5px;
+}
.pos-item {
- display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
padding: 5px;
- height: 0px;
- padding-bottom: 38%;
- width: 30%;
- margin: 1.6%;
+ padding-bottom: 15px;
border: 1px solid #d1d8dd;
+ margin-bottom: 5px;
}
.pos-item-text {
padding: 0px 5px;
@@ -36,7 +39,13 @@
border: 1px dashed #d1d8dd;
}
.pos-item-image {
- padding-bottom: 100%;
+ width: 100%;
+ height: 0px;
+ padding: 50% 0;
+ text-align: center;
+ line-height: 0;
+ color: #d1d8dd;
+ font-size: 30px;
background-size: cover;
border: 1px solid transparent;
background-position: top center;
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index acc70df..78584fa 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -8,6 +8,7 @@
erpnext.TransactionController = erpnext.taxes_and_totals.extend({
onload: function() {
var me = this;
+ //this.frm.show_print_first = true;
if(this.frm.doc.__islocal) {
var today = get_today(),
currency = frappe.defaults.get_user_default("currency");
@@ -31,7 +32,7 @@
});
if(this.frm.doc.company && !this.frm.doc.amended_from) {
- cur_frm.script_manager.trigger("company");
+ this.frm.script_manager.trigger("company");
}
}
@@ -81,7 +82,7 @@
me.calculate_taxes_and_totals();
}
if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) {
- cur_frm.get_field("items").grid.set_multiple_add("item_code", "qty");
+ this.setup_item_selector();
}
},
@@ -449,10 +450,15 @@
this.frm.toggle_reqd("plc_conversion_rate",
!!(this.frm.doc.price_list_name && this.frm.doc.price_list_currency));
- var company_currency = this.get_company_currency();
- this.change_form_labels(company_currency);
- this.change_grid_labels(company_currency);
- this.frm.refresh_fields();
+ if(this.frm.doc_currency!==this.frm.doc.currency) {
+ // reset names only when the currency is different
+
+ var company_currency = this.get_company_currency();
+ this.change_form_labels(company_currency);
+ this.change_grid_labels(company_currency);
+ this.frm.refresh_fields();
+ this.frm.doc_currency = this.frm.doc.currency;
+ }
},
change_form_labels: function(company_currency) {
@@ -651,6 +657,12 @@
"parenttype": d.parenttype,
"parent": d.parent
});
+
+ // if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
+ if (in_list(["Quotation Item", "Sales Order Item", "Delivery Note Item", "Sales Invoice Item"]), d.doctype){
+ item_list[0]["margin_type"] = d.margin_type
+ item_list[0]["margin_rate_or_amount"] = d.margin_rate_or_amount
+ }
}
};
@@ -853,7 +865,7 @@
if(!this.frm.doc.recurring_id) {
this.frm.set_value('recurring_id', this.frm.doc.name);
}
-
+
var owner_email = this.frm.doc.owner=="Administrator"
? frappe.user_info("Administrator").email
: this.frm.doc.owner;
@@ -881,13 +893,22 @@
}
}
},
-
+
set_gross_profit: function(item) {
if (this.frm.doc.doctype == "Sales Order" && item.valuation_rate) {
rate = flt(item.rate) * flt(this.frm.doc.conversion_rate || 1);
item.gross_profit = flt(((rate - item.valuation_rate) * item.qty), precision("amount", item));
}
+ },
+
+ setup_item_selector: function() {
+ if(!this.item_selector) {
+ this.item_selector = new erpnext.ItemSelector({frm: this.frm});
+ }
}
+
+
+
});
frappe.ui.form.on(cur_frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
@@ -899,7 +920,7 @@
} else {
item.discount_percentage = 0.0;
}
-
+
cur_frm.cscript.set_gross_profit(item);
cur_frm.cscript.calculate_taxes_and_totals();
})
@@ -965,5 +986,3 @@
frm.cscript.calculate_taxes_and_totals();
});
-
-
diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html
index d12b9b2..36ef7c9 100644
--- a/erpnext/public/js/pos/pos.html
+++ b/erpnext/public/js/pos/pos.html
@@ -47,7 +47,10 @@
</div>
</div>
</div>
- <div class="col-sm-7 pos-item-area">
+ <div class="col-sm-7 pos-items-section">
+ <div class="row pos-item-area">
+
+ </div>
<div class="row pos-item-toolbar">
<div class="search-area col-xs-12"></div>
</div>
diff --git a/erpnext/public/js/pos/pos.js b/erpnext/public/js/pos/pos.js
index 4e3898f..60801e6 100644
--- a/erpnext/public/js/pos/pos.js
+++ b/erpnext/public/js/pos/pos.js
@@ -86,7 +86,7 @@
only_input: true,
});
this.search.make_input();
- this.search.$input.on("keypress", function() {
+ this.search.$input.on("keyup", function() {
if(!me.search.autocomplete_open)
if(me.item_timeout)
clearTimeout(me.item_timeout);
@@ -131,7 +131,9 @@
item_code: obj.name,
item_price: format_currency(obj.price_list_rate, obj.currency),
item_name: obj.name===obj.item_name ? "" : obj.item_name,
- item_image: obj.image ? "url('" + obj.image + "')" : null
+ item_image: obj.image ? "url('" + obj.image + "')" : null,
+ color: frappe.get_palette(obj.item_name),
+ abbr: frappe.get_abbr(obj.item_name)
})).tooltip().appendTo($wrap);
});
}
diff --git a/erpnext/public/js/pos/pos_item.html b/erpnext/public/js/pos/pos_item.html
index 1235db9..aec36a7 100644
--- a/erpnext/public/js/pos/pos_item.html
+++ b/erpnext/public/js/pos/pos_item.html
@@ -1,9 +1,13 @@
-<div class="pos-item" data-item-code="{%= item_code %}" title="{%= item_name || item_code %}">
- <div class="pos-item-image {% if (!item_image) { %} no-image {% } %}"
- style="{% if (item_image) { %} background-image: {%= item_image %} {% } %}">
+<div class="pos-item-wrapper col-xs-3">
+ <div class="pos-item" data-item-code="{%= item_code %}" title="{%= item_name || item_code %}">
+ <div class="pos-item-image"
+ style="{% if (item_image) { %} background-image: {{ item_image }} {% }
+ else { %} background-color: {{ color }} {% } %}">
+ {% if (!item_image) { %}{{ abbr }}{% } %}
+ </div>
+ <div class="pos-item-text">
+ <h6 class="item-code text-ellipsis">{%= item_name ? (item_name + " (" + item_code + ")") : item_code %}</h6>
+ <div class="small text-ellipsis">{%= item_price %}</div>
+ </div>
</div>
- <div class="pos-item-text">
- <h6 class="item-code text-ellipsis">{%= item_name ? (item_name + " (" + item_code + ")") : item_code %}</h6>
- <div class="small text-ellipsis">{%= item_price %}</div>
- </div>
-</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/public/js/templates/item_selector.html b/erpnext/public/js/templates/item_selector.html
new file mode 100644
index 0000000..47da67c
--- /dev/null
+++ b/erpnext/public/js/templates/item_selector.html
@@ -0,0 +1,16 @@
+<div class="row pos-item-area">
+{% for (var i=0; i < data.length; i++) { var item = data[i]; %}
+<div class="col-xs-3 pos-item-wrapper">
+ <div class="pos-item" data-name="{{ item.name }}">
+ <div class="pos-item-image"
+ {% if(item.image) { %}style="background-image: url({{ item.image }});"{% }
+ else { %}style="background-color: {{ item.color }};"{% } %}>
+ {% if(!item.image) { %}{{ item.abbr }}{% } %}
+ </div>
+ <div class="pos-item-text">
+ <h6 class="item-code text-ellipsis">{{ item.name }}</h6>
+ </div>
+ </div>
+</div>
+{% } %}
+</div>
\ No newline at end of file
diff --git a/erpnext/public/js/utils/item_selector.js b/erpnext/public/js/utils/item_selector.js
new file mode 100644
index 0000000..7d0bd15
--- /dev/null
+++ b/erpnext/public/js/utils/item_selector.js
@@ -0,0 +1,94 @@
+erpnext.ItemSelector = Class.extend({
+ init: function(opts) {
+ $.extend(this, opts);
+
+ this.grid = this.frm.get_field("items").grid;
+ this.setup();
+ },
+
+ setup: function() {
+ var me = this;
+ if(!this.grid.add_items_button) {
+ this.grid.add_items_button = this.grid.add_custom_button(__('Add Items'), function() {
+ if(!me.dialog) {
+ me.make_dialog();
+ }
+ me.dialog.show();
+ me.render_items();
+ });
+ }
+ },
+
+ make_dialog: function() {
+ this.dialog = new frappe.ui.Dialog({
+ title: __('Add Items')
+ });
+ var body = $(this.dialog.body);
+ body.html('<div><p><input type="text" class="form-control"></p>\
+ <br><div class="results"></div></div>');
+
+ this.dialog.input = body.find('.form-control');
+ this.dialog.results = body.find('.results');
+
+ var me = this;
+ this.dialog.results.on('click', '.pos-item', function() {
+ me.add_item($(this).attr('data-name'))
+ });
+
+ this.dialog.input.on('keyup', function() {
+ if(me.timeout_id) {
+ clearTimeout(me.timeout_id);
+ }
+ me.timeout_id = setTimeout(function() {
+ me.render_items();
+ me.timeout_id = undefined;
+ }, 500);
+ });
+ },
+
+ add_item: function(item_code) {
+ // add row or update qty
+ var added = false;
+
+ // find row with item if exists
+ $.each(this.frm.doc.items || [], function(i, d) {
+ if(d.item_code===item_code) {
+ frappe.model.set_value(d.doctype, d.name, 'qty', d.qty + 1);
+ show_alert(__("Added {0} ({1})", [item_code, d.qty]));
+ added = true;
+ return false;
+ }
+ });
+
+ if(!added) {
+ var d = this.grid.add_new_row();
+ frappe.model.set_value(d.doctype, d.name, 'item_code', item_code);
+
+ // after item fetch
+ frappe.after_ajax(function() {
+ setTimeout(function() {
+ frappe.model.set_value(d.doctype, d.name, 'qty', 1);
+ show_alert(__("Added {0} ({1})", [item_code, 1]));
+ }, 100);
+ });
+ }
+
+ },
+
+ render_items: function() {
+ var args = erpnext.queries.item();
+ args.txt = this.dialog.input.val();
+ args.as_dict = 1;
+
+ var me = this;
+ frappe.link_search("Item", args, function(r) {
+ $.each(r.values, function(i, d) {
+ if(!d.image) {
+ d.abbr = frappe.get_abbr(d.item_name);
+ d.color = frappe.get_palette(d.item_name);
+ }
+ });
+ me.dialog.results.html(frappe.render_template('item_selector', {'data':r.values}));
+ });
+ }
+})
\ No newline at end of file
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index d630779..f5496ed 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.utils");
+
erpnext.utils.get_party_details = function(frm, method, args, callback) {
if(!method) {
method = "erpnext.accounts.party.get_party_details";
@@ -162,4 +163,4 @@
}
}
});
-}
+}
\ No newline at end of file
diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less
index 813a567..23ee841 100644
--- a/erpnext/public/less/erpnext.less
+++ b/erpnext/public/less/erpnext.less
@@ -1,3 +1,5 @@
+@import "../../../../frappe/frappe/public/less/variables.less";
+
.erpnext-footer {
margin: 11px auto;
text-align: center;
@@ -16,20 +18,23 @@
}
/* pos */
-.pos {
+
+.pos-item-area {
+ padding: 0px 10px;
+}
+
+.pos-item-wrapper {
+ padding: 5px;
}
.pos-item {
- display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
padding: 5px;
- height: 0px;
- padding-bottom: 38%;
- width: 30%;
- margin: 1.6%;
+ padding-bottom: 15px;
border: 1px solid #d1d8dd;
+ margin-bottom: 5px;
}
.pos-item-text {
@@ -46,7 +51,13 @@
}
.pos-item-image {
- padding-bottom: 100%;
+ width: 100%;
+ height: 0px;
+ padding: 50% 0;
+ text-align: center;
+ line-height: 0;
+ color: @text-extra-muted;
+ font-size: 30px;
background-size: cover;
border: 1px solid transparent;
background-position: top center;
@@ -130,7 +141,7 @@
.discount-field-col {
padding-left: 0px;
}
-
+
.input-group {
margin-top: 2px;
}
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 1d4bd41..95bed47 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -3,10 +3,11 @@
frappe.ui.form.on("Customer", {
before_load: function(frm) {
+ frm.hide_first = true;
frappe.setup_language_field(frm);
},
refresh: function(frm) {
- frm.cscript.setup_dashboard(frm.doc);
+ frm.dashboard.show_links();
if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
frm.toggle_display("naming_series", false);
@@ -29,20 +30,20 @@
frm.events.add_custom_buttons(frm);
},
add_custom_buttons: function(frm) {
- ["Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"].forEach(function(doctype, i) {
- if(frappe.model.can_read(doctype)) {
- frm.add_custom_button(__(doctype), function() {
- frappe.route_options = {"customer": frm.doc.name};
- frappe.set_route("List", doctype);
- }, __("View"));
- }
- if(frappe.model.can_create(doctype)) {
- frm.add_custom_button(__(doctype), function() {
- frappe.route_options = {"customer": frm.doc.name};
- new_doc(doctype);
- }, __("Make"));
- }
- });
+ // ["Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"].forEach(function(doctype, i) {
+ // if(frappe.model.can_read(doctype)) {
+ // frm.add_custom_button(__(doctype), function() {
+ // frappe.route_options = {"customer": frm.doc.name};
+ // frappe.set_route("List", doctype);
+ // }, __("View"));
+ // }
+ // if(frappe.model.can_create(doctype)) {
+ // frm.add_custom_button(__(doctype), function() {
+ // frappe.route_options = {"customer": frm.doc.name};
+ // new_doc(doctype);
+ // }, __("Make"));
+ // }
+ // });
},
validate: function(frm) {
if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
@@ -64,40 +65,6 @@
cur_frm.add_fetch('lead_name', 'company_name', 'customer_name');
cur_frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate');
-cur_frm.cscript.setup_dashboard = function(doc) {
- cur_frm.dashboard.reset(doc);
- if(doc.__islocal)
- return;
- if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager"))
- cur_frm.dashboard.set_headline('<span class="text-muted">'+ __('Loading...')+ '</span>')
-
- cur_frm.dashboard.add_doctype_badge("Opportunity", "customer");
- cur_frm.dashboard.add_doctype_badge("Quotation", "customer");
- cur_frm.dashboard.add_doctype_badge("Sales Order", "customer");
- cur_frm.dashboard.add_doctype_badge("Delivery Note", "customer");
- cur_frm.dashboard.add_doctype_badge("Sales Invoice", "customer");
- cur_frm.dashboard.add_doctype_badge("Project", "customer");
-
- return frappe.call({
- type: "GET",
- method: "erpnext.selling.doctype.customer.customer.get_dashboard_info",
- args: {
- customer: cur_frm.doc.name
- },
- callback: function(r) {
- if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
- cur_frm.dashboard.set_headline(
- __("Total billing this year") + ": <b>"
- + format_currency(r.message.billing_this_year, cur_frm.doc.party_account_currency)
- + '</b> / <span class="text-muted">' + __("Unpaid") + ": <b>"
- + format_currency(r.message.total_unpaid, cur_frm.doc.party_account_currency)
- + '</b></span>');
- }
- cur_frm.dashboard.set_badge_count(r.message);
- }
- });
-}
-
cur_frm.fields_dict['customer_group'].get_query = function(doc, dt, dn) {
return{
filters:{'is_group': 'No'}
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 8e4434b..ff47a79 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -18,9 +18,10 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "",
+ "label": "Name and Type",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
@@ -43,6 +44,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -61,12 +63,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Full Name",
@@ -92,6 +95,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Type",
@@ -118,6 +122,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "From Lead",
@@ -140,10 +145,63 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Active",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Active\nDormant\nOpen",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -168,6 +226,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Customer Group",
@@ -195,6 +254,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Territory",
@@ -221,6 +281,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Tax ID",
@@ -246,6 +307,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
@@ -265,14 +327,15 @@
{
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 0,
+ "collapsible": 1,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "",
+ "label": "Currency and Price List",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -294,6 +357,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billing Currency",
@@ -318,6 +382,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Price List",
@@ -342,6 +407,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -365,6 +431,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Print Language",
@@ -391,6 +458,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address and Contact",
@@ -415,6 +483,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address HTML",
@@ -438,6 +507,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -461,6 +531,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact HTML",
@@ -481,14 +552,15 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
- "collapsible_depends_on": "accounts",
+ "collapsible_depends_on": "",
"fieldname": "default_receivable_accounts",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Default Receivable Accounts",
+ "label": "Accounting",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -511,6 +583,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Accounts",
@@ -536,6 +609,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Limit",
@@ -560,6 +634,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Days Based On",
@@ -586,6 +661,7 @@
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Days",
@@ -611,6 +687,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Credit Limit",
@@ -638,6 +715,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -664,6 +742,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Details",
@@ -689,6 +768,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Website",
@@ -712,6 +792,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Frozen",
@@ -737,6 +818,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Partner and Commission",
@@ -762,6 +844,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Partner",
@@ -788,6 +871,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Commission Rate",
@@ -814,6 +898,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Team",
@@ -838,6 +923,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Team Details",
@@ -860,14 +946,15 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-user",
- "idx": 1,
+ "idx": 363,
+ "image_field": "image",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-22 16:16:41.563405",
+ "modified": "2016-04-13 05:46:36.473341",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
@@ -1058,5 +1145,6 @@
"read_only_onload": 0,
"search_fields": "customer_name,customer_group,territory",
"sort_order": "ASC",
- "title_field": "customer_name"
-}
+ "title_field": "customer_name",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index df91d63..591b9c1 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -10,7 +10,8 @@
from frappe.desk.reportview import build_match_conditions
from erpnext.utilities.transaction_base import TransactionBase
from erpnext.utilities.address_and_contact import load_address_and_contact
-from erpnext.accounts.party import validate_party_accounts
+from erpnext.accounts.party import validate_party_accounts, get_timeline_data
+from erpnext.accounts.party_status import get_party_status
class Customer(TransactionBase):
def get_feed(self):
@@ -19,6 +20,7 @@
def onload(self):
"""Load address and contacts in `__onload`"""
load_address_and_contact(self, "customer")
+ self.set_onload('links', self.meta.get_links_setup())
def autoname(self):
cust_master_name = frappe.defaults.get_global_default('cust_master_name')
@@ -42,6 +44,7 @@
def validate(self):
self.flags.is_new_doc = self.is_new()
validate_party_accounts(self)
+ self.status = get_party_status(self)
def update_lead_status(self):
if self.lead_name:
@@ -125,33 +128,17 @@
{set_field} where customer=%(newdn)s"""\
.format(set_field=set_field), ({"newdn": newdn}))
+
@frappe.whitelist()
-def get_dashboard_info(customer):
- if not frappe.has_permission("Customer", "read", customer):
- frappe.msgprint(_("Not permitted"), raise_exception=True)
+def get_dashboard_data(name):
+ '''load dashboard related data'''
+ frappe.has_permission(doc=frappe.get_doc('Customer', name), throw=True)
- out = {}
- for doctype in ["Opportunity", "Quotation", "Sales Order", "Delivery Note",
- "Sales Invoice", "Project"]:
- out[doctype] = frappe.db.get_value(doctype,
- {"customer": customer, "docstatus": ["!=", 2] }, "count(*)")
-
- billing_this_year = frappe.db.sql("""
- select sum(debit_in_account_currency) - sum(credit_in_account_currency)
- from `tabGL Entry`
- where voucher_type='Sales Invoice' and party_type = 'Customer'
- and party=%s and fiscal_year = %s""",
- (customer, frappe.db.get_default("fiscal_year")))
-
- total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
- from `tabSales Invoice`
- where customer=%s and docstatus = 1""", customer)
-
- out["billing_this_year"] = billing_this_year[0][0] if billing_this_year else 0
- out["total_unpaid"] = total_unpaid[0][0] if total_unpaid else 0
-
- return out
-
+ from frappe.desk.notifications import get_open_count
+ return {
+ 'count': get_open_count('Customer', name),
+ 'timeline_data': get_timeline_data('Customer', name),
+ }
def get_customer_list(doctype, txt, searchfield, start, page_len, filters):
if frappe.db.get_default("cust_master_name") == "Customer Name":
diff --git a/erpnext/selling/doctype/customer/customer_links.py b/erpnext/selling/doctype/customer/customer_links.py
new file mode 100644
index 0000000..3ae139b
--- /dev/null
+++ b/erpnext/selling/doctype/customer/customer_links.py
@@ -0,0 +1,19 @@
+from frappe import _
+
+links = {
+ 'fieldname': 'customer',
+ 'transactions': [
+ {
+ 'label': _('Pre Sales'),
+ 'items': ['Opportunity', 'Quotation']
+ },
+ {
+ 'label': _('Orders'),
+ 'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
+ },
+ {
+ 'label': _('Projects'),
+ 'items': ['Project']
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer_list.js b/erpnext/selling/doctype/customer/customer_list.js
index 012d3f8..57cebd4 100644
--- a/erpnext/selling/doctype/customer/customer_list.js
+++ b/erpnext/selling/doctype/customer/customer_list.js
@@ -1,3 +1,12 @@
frappe.listview_settings['Customer'] = {
- add_fields: ["customer_name", "territory", "customer_group", "customer_type"]
+ add_fields: ["customer_name", "territory", "customer_group", "customer_type", 'status'],
+ get_indicator: function(doc) {
+ color = {
+ 'Open': 'red',
+ 'Active': 'green',
+ 'Dormant': 'darkgrey'
+ }
+ return [__(doc.status), color[doc.status], "status,=," + doc.status];
+ }
+
};
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index 1ca5ce7..9e53845 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -99,24 +99,24 @@
frappe.db.sql("delete from `tabCustomer` where customer_name='_Test Customer 1'")
if not frappe.db.get_value("Customer", "_Test Customer 1"):
- test_customer_1 = frappe.get_doc({
- "customer_group": "_Test Customer Group",
- "customer_name": "_Test Customer 1",
- "customer_type": "Individual",
- "doctype": "Customer",
- "territory": "_Test Territory"
- }).insert(ignore_permissions=True)
+ test_customer_1 = frappe.get_doc(
+ get_customer_dict('_Test Customer 1')).insert(ignore_permissions=True)
else:
test_customer_1 = frappe.get_doc("Customer", "_Test Customer 1")
- duplicate_customer = frappe.get_doc({
- "customer_group": "_Test Customer Group",
- "customer_name": "_Test Customer 1",
- "customer_type": "Individual",
- "doctype": "Customer",
- "territory": "_Test Territory"
- }).insert(ignore_permissions=True)
+ duplicate_customer = frappe.get_doc(
+ get_customer_dict('_Test Customer 1')).insert(ignore_permissions=True)
self.assertEquals("_Test Customer 1", test_customer_1.name)
self.assertEquals("_Test Customer 1 - 1", duplicate_customer.name)
self.assertEquals(test_customer_1.customer_name, duplicate_customer.customer_name)
+
+def get_customer_dict(customer_name):
+ return {
+ "customer_group": "_Test Customer Group",
+ "customer_name": customer_name,
+ "customer_type": "Individual",
+ "doctype": "Customer",
+ "territory": "_Test Territory"
+ }
+
diff --git a/erpnext/selling/doctype/installation_note/installation_note.json b/erpnext/selling/doctype/installation_note/installation_note.json
index 29e9a43..5719f22 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.json
+++ b/erpnext/selling/doctype/installation_note/installation_note.json
@@ -167,7 +167,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -578,7 +578,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -594,7 +594,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-03 02:27:41.801292",
+ "modified": "2016-04-06 03:15:14.774949",
"modified_by": "Administrator",
"module": "Selling",
"name": "Installation Note",
@@ -646,5 +646,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "customer_name"
+ "title_field": "customer_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 649faaf..7c46983 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -18,15 +18,13 @@
this._super(doc, dt, dn);
if(doc.docstatus == 1 && doc.status!=='Lost') {
- cur_frm.add_custom_button(__('Sales Order'),
- cur_frm.cscript['Make Sales Order'], __("Make"));
+ cur_frm.add_custom_button(__('Make Sales Order'),
+ cur_frm.cscript['Make Sales Order']);
if(doc.status!=="Ordered") {
- cur_frm.add_custom_button(__('Lost'),
- cur_frm.cscript['Declare Order Lost'], __("Status"));
+ cur_frm.add_custom_button(__('Set as Lost'),
+ cur_frm.cscript['Declare Order Lost']);
}
-
- cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
}
if (this.frm.doc.docstatus===0) {
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 0a3d5b5..123686d 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -75,7 +75,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -197,7 +197,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -206,7 +206,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Customer / Lead Name",
+ "label": "Custome Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -223,105 +223,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "customer_address",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -460,6 +361,314 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
+ "collapsible_depends_on": "",
+ "depends_on": "eval:(doc.customer || doc.lead)",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address and Contact",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "customer_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "contact_person",
+ "oldfieldtype": "Link",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "customer",
+ "fieldname": "col_break98",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "customer",
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Territory",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -713,7 +922,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
@@ -1356,19 +1565,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "base_rounded_total",
- "fieldtype": "Currency",
+ "description": "In Words will be visible once you save the Quotation.",
+ "fieldname": "base_in_words",
+ "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Rounded Total (Company Currency)",
+ "label": "In Words (Company Currency)",
"length": 0,
"no_copy": 0,
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -1384,19 +1593,19 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "In Words will be visible once you save the Quotation.",
- "fieldname": "base_in_words",
- "fieldtype": "Data",
+ "fieldname": "base_rounded_total",
+ "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "In Words (Company Currency)",
+ "label": "Rounded Total (Company Currency)",
"length": 0,
"no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -1463,7 +1672,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
@@ -1506,7 +1715,7 @@
"oldfieldname": "in_words_export",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -1600,213 +1809,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Details",
- "length": 0,
- "no_copy": 0,
- "options": "icon-bullhorn",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "length": 0,
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "customer",
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "customer",
- "fieldname": "col_break98",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.customer",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Contact Person",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "contact_person",
- "oldfieldtype": "Link",
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
"fieldname": "print_settings",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2121,7 +2123,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-shopping-cart",
- "idx": 1,
+ "idx": 82,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2129,7 +2131,7 @@
"istable": 0,
"max_attachments": 1,
"menu_index": 0,
- "modified": "2016-03-03 06:30:26.308629",
+ "modified": "2016-04-14 12:28:39.092593",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
@@ -2182,27 +2184,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "match": "",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -2327,5 +2308,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index 3f30d05..7a59dd7 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
-import frappe, json
+import frappe
from frappe.utils import flt
import unittest
@@ -32,5 +32,99 @@
sales_order.transaction_date = "2013-05-12"
sales_order.insert()
+ def test_create_quotation_with_margin(self):
+ from erpnext.selling.doctype.quotation.quotation import make_sales_order
+ from erpnext.selling.doctype.sales_order.sales_order \
+ import make_delivery_note, make_sales_invoice
+
+ total_margin = flt((1500*18.75)/100 + 1500)
+
+ test_records[0]['items'][0]['price_list_rate'] = 1500
+ test_records[0]['items'][0]['margin_type'] = 'Percentage'
+ test_records[0]['items'][0]['margin_rate_or_amount'] = 18.75
+
+ quotation = frappe.copy_doc(test_records[0])
+ quotation.insert()
+
+ self.assertEquals(quotation.get("items")[0].rate, total_margin)
+ self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name)
+ quotation.submit()
+
+ sales_order = make_sales_order(quotation.name)
+ sales_order.delivery_date = "2016-01-02"
+ sales_order.naming_series = "_T-Quotation-"
+ sales_order.transaction_date = "2016-01-01"
+ sales_order.insert()
+
+ self.assertEquals(quotation.get("items")[0].rate, total_margin)
+
+ sales_order.submit()
+
+ dn = make_delivery_note(sales_order.name)
+ self.assertEquals(quotation.get("items")[0].rate, total_margin)
+ dn.save()
+
+ si = make_sales_invoice(sales_order.name)
+ self.assertEquals(quotation.get("items")[0].rate, total_margin)
+ si.save()
+
+ def test_party_status_open(self):
+ from erpnext.selling.doctype.customer.test_customer import get_customer_dict
+
+ customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert()
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
+
+ quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
+
+ quotation.submit()
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
+
+ quotation.cancel()
+ quotation.delete()
+ customer.delete()
+
+ def test_party_status_close(self):
+ from erpnext.selling.doctype.customer.test_customer import get_customer_dict
+
+ customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert()
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
+
+ # open quotation
+ quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
+
+ # close quotation (submit)
+ quotation.submit()
+
+ quotation1 = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
+
+ # still open
+ self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
+
+ quotation.cancel()
+ quotation.delete()
+
+ quotation1.delete()
+
+ customer.delete()
test_records = frappe.get_test_records('Quotation')
+
+def get_quotation_dict(customer=None, item_code=None):
+ if not customer:
+ customer = '_Test Customer'
+ if not item_code:
+ item_code = '_Test Item'
+
+ return {
+ 'doctype': 'Quotation',
+ 'customer': customer,
+ 'items': [
+ {
+ 'item_code': item_code,
+ 'qty': 1,
+ 'rate': 100
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json
index b58568f..eca07cf 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.json
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@@ -325,35 +326,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "depends_on": "price_list_rate",
- "fieldname": "discount_percentage",
- "fieldtype": "Percent",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Discount on Price List Rate (%)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "100px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "100px"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -434,6 +406,163 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "fieldname": "discount_and_margin",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Discount and Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Percent",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Discount on Price List Rate (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_18",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "margin_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nPercentage\nAmount",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "margin_rate_or_amount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Rate or Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "total_margin",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "section_break1",
"fieldtype": "Section Break",
@@ -458,6 +587,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
+ "depends_on": "",
"fieldname": "rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -1097,7 +1227,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-02-26 18:30:22.286356",
+ "modified": "2016-03-29 07:06:02.477033",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation Item",
@@ -1106,5 +1236,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 16c98b9..22800b7 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -216,7 +216,7 @@
tn = frappe.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_customer = 1;
if(doc.customer) locals['Contact'][tn].customer = doc.customer;
- loaddoc('Contact', tn);
+ frappe.set_route('Form', 'Contact', tn);
}
cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) {
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 7e37cb7..66f6b71 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -76,7 +76,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -141,7 +141,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -167,103 +167,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"default": "Sales",
"depends_on": "",
"fieldname": "order_type",
@@ -488,10 +391,208 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "",
+ "depends_on": "customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address and Contact",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break46",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "shipping_address_name",
"fieldtype": "Link",
- "hidden": 1,
+ "hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
@@ -516,7 +617,7 @@
"collapsible": 0,
"fieldname": "shipping_address",
"fieldtype": "Small Text",
- "hidden": 1,
+ "hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -537,6 +638,58 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Territory",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 1,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
@@ -563,34 +716,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "currency",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Currency",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "100px"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"description": "Rate at which customer's currency is converted to company's base currency",
"fieldname": "conversion_rate",
"fieldtype": "Float",
@@ -620,6 +745,34 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Currency",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1566,7 +1719,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
@@ -1609,7 +1762,7 @@
"oldfieldname": "in_words_export",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -1783,182 +1936,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
- "depends_on": "customer",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Details",
- "length": 0,
- "no_copy": 0,
- "options": "icon-bullhorn",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break45",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "length": 0,
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break46",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Contact Person",
- "length": 0,
- "no_copy": 0,
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
"collapsible_depends_on": "project",
"fieldname": "more_info",
"fieldtype": "Section Break",
@@ -3011,14 +2988,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 105,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-21 13:11:32.654873",
+ "modified": "2016-04-14 12:34:16.220066",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
@@ -3110,26 +3087,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -3171,5 +3128,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 529c17c..4111eb4 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -336,6 +336,10 @@
def make_material_request(source_name, target_doc=None):
def postprocess(source, doc):
doc.material_request_type = "Purchase"
+
+ def update_item(source, target, source_parent):
+ target.project = source_parent.project
+
so = frappe.get_doc("Sales Order", source_name)
@@ -353,7 +357,8 @@
"field_map": {
"parent": "sales_order",
"stock_uom": "uom"
- }
+ },
+ "postprocess": update_item
}
}, target_doc, postprocess)
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index edd7cdf..4ba6ff0 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -415,6 +415,21 @@
self.assertEquals(get_reserved_qty(item_code="_Test Item", warehouse="_Test Warehouse - _TC"), existing_reserved_qty)
+ def test_create_so_with_margin(self):
+ so = make_sales_order(item_code="_Test Item", qty=1, do_not_submit=True)
+ so.items[0].price_list_rate = price_list_rate = 100
+ so.items[0].margin_type = 'Percentage'
+ so.items[0].margin_rate_or_amount = 25
+ so.insert()
+
+ new_so = frappe.copy_doc(so)
+ new_so.save(ignore_permissions=True)
+
+ self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
+ new_so.items[0].margin_rate_or_amount = 25
+ new_so.submit()
+
+ self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
def make_sales_order(**args):
so = frappe.new_doc("Sales Order")
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index fb65ee8..c356a56 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -326,35 +326,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "depends_on": "price_list_rate",
- "fieldname": "discount_percentage",
- "fieldtype": "Percent",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Discount on Price List Rate (%)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "70px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "70px"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -435,6 +406,163 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "fieldname": "discount_and_margin",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Discount and Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Percent",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Discount on Price List Rate (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "70px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "70px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_19",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "margin_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nPercentage\nAmount",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "margin_rate_or_amount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Rate or Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "total_margin",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "section_break_simple1",
"fieldtype": "Section Break",
@@ -459,8 +587,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval: doc.type != \"\"",
"fieldname": "rate",
- "fieldtype": "Currency",
+ "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -502,6 +631,7 @@
"oldfieldtype": "Currency",
"options": "currency",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "100px",
@@ -1392,7 +1522,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-02-26 11:08:24.708912",
+ "modified": "2016-03-29 07:06:13.657725",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",
@@ -1401,5 +1531,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 25045fa..bfefb9f 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -122,10 +122,13 @@
var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
- item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
- precision("rate", item));
-
- this.set_gross_profit(item);
+ // check if child doctype is Sales Order Item/Qutation Item and calculate the rate
+ if(in_list(["Quotation Item", "Sales Order Item", "Delivery Note Item", "Sales Invoice Item"]), cdt)
+ this.calculate_revised_margin_and_rate(item, doc,cdt, cdn);
+ else
+ item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
+ precision("rate", item));
+
this.calculate_taxes_and_totals();
},
@@ -302,11 +305,51 @@
callback: function(r) {
if(!r.exc){
var doc = frappe.model.sync(r.message);
- console.log(r.message)
frappe.set_route("Form", r.message.doctype, r.message.name);
}
}
})
+ },
+
+ rate: function(doc, cdt, cdn){
+ // if user changes the rate then set margin Rate or amount to 0
+ item = locals[cdt][cdn];
+ item.margin_type = "";
+ item.margin_rate_or_amount = 0.0;
+ cur_frm.refresh_fields();
+ },
+
+ margin_rate_or_amount: function(doc, cdt, cdn) {
+ // calculated the revised total margin and rate on margin rate changes
+ item = locals[cdt][cdn];
+ this.calculate_revised_margin_and_rate(item)
+ this.calculate_taxes_and_totals();
+ cur_frm.refresh_fields();
+ },
+
+ margin_type: function(doc, cdt, cdn){
+ // calculate the revised total margin and rate on margin type changes
+ item = locals[cdt][cdn];
+ this.calculate_revised_margin_and_rate(item, doc,cdt, cdn)
+ this.calculate_taxes_and_totals();
+ cur_frm.refresh_fields();
+ },
+
+ calculate_revised_margin_and_rate: function(item){
+ if(in_list(["Percentage", "Amount"], item.margin_type)){
+ if(item.margin_type == "Percentage")
+ item.total_margin = item.price_list_rate + item.price_list_rate * ( item.margin_rate_or_amount / 100);
+ else
+ item.total_margin = item.price_list_rate + item.margin_rate_or_amount;
+ item.rate = flt(item.total_margin * (1 - item.discount_percentage / 100.0),
+ precision("rate", item));
+ }
+ else{
+ item.rate_or_amount = 0.0;
+ item.total_margin = 0.0;
+ item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
+ precision("rate", item));
+ }
}
});
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 01a2d1d..dfa6c0a 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -136,8 +136,12 @@
["default_expense_account", {"root_type": "Expense"}],
["default_income_account", {"root_type": "Income"}],
["round_off_account", {"root_type": "Expense"}],
+ ["accumulated_depreciation_account", {"root_type": "Asset"}],
+ ["depreciation_expense_account", {"root_type": "Expense"}],
+ ["disposal_account", {"report_type": "Profit and Loss"}],
["cost_center", {}],
- ["round_off_cost_center", {}]
+ ["round_off_cost_center", {}],
+ ["depreciation_cost_center", {}]
], function(i, v) {
erpnext.company.set_custom_query(frm, v);
});
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 76165ef..9d6785d 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -253,7 +253,6 @@
"no_copy": 0,
"options": "Terms and Conditions",
"permlevel": 0,
- "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -965,6 +964,159 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "fixed_asset_depreciation_settings",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Fixed Asset Depreciation Settings",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "accumulated_depreciation_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accumulated Depreciation Account",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "depreciation_expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depreciation Expense Account",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_40",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "disposal_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Gain/Loss Account on Asset Disposal",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "depreciation_cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Asset Depreciation Cost Center",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"description": "For reference only.",
"fieldname": "company_info",
"fieldtype": "Section Break",
@@ -1235,8 +1387,8 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-08 20:21:46.331870",
- "modified_by": "anand@erpnext.com",
+ "modified": "2016-03-10 04:34:43.440914",
+ "modified_by": "Administrator",
"module": "Setup",
"name": "Company",
"owner": "Administrator",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 6689d66..97a689a 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -30,16 +30,16 @@
self.validate_abbr()
self.validate_default_accounts()
self.validate_currency()
-
+
def validate_abbr(self):
self.abbr = self.abbr.strip()
-
+
if self.get('__islocal') and len(self.abbr) > 5:
frappe.throw(_("Abbreviation cannot have more than 5 characters"))
if not self.abbr.strip():
frappe.throw(_("Abbreviation is mandatory"))
-
+
if frappe.db.sql("select abbr from tabCompany where name!=%s and abbr=%s", (self.name, self.abbr)):
frappe.throw(_("Abbreviation already used for another company"))
@@ -111,6 +111,8 @@
self._set_default_account("default_cash_account", "Cash")
self._set_default_account("default_bank_account", "Bank")
self._set_default_account("round_off_account", "Round Off")
+ self._set_default_account("accumulated_depreciation_account", "Accumulated Depreciation")
+ self._set_default_account("depreciation_expense_account", "Depreciation")
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")):
self._set_default_account("stock_received_but_not_billed", "Stock Received But Not Billed")
@@ -159,6 +161,7 @@
frappe.db.set(self, "cost_center", _("Main") + " - " + self.abbr)
frappe.db.set(self, "round_off_cost_center", _("Main") + " - " + self.abbr)
+ frappe.db.set(self, "depreciation_cost_center", _("Main") + " - " + self.abbr)
def before_rename(self, olddn, newdn, merge=False):
if merge:
diff --git a/erpnext/setup/doctype/email_digest/quotes.py b/erpnext/setup/doctype/email_digest/quotes.py
index 4b996d9..95afe97 100644
--- a/erpnext/setup/doctype/email_digest/quotes.py
+++ b/erpnext/setup/doctype/email_digest/quotes.py
@@ -28,6 +28,7 @@
("A small body of determined spirits fired by an unquenchable faith in their mission can alter the course of history.", "Mahatma Gandhi"),
("If two wrongs don't make a right, try three.", "Laurence J. Peter"),
("Inspiration exists, but it has to find you working.", "Pablo Picasso"),
+ ("The world’s first speeding ticket was given to a man going 4 times the speed limit! Walter Arnold was traveling at a breakneck 8 miles an hour in a 2mph zone, and was caught by a policeman on bicycle and fined one shilling!"),
]
return random.choice(quotes)
diff --git a/erpnext/setup/doctype/features_setup/features_setup.json b/erpnext/setup/doctype/features_setup/features_setup.json
index 8dea339..56be6b0 100644
--- a/erpnext/setup/doctype/features_setup/features_setup.json
+++ b/erpnext/setup/doctype/features_setup/features_setup.json
@@ -15,9 +15,10 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Materials",
+ "label": "Item",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -39,6 +40,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Serial Nos",
@@ -63,6 +65,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Batch Nos",
@@ -87,6 +90,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Brands",
@@ -111,6 +115,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Barcode",
@@ -134,6 +139,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -157,6 +163,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Advanced",
@@ -181,6 +188,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Groups in Details",
@@ -205,6 +213,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Compact Item Print",
@@ -229,6 +238,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales and Purchase",
@@ -253,6 +263,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exports",
@@ -277,6 +288,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Imports",
@@ -300,6 +312,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -323,6 +336,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Discounts",
@@ -347,6 +361,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Discounts",
@@ -371,6 +386,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "After Sale Installations",
@@ -395,6 +411,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Projects",
@@ -419,6 +436,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Extras",
@@ -442,6 +460,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Accounts",
@@ -466,6 +485,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Recurring Invoice",
@@ -489,6 +509,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -512,6 +533,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Point of Sale",
@@ -536,6 +558,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "POS View",
@@ -559,6 +582,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Manufacturing",
@@ -583,6 +607,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Manufacturing",
@@ -606,6 +631,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -629,6 +655,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quality",
@@ -652,6 +679,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Miscelleneous",
@@ -676,6 +704,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
@@ -699,6 +728,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -721,6 +751,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -747,7 +778,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-16 04:43:32.144944",
+ "modified": "2016-04-06 03:45:40.152486",
"modified_by": "Administrator",
"module": "Setup",
"name": "Features Setup",
@@ -797,5 +828,6 @@
],
"read_only": 0,
"read_only_onload": 0,
- "sort_order": "ASC"
+ "sort_order": "ASC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json
index a1ccee2..e5ccc2d 100644
--- a/erpnext/setup/doctype/item_group/item_group.json
+++ b/erpnext/setup/doctype/item_group/item_group.json
@@ -18,6 +18,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "General Settings",
@@ -25,6 +26,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -40,6 +42,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Group Name",
@@ -49,6 +52,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -58,13 +62,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"description": "",
"fieldname": "parent_item_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Parent Item Group",
@@ -75,6 +80,7 @@
"options": "Item Group",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -91,6 +97,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Has Child Node",
@@ -101,6 +108,7 @@
"options": "\nYes\nNo",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -116,12 +124,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -137,6 +147,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Income Account",
@@ -145,6 +156,7 @@
"options": "Account",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -160,6 +172,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Expense Account",
@@ -168,6 +181,7 @@
"options": "Account",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -183,6 +197,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Default Cost Center",
@@ -191,6 +206,7 @@
"options": "Cost Center",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -206,6 +222,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Website Settings",
@@ -213,6 +230,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -229,6 +247,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Show in Website",
@@ -236,6 +255,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -252,6 +272,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Name",
@@ -259,6 +280,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -275,6 +297,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Website Route",
@@ -283,6 +306,7 @@
"options": "",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -300,6 +324,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Slideshow",
@@ -308,6 +333,7 @@
"options": "Website Slideshow",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -325,6 +351,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -332,6 +359,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -348,6 +376,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Website Specifications",
@@ -356,6 +385,7 @@
"options": "Item Website Specification",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -371,6 +401,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "lft",
@@ -380,6 +411,7 @@
"oldfieldtype": "Int",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -395,6 +427,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "rgt",
@@ -404,6 +437,7 @@
"oldfieldtype": "Int",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -420,6 +454,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "old_parent",
@@ -430,6 +465,7 @@
"options": "Item Group",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -448,7 +484,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
- "modified": "2015-11-16 06:29:48.316308",
+ "modified": "2016-03-28 08:38:30.868523",
"modified_by": "Administrator",
"module": "Setup",
"name": "Item Group",
@@ -577,5 +613,7 @@
],
"read_only": 0,
"read_only_onload": 0,
- "search_fields": "parent_item_group"
+ "search_fields": "parent_item_group",
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py
index 6a5c3f5..1402168 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -55,4 +55,3 @@
pass
frappe.db.set_default("date_format", "dd-mm-yyyy")
-
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index c3bd452..8c0d1cb 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -43,13 +43,15 @@
"company_abbr" :"WP",
"industry" :"Manufacturing",
"country" :"United States",
- "fy_start_date" :"2014-01-01",
- "fy_end_date" :"2014-12-31",
+ "fy_start_date" :"2011-01-01",
+ "fy_end_date" :"2011-12-31",
"language" :"english",
"company_tagline" :"Testing",
"email" :"test@erpnext.com",
"password" :"test",
- "chart_of_accounts" : "Standard"
+ "chart_of_accounts" : "Standard",
+ "domain" : "Manufacturing",
+
})
frappe.db.sql("delete from `tabLeave Allocation`")
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 27271af..2c3257e 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -24,7 +24,7 @@
@frappe.whitelist()
def get_cart_quotation(doc=None):
- party = get_customer()
+ party = get_party()
if not doc:
quotation = _get_cart_quotation(party)
@@ -150,7 +150,7 @@
def _get_cart_quotation(party=None):
if not party:
- party = get_customer()
+ party = get_party()
quotation = frappe.get_all("Quotation", fields=["name"], filters=
{party.doctype.lower(): party.name, "order_type": "Shopping Cart", "docstatus": 0},
@@ -182,7 +182,7 @@
return qdoc
def update_party(fullname, company_name=None, mobile_no=None, phone=None):
- party = get_customer()
+ party = get_party()
party.customer_name = company_name or fullname
party.customer_type == "Company" if company_name else "Individual"
@@ -211,7 +211,7 @@
def apply_cart_settings(party=None, quotation=None):
if not party:
- party = get_customer()
+ party = get_party()
if not quotation:
quotation = _get_cart_quotation(party)
@@ -276,20 +276,24 @@
# # append taxes
quotation.append_taxes_from_master()
-def get_customer(user=None):
+def get_party(user=None):
if not user:
user = frappe.session.user
- customer = frappe.db.get_value("Contact", {"email_id": user}, "customer")
+ party = frappe.db.get_value("Contact", {"email_id": user}, ["customer", "supplier"], as_dict=1)
+ if party:
+ party_doctype = 'Customer' if party.customer else 'Supplier'
+ party = party.customer or party.supplier
+
cart_settings = frappe.get_doc("Shopping Cart Settings")
-
+
debtors_account = ''
-
+
if cart_settings.enable_checkout:
debtors_account = get_debtors_account(cart_settings)
-
- if customer:
- return frappe.get_doc("Customer", customer)
+
+ if party:
+ return frappe.get_doc(party_doctype, party)
else:
customer = frappe.new_doc("Customer")
@@ -300,7 +304,7 @@
"customer_group": get_shopping_cart_settings().default_customer_group,
"territory": get_root_of("Territory")
})
-
+
if debtors_account:
customer.update({
"accounts": [{
@@ -308,7 +312,7 @@
"account": debtors_account
}]
})
-
+
customer.flags.ignore_mandatory = True
customer.insert(ignore_permissions=True)
@@ -326,12 +330,12 @@
def get_debtors_account(cart_settings):
payment_gateway_account_currency = \
frappe.get_doc("Payment Gateway Account", cart_settings.payment_gateway_account).currency
-
+
account_name = _("Debtors ({0})".format(payment_gateway_account_currency))
-
+
debtors_account_name = get_account_name("Receivable", "Asset", is_group=0,\
account_currency=payment_gateway_account_currency, company=cart_settings.company)
-
+
if not debtors_account_name:
debtors_account = frappe.get_doc({
"doctype": "Account",
@@ -340,18 +344,18 @@
"is_group": 0,
"parent_account": get_account_name(root_type="Asset", is_group=1, company=cart_settings.company),
"account_name": account_name,
- "currency": payment_gateway_account_currency
+ "currency": payment_gateway_account_currency
}).insert(ignore_permissions=True)
-
+
return debtors_account.name
-
+
else:
return debtors_account_name
-
+
def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_page_length=20, party=None):
if not party:
- party = get_customer()
+ party = get_party()
address_docs = frappe.db.sql("""select * from `tabAddress`
where `{0}`=%s order by name limit {1}, {2}""".format(party.doctype.lower(),
@@ -371,7 +375,7 @@
if not doc.flags.linked and (frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User"):
# creates a customer if one does not exist
- get_customer()
+ get_party()
doc.link_address()
@frappe.whitelist()
@@ -437,3 +441,6 @@
break
return territory
+
+def show_terms(doc):
+ return doc.tc_name
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 9b0278d..a51852a 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import unittest
import frappe
-from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_customer
+from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_party
class TestShoppingCart(unittest.TestCase):
"""
@@ -96,13 +96,6 @@
self.assertEquals(quotation.net_total, 20)
self.assertEquals(len(quotation.get("items")), 1)
- # remove second item
- update_cart("_Test Item 2", 0)
- quotation = self.test_get_cart_customer()
-
- self.assertEquals(len(quotation.get("items")), 0)
- self.assertEquals(quotation.net_total, 0)
-
def test_tax_rule(self):
self.login_as_customer()
quotation = self.create_quotation()
@@ -125,7 +118,7 @@
"doctype": "Quotation",
"quotation_to": "Customer",
"order_type": "Shopping Cart",
- "customer": get_customer(frappe.session.user).name,
+ "customer": get_party(frappe.session.user).name,
"docstatus": 0,
"contact_email": frappe.session.user,
"selling_price_list": "_Test Price List Rest of the World",
@@ -191,15 +184,16 @@
frappe.set_user("test_cart_user@example.com")
def login_as_customer(self):
- self.create_user_if_not_exists("test_contact_customer@example.com")
+ self.create_user_if_not_exists("test_contact_customer@example.com",
+ "_Test Contact For _Test Customer")
frappe.set_user("test_contact_customer@example.com")
def remove_all_items_from_cart(self):
quotation = _get_cart_quotation()
- quotation.set("items", [])
- quotation.save(ignore_permissions=True)
+ quotation.flags.ignore_permissions=True
+ quotation.delete()
- def create_user_if_not_exists(self, email):
+ def create_user_if_not_exists(self, email, first_name = None):
if frappe.db.exists("User", email):
return
@@ -208,7 +202,7 @@
"user_type": "Website User",
"email": email,
"send_welcome_email": 0,
- "first_name": email.split("@")[0]
+ "first_name": first_name or email.split("@")[0]
}).insert(ignore_permissions=True)
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
diff --git a/erpnext/shopping_cart/utils.py b/erpnext/shopping_cart/utils.py
index b8d5054..50ce5cf 100644
--- a/erpnext/shopping_cart/utils.py
+++ b/erpnext/shopping_cart/utils.py
@@ -4,7 +4,6 @@
from __future__ import unicode_literals
import frappe
-from frappe import _
import frappe.defaults
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_cart_enabled
@@ -16,6 +15,8 @@
return False
def set_cart_count(login_manager):
+ role, parties = check_customer_or_supplier()
+ if role == 'Supplier': return
if show_cart_count():
from erpnext.shopping_cart.cart import set_cart_count
set_cart_count()
@@ -28,11 +29,14 @@
cart_enabled = is_cart_enabled()
context["shopping_cart_enabled"] = cart_enabled
-def update_my_account_context(context):
- context["my_account_list"].extend([
- {"label": _("Orders"), "url": "orders"},
- {"label": _("Invoices"), "url": "invoices"},
- {"label": _("Shipments"), "url": "shipments"},
- {"label": _("Issues"), "url": "issues"},
- {"label": _("Addresses"), "url": "addresses"},
- ])
+def check_customer_or_supplier():
+ if frappe.session.user:
+ contacts = frappe.get_all("Contact", fields=["customer", "supplier", "email_id"],
+ filters={"email_id": frappe.session.user})
+
+ customer = [d.customer for d in contacts if d.customer] or None
+ supplier = [d.supplier for d in contacts if d.supplier] or None
+
+ if customer: return 'Customer', customer
+ if supplier : return 'Supplier', supplier
+ return 'Customer', None
\ No newline at end of file
diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py
index 445c09d..f3f620e 100644
--- a/erpnext/startup/boot.py
+++ b/erpnext/startup/boot.py
@@ -38,7 +38,8 @@
if country and frappe.db.exists("Country", country):
bootinfo.docs += [frappe.get_doc("Country", country)]
- bootinfo.docs += frappe.db.sql("""select * from tabCurrency
+ bootinfo.docs += frappe.db.sql("""select name, fraction, fraction_units,
+ number_format, smallest_currency_fraction_value, symbol from tabCurrency
where enabled=1""", as_dict=1, update={"doctype":":Currency"})
def get_letter_heads():
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index 7555312..335efbb 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -10,6 +10,9 @@
"Warranty Claim": {"status": "Open"},
"Task": {"status": "Overdue"},
"Project": {"status": "Open"},
+ "Item": {"total_projected_qty": ("<", 0)},
+ "Customer": {"status": "Open"},
+ "Supplier": {"status": "Open"},
"Lead": {"status": "Open"},
"Contact": {"status": "Open"},
"Opportunity": {"status": "Open"},
@@ -24,7 +27,6 @@
"Leave Application": {"status": "Open"},
"Expense Claim": {"approval_status": "Draft"},
"Job Applicant": {"status": "Open"},
- "Purchase Receipt": {"docstatus": 0},
"Delivery Note": {"docstatus": 0},
"Stock Entry": {"docstatus": 0},
"Material Request": {
@@ -32,11 +34,14 @@
"status": ("not in", ("Stopped",)),
"per_ordered": ("<", 100)
},
+ "Request for Quotation": { "docstatus": 0 },
+ "Supplier Quotation": {"docstatus": 0},
"Purchase Order": {
"status": ("not in", ("Completed", "Closed")),
"docstatus": ("<", 2)
},
- "Production Order": { "status": "In Process" },
+ "Purchase Receipt": {"docstatus": 0},
+ "Production Order": { "status": ("in", ("Draft", "Not Started", "In Process")) },
"BOM": {"docstatus": 0},
"Timesheet": {"docstatus": 0},
"Time Log": {"status": "Draft"},
diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py
index 1682686..3d57b4d 100644
--- a/erpnext/stock/doctype/bin/bin.py
+++ b/erpnext/stock/doctype/bin/bin.py
@@ -69,6 +69,7 @@
flt(self.indented_qty) + flt(self.planned_qty) - flt(self.reserved_qty)
self.save()
+ update_item_projected_qty(self.item_code)
def get_first_sle(self):
sle = frappe.db.sql("""
@@ -79,3 +80,9 @@
limit 1
""", (self.item_code, self.warehouse), as_dict=1)
return sle and sle[0] or None
+
+def update_item_projected_qty(item_code):
+ '''Set Item project qty'''
+ frappe.db.sql('''update tabItem set
+ total_projected_qty = (select sum(projected_qty) from tabBin where item_code=%s)
+ where name=%s''', (item_code, item_code))
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index f1d11b2..813133d 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -122,7 +122,7 @@
tn = frappe.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_customer = 1;
if(doc.customer) locals['Contact'][tn].customer = doc.customer;
- loaddoc('Contact', tn);
+ frappe.set_route('Form', 'Contact', tn);
}
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index b4bb456..fdba48b 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -77,7 +77,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -142,7 +142,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "customer",
"fieldname": "customer_name",
@@ -169,178 +169,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "depends_on": "customer",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Billing Address Name",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Billing Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -562,6 +390,306 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
+ "depends_on": "customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address and Contact",
+ "length": 0,
+ "no_copy": 0,
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "col_break21",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "customer",
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Billing Address Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Territory",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1645,7 +1773,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "rounded_total",
"fieldtype": "Currency",
@@ -1690,7 +1818,7 @@
"oldfieldname": "in_words_export",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
@@ -1923,134 +2051,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
- "depends_on": "customer",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Details",
- "length": 0,
- "no_copy": 0,
- "options": "icon-bullhorn",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "length": 0,
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break21",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "50%",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Contact Person",
- "length": 0,
- "no_copy": 0,
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2791,7 +2791,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-truck",
- "idx": 1,
+ "idx": 146,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2799,7 +2799,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-18 05:10:56.813113",
+ "modified": "2016-04-14 12:53:48.081945",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
@@ -2891,26 +2891,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -2932,5 +2912,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index 6ed16ce..308bb98 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -17,6 +17,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Barcode",
@@ -40,6 +41,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Item Code",
@@ -68,6 +70,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Name",
@@ -95,6 +98,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -117,6 +121,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer's Item Code",
@@ -140,6 +145,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -164,6 +170,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -191,6 +198,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -214,6 +222,7 @@
"fieldtype": "Attach",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
@@ -238,6 +247,7 @@
"fieldtype": "Image",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image View",
@@ -263,6 +273,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity and Rate",
@@ -286,6 +297,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Quantity",
@@ -313,6 +325,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate",
@@ -337,38 +350,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "depends_on": "price_list_rate",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Discount on Price List Rate (%)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "print_width": "100px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "100px"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -391,6 +377,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "UOM",
@@ -419,6 +406,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Price List Rate (Company Currency)",
@@ -442,11 +430,169 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 1,
+ "fieldname": "discount_and_margin",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Discount and Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Discount on Price List Rate (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_19",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "price_list_rate",
+ "fieldname": "margin_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nPercentage\nAmount",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "margin_rate_or_amount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Margin Rate or Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.margin_type && doc.price_list_rate",
+ "fieldname": "total_margin",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Margin",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "2",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 0,
"fieldname": "section_break_1",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -469,6 +615,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Rate",
@@ -497,6 +644,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
@@ -525,6 +673,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -547,6 +696,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rate (Company Currency)",
@@ -575,6 +725,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amount (Company Currency)",
@@ -603,6 +754,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Pricing Rule",
@@ -627,6 +779,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -650,6 +803,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate",
@@ -675,6 +829,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount",
@@ -700,6 +855,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -723,6 +879,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Rate (Company Currency)",
@@ -748,6 +905,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Amount (Company Currency)",
@@ -773,6 +931,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse and Reference",
@@ -796,6 +955,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "From Warehouse",
@@ -826,6 +986,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Warehouse (Optional)",
@@ -851,6 +1012,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Serial No",
@@ -876,6 +1038,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Batch No",
@@ -902,6 +1065,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Available Qty at From Warehouse",
@@ -930,6 +1094,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Available Batch Qty at From Warehouse",
@@ -957,6 +1122,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Group",
@@ -983,6 +1149,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Brand Name",
@@ -1011,6 +1178,7 @@
"fieldtype": "Small Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Tax Rate",
@@ -1036,6 +1204,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -1058,6 +1227,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expense Account",
@@ -1084,6 +1254,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
@@ -1109,6 +1280,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Sales Order",
@@ -1133,6 +1305,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Sales Invoice",
@@ -1157,6 +1330,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Against Sales Order Item",
@@ -1184,6 +1358,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Against Sales Invoice Item",
@@ -1208,6 +1383,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Installed Qty",
@@ -1235,6 +1411,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Billed Amt",
@@ -1260,6 +1437,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
@@ -1287,7 +1465,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-02-01 11:16:23.749244",
+ "modified": "2016-03-29 07:06:24.716689",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
@@ -1296,5 +1474,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index a691f2f..900c40c 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -5,6 +5,7 @@
frappe.ui.form.on("Item", {
onload: function(frm) {
+ frm.hide_first = true;
erpnext.item.setup_queries(frm);
if (frm.doc.variant_of){
frm.fields_dict["attributes"].grid.set_column_disp("attribute_value", true);
@@ -15,7 +16,14 @@
},
+ dashboard_update: function(frm) {
+ if(frm.dashboard_data.stock_data && frm.dashboard_data.stock_data.length) {
+ frm.dashboard.add_stats(frappe.render_template('item_dashboard', {data: frm.dashboard_data.stock_data}))
+ }
+ },
+
refresh: function(frm) {
+
if(frm.doc.is_stock_item) {
frm.add_custom_button(__("Balance"), function() {
frappe.route_options = {
@@ -73,6 +81,8 @@
}
erpnext.item.toggle_attributes(frm);
+
+ frm.dashboard.show_links();
},
validate: function(frm){
@@ -111,40 +121,27 @@
$.extend(erpnext.item, {
setup_queries: function(frm) {
- // Expense Account
- // ---------------------------------
frm.fields_dict['expense_account'].get_query = function(doc) {
return {
- filters: {
- "report_type": "Profit and Loss",
- "is_group": 0
- }
+ query: "erpnext.controllers.queries.get_expense_account",
}
}
- // Income Account
- // --------------------------------
frm.fields_dict['income_account'].get_query = function(doc) {
return {
query: "erpnext.controllers.queries.get_income_account"
}
}
-
- // Purchase Cost Center
- // -----------------------------
frm.fields_dict['buying_cost_center'].get_query = function(doc) {
return {
- filters:{ "is_group": 0 }
+ filters: { "is_group": 0 }
}
}
-
- // Sales Cost Center
- // -----------------------------
frm.fields_dict['selling_cost_center'].get_query = function(doc) {
return {
- filters:{ "is_group": 0 }
+ filters: { "is_group": 0 }
}
}
@@ -159,7 +156,7 @@
}
}
- frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
+ frm.fields_dict['item_group'].get_query = function(doc, cdt, cdn) {
return {
filters: [
['Item Group', 'docstatus', '!=', 2]
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index ac889fb..43fccf6 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -64,7 +64,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"description": "",
"fieldname": "item_code",
@@ -246,6 +246,36 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "",
+ "depends_on": "",
+ "description": "",
+ "fieldname": "is_fixed_asset",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Fixed Asset",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_asset_item",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -281,8 +311,8 @@
"bold": 0,
"collapsible": 0,
"fieldname": "image",
- "fieldtype": "Attach",
- "hidden": 0,
+ "fieldtype": "Attach Image",
+ "hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -293,33 +323,7 @@
"options": "image",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "image_view",
- "fieldtype": "Image",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Image View",
- "length": 0,
- "no_copy": 0,
- "options": "image",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -425,7 +429,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -604,36 +608,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "default": "",
- "depends_on": "eval:doc.is_stock_item",
- "description": "",
- "fieldname": "is_asset_item",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Fixed Asset Item",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_asset_item",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"depends_on": "is_stock_item",
"fieldname": "column_break1",
"fieldtype": "Column Break",
@@ -2311,19 +2285,45 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_projected_qty",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Projected Qty",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-tag",
- "idx": 1,
+ "idx": 2,
+ "image_field": "image",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2016-03-10 05:15:41.190950",
+ "modified": "2016-04-14 07:51:07.058298",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
@@ -2493,6 +2493,8 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "item_name,description,item_group,customer_code",
+ "sort_field": "idx desc, modified desc",
"sort_order": "DESC",
- "title_field": "item_name"
+ "title_field": "item_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index f18bc8b..d43f68d 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -27,7 +27,8 @@
def onload(self):
super(Item, self).onload()
- self.get("__onload").sle_exists = self.check_if_sle_exists()
+ self.set_onload('sle_exists', self.check_if_sle_exists())
+ self.set_onload('links', self.meta.get_links_setup())
def autoname(self):
if frappe.db.get_default("item_naming_by")=="Naming Series":
@@ -52,11 +53,14 @@
if self.is_sales_item=="Yes":
self.publish_in_hub = 1
+ if not self.description:
+ self.description = self.item_name
+
def validate(self):
super(Item, self).validate()
- if not self.stock_uom:
- msgprint(_("Please enter default Unit of Measure"), raise_exception=1)
+ if not self.description:
+ self.description = self.item_name
self.validate_uom()
self.add_default_uom_in_conversion_factor_table()
@@ -77,10 +81,12 @@
self.validate_variant_attributes()
self.validate_website_image()
self.make_thumbnail()
+ self.validate_fixed_asset_item()
if not self.get("__islocal"):
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
- self.old_website_item_groups = frappe.db.sql_list("""select item_group from `tabWebsite Item Group`
+ self.old_website_item_groups = frappe.db.sql_list("""select item_group
+ from `tabWebsite Item Group`
where parentfield='website_item_groups' and parenttype='Item' and parent=%s""", self.name)
def on_update(self):
@@ -394,14 +400,23 @@
vals = frappe.db.get_value("Item", self.name,
["has_serial_no", "is_stock_item", "valuation_method", "has_batch_no"], as_dict=True)
- if vals and ((self.is_stock_item == 0 and vals.is_stock_item == 1) or
+ if vals and ((self.is_stock_item != vals.is_stock_item) or
vals.has_serial_no != self.has_serial_no or
vals.has_batch_no != self.has_batch_no or
cstr(vals.valuation_method) != cstr(self.valuation_method)):
- if self.check_if_sle_exists() == "exists":
- frappe.throw(_("As there are existing stock transactions for this item, \
+ if self.check_if_linked_document_exists():
+ frappe.throw(_("As there are existing transactions for this item, \
you can not change the values of 'Has Serial No', 'Has Batch No', 'Is Stock Item' and 'Valuation Method'"))
+ def check_if_linked_document_exists(self):
+ for doctype in ("Sales Order Item", "Delivery Note Item", "Sales Invoice Item",
+ "Material Request Item", "Purchase Order Item", "Purchase Receipt Item",
+ "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"):
+ if frappe.db.get_value(doctype, filters={"item_code": self.name, "docstatus": 1}) or \
+ frappe.db.get_value("Production Order",
+ filters={"production_item": self.name, "docstatus": 1}):
+ return True
+
def validate_reorder_level(self):
if len(self.get("reorder_levels", {"material_request_type": "Purchase"})):
if not (self.is_purchase_item or self.is_pro_applicable):
@@ -564,6 +579,34 @@
frappe.throw(_("Item variant {0} exists with same attributes")
.format(variant), ItemVariantExistsError)
+ def validate_fixed_asset_item(self):
+ if self.is_fixed_asset and self.is_stock_item:
+ frappe.throw(_("Fixed Asset Item must be a non-stock item"))
+
+
+@frappe.whitelist()
+def get_dashboard_data(name):
+ '''load dashboard related data'''
+ frappe.has_permission(doc=frappe.get_doc('Item', name), throw=True)
+
+ from frappe.desk.notifications import get_open_count
+ return {
+ 'count': get_open_count('Item', name),
+ 'timeline_data': get_timeline_data(name),
+ 'stock_data': get_stock_data(name)
+ }
+
+def get_timeline_data(name):
+ '''returns timeline data based on stock ledger entry'''
+ return dict(frappe.db.sql('''select unix_timestamp(posting_date), count(*)
+ from `tabStock Ledger Entry` where item_code=%s
+ and posting_date > date_sub(curdate(), interval 1 year)
+ group by posting_date''', name))
+
+def get_stock_data(name):
+ return frappe.get_all('Bin', fields=['warehouse', 'actual_qty', 'projected_qty'],
+ filters={'item_code': name})
+
def validate_end_of_life(item_code, end_of_life=None, disabled=None, verbose=1):
if (not end_of_life) or (disabled is None):
end_of_life, disabled = frappe.db.get_value("Item", item_code, ["end_of_life", "disabled"])
diff --git a/erpnext/stock/doctype/item/item_dashboard.html b/erpnext/stock/doctype/item/item_dashboard.html
new file mode 100644
index 0000000..a002a50
--- /dev/null
+++ b/erpnext/stock/doctype/item/item_dashboard.html
@@ -0,0 +1,12 @@
+<div style="padding-left: 15px;">
+ <h5>Stock Levels</h5>
+ <div class="row">
+ <div class="col-md-6 col-xs-12">
+ <ul class="list-unstyled">
+ {% data.every(function(d) { %}
+ <li class="small">{{ d.warehouse }}: {{ d.actual_qty }} ({{ d.projected_qty }})</li>
+ {% }) %}
+ </ul>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item_links.py b/erpnext/stock/doctype/item/item_links.py
new file mode 100644
index 0000000..5586214
--- /dev/null
+++ b/erpnext/stock/doctype/item/item_links.py
@@ -0,0 +1,41 @@
+from frappe import _
+
+links = {
+ 'fieldname': 'item_code',
+ 'non_standard_fieldnames': {
+ 'Production Order': 'production_item',
+ 'Product Bundle': 'new_item_code',
+ 'Batch': 'item'
+ },
+ 'transactions': [
+ {
+ 'label': _('Groups'),
+ 'items': ['BOM', 'Product Bundle']
+ },
+ {
+ 'label': _('Pricing'),
+ 'items': ['Item Price', 'Pricing Rule']
+ },
+ {
+ 'label': _('Sell'),
+ 'items': ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']
+ },
+ {
+ 'label': _('Buy'),
+ 'items': ['Material Request', 'Supplier Quotation', 'Request for Quotation',
+ 'Purchase Order', 'Purchase Invoice']
+ },
+ {
+ 'label': _('Traceability'),
+ 'items': ['Serial No', 'Batch']
+ },
+ {
+ 'label': _('Move'),
+ 'items': ['Stock Entry']
+ },
+ {
+ 'label': _('Manufacture'),
+ 'items': ['Production Order']
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index fffc7fe..2fee589 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -1,10 +1,12 @@
frappe.listview_settings['Item'] = {
add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of",
- "has_variants", "end_of_life", "disabled", "is_sales_item"],
+ "has_variants", "end_of_life", "disabled", "total_projected_qty"],
filters: [["disabled", "=", "0"]],
get_indicator: function(doc) {
- if (doc.disabled) {
+ if(doc.total_projected_qty < 0) {
+ return [__("Shortage"), "red", "total_projected_qty,<,0"];
+ } else if (doc.disabled) {
return [__("Disabled"), "grey", "disabled,=,Yes"];
} else if (doc.end_of_life && doc.end_of_life < frappe.datetime.get_today()) {
return [__("Expired"), "grey", "end_of_life,<,Today"];
@@ -12,8 +14,6 @@
return [__("Template"), "blue", "has_variants,=,Yes"];
} else if (doc.variant_of) {
return [__("Variant"), "green", "variant_of,=," + doc.variant_of];
- } else {
- return [__("Active"), "blue", "end_of_life,>=,Today"];
}
}
};
diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json
index ca40d45..91a7493 100644
--- a/erpnext/stock/doctype/item/test_records.json
+++ b/erpnext/stock/doctype/item/test_records.json
@@ -9,7 +9,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -41,7 +41,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -64,7 +64,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -93,7 +93,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -113,7 +113,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -134,7 +134,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 1,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -151,7 +151,7 @@
"has_batch_no": 0,
"has_serial_no": 0,
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -169,7 +169,7 @@
"has_batch_no": 0,
"has_serial_no": 1,
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -187,7 +187,7 @@
"has_batch_no": 0,
"has_serial_no": 1,
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 0,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -209,7 +209,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 1,
"is_sales_item": 1,
"is_stock_item": 1,
@@ -229,7 +229,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 1,
"is_purchase_item": 1,
"is_sales_item": 1,
@@ -250,7 +250,7 @@
"has_serial_no": 0,
"income_account": "Sales - _TC",
"inspection_required": 0,
- "is_asset_item": 0,
+ "is_fixed_asset": 0,
"is_pro_applicable": 1,
"is_purchase_item": 1,
"is_sales_item": 1,
diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json
index 4e9e042..b38df68 100644
--- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json
+++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json
@@ -11,12 +11,13 @@
"fields": [
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Customer Name",
@@ -27,6 +28,7 @@
"options": "Customer",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "180px",
"read_only": 0,
"report_hide": 0,
@@ -44,6 +46,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Ref Code",
@@ -53,6 +56,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 0,
"report_hide": 0,
@@ -72,12 +76,13 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:48.280253",
+ "modified": "2016-04-06 03:15:24.568883",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Customer Detail",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
index 8f552bf..c947b7b 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
@@ -17,6 +17,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
@@ -25,6 +26,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -40,6 +42,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Receipts",
@@ -48,9 +51,10 @@
"options": "Landed Cost Purchase Receipt",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -63,6 +67,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items From Purchase Receipts",
@@ -70,6 +75,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -85,6 +91,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Receipt Items",
@@ -93,9 +100,10 @@
"options": "Landed Cost Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -108,6 +116,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Taxes and Charges",
@@ -116,6 +125,7 @@
"options": "Landed Cost Taxes and Charges",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -131,6 +141,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -139,6 +150,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -154,6 +166,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Taxes and Charges",
@@ -162,6 +175,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -177,6 +191,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -185,6 +200,7 @@
"options": "Landed Cost Voucher",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -200,6 +216,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -207,6 +224,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -223,6 +241,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Distribute Charges Based On",
@@ -232,6 +251,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -247,6 +267,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -254,6 +275,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -269,6 +291,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Landed Cost Help",
@@ -277,6 +300,7 @@
"options": "",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -288,13 +312,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-usd",
+ "idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:49.180775",
+ "modified": "2016-03-31 06:04:21.629139",
"modified_by": "Administrator",
"module": "Stock",
"name": "Landed Cost Voucher",
@@ -325,5 +350,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index c4b4b0e..5efb8e4 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -50,9 +50,13 @@
this.make_purchase_order, __("Make"));
if(doc.material_request_type === "Purchase")
+ cur_frm.add_custom_button(__("Request for Quotation"),
+ this.make_request_for_quotation, __("Make"));
+
+ if(doc.material_request_type === "Purchase")
cur_frm.add_custom_button(__("Supplier Quotation"),
this.make_supplier_quotation, __("Make"));
-
+
if(doc.material_request_type === "Manufacture" && doc.status === "Submitted")
cur_frm.add_custom_button(__("Production Order"),
this.raise_production_orders, __("Make"));
@@ -123,14 +127,18 @@
method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
args: values,
callback: function(r) {
- $.each(r.message, function(i, item) {
- var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
- d.item_code = item.item_code;
- d.description = item.description;
- d.warehouse = values.warehouse;
- d.uom = item.stock_uom;
- d.qty = item.qty;
- });
+ if(!r.message) {
+ frappe.throw(__("BOM does not contain any stock item"))
+ } else {
+ $.each(r.message, function(i, item) {
+ var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
+ d.item_code = item.item_code;
+ d.description = item.description;
+ d.warehouse = values.warehouse;
+ d.uom = item.stock_uom;
+ d.qty = item.qty;
+ });
+ }
d.hide();
refresh_field("items");
}
@@ -159,6 +167,14 @@
});
},
+ make_request_for_quotation: function(){
+ frappe.model.open_mapped_doc({
+ method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation",
+ frm: cur_frm,
+ run_link_triggers: true
+ });
+ },
+
make_supplier_quotation: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json
index 7234522..6b4217e 100644
--- a/erpnext/stock/doctype/material_request/material_request.json
+++ b/erpnext/stock/doctype/material_request/material_request.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +43,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
@@ -48,7 +51,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -65,6 +68,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Type",
@@ -89,6 +93,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -111,6 +116,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -137,6 +143,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -166,6 +173,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -194,6 +202,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -219,6 +228,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -232,7 +242,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -245,6 +255,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -270,6 +281,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Requested For",
@@ -293,6 +305,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Transaction Date",
@@ -320,6 +333,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -345,6 +359,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Status",
@@ -374,6 +389,7 @@
"fieldtype": "Percent",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "% Ordered",
@@ -399,6 +415,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Printing Details",
@@ -423,6 +440,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -449,6 +467,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Print Heading",
@@ -474,6 +493,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms and Conditions",
@@ -499,6 +519,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms",
@@ -525,6 +546,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms and Conditions Content",
@@ -546,7 +568,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-ticket",
- "idx": 1,
+ "idx": 70,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -554,7 +576,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-01-19 06:56:12.592797",
+ "modified": "2016-04-06 05:38:23.398251",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",
@@ -646,5 +668,6 @@
"search_fields": "status,transaction_date",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 679bd2d..6456d03 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -212,6 +212,28 @@
}, target_doc, postprocess)
return doclist
+
+@frappe.whitelist()
+def make_request_for_quotation(source_name, target_doc=None):
+ doclist = get_mapped_doc("Material Request", source_name, {
+ "Material Request": {
+ "doctype": "Request for Quotation",
+ "validation": {
+ "docstatus": ["=", 1],
+ "material_request_type": ["=", "Purchase"]
+ }
+ },
+ "Material Request Item": {
+ "doctype": "Request for Quotation Item",
+ "field_map": [
+ ["name", "material_request_item"],
+ ["parent", "material_request"],
+ ["uom", "uom"]
+ ]
+ }
+ }, target_doc)
+
+ return doclist
@frappe.whitelist()
def make_purchase_order_based_on_supplier(source_name, target_doc=None):
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json
index eecb42a..cf9d08c 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.json
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Item Code",
@@ -44,6 +46,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -66,6 +69,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Item Name",
@@ -93,6 +97,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -117,6 +122,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -144,6 +150,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -167,6 +174,7 @@
"fieldtype": "Attach Image",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
@@ -191,6 +199,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity and Warehouse",
@@ -214,6 +223,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Quantity",
@@ -241,6 +251,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Stock UOM",
@@ -269,6 +280,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "For Warehouse",
@@ -297,6 +309,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -315,10 +328,12 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
+ "default": "Today",
"fieldname": "schedule_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Required Date",
@@ -346,6 +361,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -370,6 +386,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Item Group",
@@ -396,6 +413,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Brand",
@@ -424,6 +442,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Lead Time Date",
@@ -449,6 +468,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Order",
@@ -469,10 +489,37 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Project",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "col_break3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -495,6 +542,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Min Order Qty",
@@ -522,6 +570,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Projected Qty",
@@ -549,6 +598,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Completed Qty",
@@ -574,6 +624,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
@@ -601,7 +652,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-01-30 06:03:41.424851",
+ "modified": "2016-04-06 05:48:04.866802",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request Item",
@@ -609,5 +660,6 @@
"permissions": [],
"read_only": 0,
"read_only_onload": 0,
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.json b/erpnext/stock/doctype/packing_slip/packing_slip.json
index 5a59d94..d8c7952 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.json
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.json
@@ -18,6 +18,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -25,6 +26,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -40,12 +42,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -62,6 +66,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Delivery Note",
@@ -70,6 +75,7 @@
"options": "Delivery Note",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -85,12 +91,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -106,6 +114,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -114,6 +123,7 @@
"options": "PS-",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -129,12 +139,14 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -150,12 +162,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -172,6 +186,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "From Package No.",
@@ -179,6 +194,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -195,12 +211,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -217,6 +235,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "To Package No.",
@@ -224,6 +243,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -240,6 +260,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -247,6 +268,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -262,6 +284,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items",
@@ -269,6 +292,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -284,6 +308,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -292,9 +317,10 @@
"options": "Packing Slip Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -307,6 +333,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Package Weight Details",
@@ -314,6 +341,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -330,6 +358,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Weight",
@@ -337,6 +366,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -352,6 +382,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Weight UOM",
@@ -360,6 +391,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -375,12 +407,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -397,6 +431,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Weight",
@@ -404,6 +439,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -419,6 +455,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Weight UOM",
@@ -427,6 +464,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -442,6 +480,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -450,6 +489,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -465,6 +505,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -474,6 +515,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -489,6 +531,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -496,6 +539,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -511,6 +555,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -519,6 +564,7 @@
"options": "Packing Slip",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -537,7 +583,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:51.222925",
+ "modified": "2016-03-31 06:02:41.545869",
"modified_by": "Administrator",
"module": "Stock",
"name": "Packing Slip",
@@ -646,5 +692,7 @@
],
"read_only": 0,
"read_only_onload": 1,
- "search_fields": "delivery_note"
+ "search_fields": "delivery_note",
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index fac8555..2a7629e 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -181,7 +181,7 @@
locals['Contact'][tn].is_supplier = 1;
if(doc.supplier)
locals['Contact'][tn].supplier = doc.supplier;
- loaddoc('Contact', tn);
+ frappe.set_route('Form', 'Contact', tn);
}
cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) {
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index b14a700..7122459 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -145,7 +145,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "supplier",
"fieldname": "supplier_name",
@@ -836,7 +836,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -1669,7 +1669,7 @@
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -2408,7 +2408,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-truck",
- "idx": 1,
+ "idx": 261,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2416,7 +2416,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-16 15:52:17.581445",
+ "modified": "2016-04-06 05:39:45.971761",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
@@ -2508,26 +2508,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Supplier",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
@@ -2549,5 +2529,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "supplier",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/serial_no/serial_no.json b/erpnext/stock/doctype/serial_no/serial_no.json
index 6414eb9..d39c6d9 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.json
+++ b/erpnext/stock/doctype/serial_no/serial_no.json
@@ -1,1007 +1,1086 @@
{
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:serial_no",
- "creation": "2013-05-16 10:59:15",
- "custom": 0,
- "description": "Distinct unit of an Item",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:serial_no",
+ "creation": "2013-05-16 10:59:15",
+ "custom": 0,
+ "description": "Distinct unit of an Item",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "serial_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Serial No",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "serial_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Serial No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "item_code",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Warehouse",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt",
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "item_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Item Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "description",
- "fieldtype": "Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Description",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "300px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Item Group",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Brand",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Brand",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Purchase / Manufacture Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Purchase / Manufacture Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_document_type",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Creation Document Type",
- "length": 0,
- "no_copy": 1,
- "options": "DocType",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_document_type",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Creation Document Type",
+ "length": 0,
+ "no_copy": 1,
+ "options": "DocType",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_document_no",
- "fieldtype": "Dynamic Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Creation Document No",
- "length": 0,
- "no_copy": 1,
- "options": "purchase_document_type",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_document_no",
+ "fieldtype": "Dynamic Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Creation Document No",
+ "length": 0,
+ "no_copy": 1,
+ "options": "purchase_document_type",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Creation Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "purchase_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Creation Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "purchase_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_time",
- "fieldtype": "Time",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Creation Time",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_time",
+ "fieldtype": "Time",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Creation Time",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Incoming Rate",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "purchase_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "purchase_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Incoming Rate",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "purchase_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Supplier",
- "length": 0,
- "no_copy": 1,
- "options": "Supplier",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Supplier Name",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Supplier Name",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivery Details",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivery Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_document_type",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Delivery Document Type",
- "length": 0,
- "no_copy": 1,
- "options": "DocType",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_document_type",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Delivery Document Type",
+ "length": 0,
+ "no_copy": 1,
+ "options": "DocType",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_document_no",
- "fieldtype": "Dynamic Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Delivery Document No",
- "length": 0,
- "no_copy": 1,
- "options": "delivery_document_type",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_document_no",
+ "fieldtype": "Dynamic Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Delivery Document No",
+ "length": 0,
+ "no_copy": 1,
+ "options": "delivery_document_type",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivery Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "delivery_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivery Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "delivery_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_time",
- "fieldtype": "Time",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivery Time",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_time",
+ "fieldtype": "Time",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivery Time",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "is_cancelled",
- "fieldtype": "Select",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Cancelled",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_cancelled",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "is_cancelled",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Cancelled",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_cancelled",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Name",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Name",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "warranty_amc_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Warranty / AMC Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warranty_amc_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Warranty / AMC Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break6",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break6",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "maintenance_status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Maintenance Status",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "maintenance_status",
- "oldfieldtype": "Select",
- "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "maintenance_status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Maintenance Status",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "maintenance_status",
+ "oldfieldtype": "Select",
+ "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "warranty_period",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Warranty Period (Days)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "warranty_period",
- "oldfieldtype": "Int",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warranty_period",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Warranty Period (Days)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warranty_period",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break7",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "warranty_expiry_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Warranty Expiry Date",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "warranty_expiry_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "warranty_expiry_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Warranty Expiry Date",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warranty_expiry_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "amc_expiry_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "AMC Expiry Date",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "amc_expiry_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amc_expiry_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "AMC Expiry Date",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "amc_expiry_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "More Information",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "serial_no_details",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Serial No Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "serial_no_details",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Serial No Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-barcode",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2015-12-14 15:53:57.486475",
- "modified_by": "Administrator",
- "module": "Stock",
- "name": "Serial No",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-barcode",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-04-06 05:39:46.427967",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Serial No",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Item Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Item Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
}
- ],
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "item_code",
- "sort_field": "modified",
- "sort_order": "DESC"
-}
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "item_code",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index ef1f728..46f8c70 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -55,12 +55,15 @@
onload_post_render: function() {
var me = this;
- cur_frm.get_field("items").grid.set_multiple_add("item_code", "qty");
this.set_default_account(function() {
if(me.frm.doc.__islocal && me.frm.doc.company && !me.frm.doc.amended_from) {
cur_frm.script_manager.trigger("company");
}
});
+
+ if(!this.item_selector) {
+ this.item_selector = new erpnext.ItemSelector({frm: this.frm});
+ }
},
refresh: function() {
@@ -72,6 +75,7 @@
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
this.show_general_ledger();
}
+ erpnext.hide_company();
},
on_submit: function() {
@@ -180,7 +184,7 @@
var excise = frappe.model.make_new_doc_and_get_name('Journal Entry');
excise = locals['Journal Entry'][excise];
excise.voucher_type = 'Excise Entry';
- loaddoc('Journal Entry', excise.name);
+ frappe.set_route('Form', 'Journal Entry', excise.name);
}, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
},
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index 2697fd0..b5efc90 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -51,7 +51,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -89,7 +89,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"default": "Material Issue",
"fieldname": "purpose",
@@ -119,6 +119,33 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:in_list([\"Material Transfer for Manufacture\", \"Manufacture\"], doc.purpose)",
"fieldname": "production_order",
"fieldtype": "Link",
@@ -269,7 +296,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -659,7 +686,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -706,7 +733,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -732,7 +759,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -782,7 +809,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -809,7 +836,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
- "print_hide_if_no_value": 0,
+ "print_hide_if_no_value": 1,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -914,7 +941,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
- "print_hide_if_no_value": 0,
+ "print_hide_if_no_value": 1,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -977,7 +1004,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Subcontract\"",
"fieldname": "supplier_name",
@@ -1083,7 +1110,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"fieldname": "customer_name",
@@ -1344,33 +1371,6 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -1431,7 +1431,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-18 08:37:08.747493",
+ "modified": "2016-04-07 06:40:03.284036",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
@@ -1523,5 +1523,6 @@
"search_fields": "posting_date, from_warehouse, to_warehouse, purpose, remarks",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
index dd680f3..7260403 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
@@ -16,6 +16,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Barcode",
@@ -24,6 +25,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -39,6 +41,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -46,6 +49,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -61,6 +65,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Source Warehouse",
@@ -71,6 +76,7 @@
"options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -86,12 +92,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -107,6 +115,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Target Warehouse",
@@ -117,6 +126,7 @@
"options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -132,12 +142,14 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -153,6 +165,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Item Code",
@@ -163,6 +176,7 @@
"options": "Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -178,12 +192,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -199,6 +215,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Name",
@@ -206,6 +223,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -221,6 +239,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -229,6 +248,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -244,6 +264,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -253,6 +274,7 @@
"oldfieldtype": "Text",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"report_hide": 0,
@@ -270,6 +292,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -277,6 +300,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -292,6 +316,7 @@
"fieldtype": "Attach",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
@@ -300,6 +325,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -315,6 +341,7 @@
"fieldtype": "Image",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image View",
@@ -324,6 +351,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -339,6 +367,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quantity and Rate",
@@ -346,6 +375,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -361,6 +391,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Qty",
@@ -370,6 +401,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -385,6 +417,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Basic Rate (as per Stock UOM)",
@@ -395,6 +428,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -410,6 +444,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Basic Amount",
@@ -418,7 +453,8 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -434,6 +470,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Additional Cost",
@@ -443,6 +480,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -458,6 +496,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amount",
@@ -468,6 +507,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -483,6 +523,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valuation Rate",
@@ -492,6 +533,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -507,12 +549,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -528,6 +572,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "UOM",
@@ -538,6 +583,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -553,6 +599,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Conversion Factor",
@@ -562,6 +609,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -577,6 +625,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock UOM",
@@ -587,6 +636,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -602,6 +652,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Qty as per Stock UOM",
@@ -611,6 +662,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -626,6 +678,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Serial No / Batch",
@@ -633,6 +686,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -648,6 +702,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Serial No",
@@ -657,6 +712,7 @@
"oldfieldtype": "Text",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -672,12 +728,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -693,6 +751,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Batch No",
@@ -703,6 +762,7 @@
"options": "Batch",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -718,6 +778,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Accounting",
@@ -725,6 +786,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -741,6 +803,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Difference Account",
@@ -749,6 +812,7 @@
"options": "Account",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -764,12 +828,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -787,6 +853,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Cost Center",
@@ -795,6 +862,7 @@
"options": "Cost Center",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -810,6 +878,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -817,6 +886,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -832,6 +902,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Actual Qty (at source/target)",
@@ -841,6 +912,7 @@
"oldfieldtype": "Read Only",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -857,6 +929,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "BOM No",
@@ -865,6 +938,7 @@
"options": "BOM",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -880,12 +954,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -902,6 +978,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Request",
@@ -910,6 +987,7 @@
"options": "Material Request",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -925,6 +1003,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Material Request Item",
@@ -933,6 +1012,7 @@
"options": "Material Request Item",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -950,12 +1030,14 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:58.140173",
+ "modified": "2016-04-06 05:57:40.309609",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry Detail",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "ASC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
index 180f114..32beb1a 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
@@ -17,6 +17,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Item Code",
@@ -27,6 +28,7 @@
"options": "Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 1,
"report_hide": 0,
@@ -44,6 +46,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Serial No",
@@ -51,6 +54,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 1,
"report_hide": 0,
@@ -68,6 +72,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Batch No",
@@ -77,6 +82,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -92,6 +98,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Warehouse",
@@ -102,6 +109,7 @@
"options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 1,
"report_hide": 0,
@@ -119,6 +127,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Posting Date",
@@ -128,6 +137,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 1,
"report_hide": 0,
@@ -145,6 +155,7 @@
"fieldtype": "Time",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Posting Time",
@@ -154,6 +165,7 @@
"oldfieldtype": "Time",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 1,
"report_hide": 0,
@@ -171,6 +183,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Voucher Type",
@@ -181,6 +194,7 @@
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -198,6 +212,7 @@
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Voucher No",
@@ -208,6 +223,7 @@
"options": "voucher_type",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -225,6 +241,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Voucher Detail No",
@@ -234,6 +251,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -251,6 +269,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Actual Quantity",
@@ -260,6 +279,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -277,6 +297,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Incoming Rate",
@@ -287,6 +308,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -302,6 +324,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Outgoing Rate",
@@ -311,6 +334,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -326,6 +350,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock UOM",
@@ -336,6 +361,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -353,6 +379,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Actual Qty After Transaction",
@@ -362,6 +389,7 @@
"oldfieldtype": "Currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -379,6 +407,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valuation Rate",
@@ -389,6 +418,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -406,6 +436,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock Value",
@@ -416,6 +447,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -431,6 +463,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock Value Difference",
@@ -439,6 +472,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -454,6 +488,7 @@
"fieldtype": "Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Stock Queue (FIFO)",
@@ -463,6 +498,7 @@
"oldfieldtype": "Text",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 1,
"reqd": 0,
@@ -478,6 +514,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Project",
@@ -486,6 +523,7 @@
"options": "Project",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -501,6 +539,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -511,6 +550,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -528,6 +568,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Fiscal Year",
@@ -537,6 +578,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"report_hide": 0,
@@ -554,6 +596,7 @@
"fieldtype": "Select",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Cancelled",
@@ -562,6 +605,7 @@
"options": "\nNo\nYes",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 1,
"reqd": 0,
@@ -580,7 +624,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:58.277731",
+ "modified": "2016-03-29 13:26:08.241138",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Ledger Entry",
@@ -597,7 +641,7 @@
"if_owner": 0,
"import": 0,
"permlevel": 0,
- "print": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Stock User",
@@ -630,5 +674,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse/warehouse.js b/erpnext/stock/doctype/warehouse/warehouse.js
index 22396b7..f1f0b66 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.js
+++ b/erpnext/stock/doctype/warehouse/warehouse.js
@@ -1,9 +1,25 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-cur_frm.cscript.refresh = function(doc) {
- cur_frm.toggle_display('warehouse_name', doc.__islocal);
-}
+frappe.ui.form.on("Warehouse", {
+ refresh: function(frm) {
+ frm.toggle_display('warehouse_name', frm.doc.__islocal);
+
+ frm.add_custom_button(__("Stock Balance"), function() {
+ frappe.set_route("query-report", "Stock Balance", {"warehouse": frm.doc.name});
+ });
+ if(frm.doc.__onload && frm.doc.__onload.account) {
+ frm.add_custom_button(__("General Ledger"), function() {
+ frappe.route_options = {
+ "account": frm.doc.__onload.account,
+ "company": frm.doc.company
+ }
+ frappe.set_route("query-report", "General Ledger");
+ });
+ }
+ }
+});
+
cur_frm.set_query("create_account_under", function() {
return {
diff --git a/erpnext/stock/doctype/warehouse/warehouse.json b/erpnext/stock/doctype/warehouse/warehouse.json
index e2867eb..00fe999 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.json
+++ b/erpnext/stock/doctype/warehouse/warehouse.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse Detail",
@@ -25,6 +26,7 @@
"oldfieldtype": "Section Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -40,6 +42,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse Name",
@@ -49,6 +52,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -64,8 +68,9 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
- "in_list_view": 0,
+ "in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
@@ -74,6 +79,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -91,6 +97,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Account",
@@ -99,6 +106,7 @@
"options": "Account",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -114,6 +122,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
@@ -121,6 +130,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -137,6 +147,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse Contact Info",
@@ -144,6 +155,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -159,6 +171,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Email Id",
@@ -168,6 +181,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -183,6 +197,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Phone No",
@@ -193,6 +208,7 @@
"options": "Phone",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -208,6 +224,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mobile No",
@@ -218,6 +235,7 @@
"options": "Phone",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -233,6 +251,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -240,6 +259,7 @@
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -255,6 +275,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address Line 1",
@@ -264,6 +285,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -279,6 +301,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address Line 2",
@@ -288,6 +311,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -303,6 +327,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "City",
@@ -312,6 +337,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -327,6 +353,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "State",
@@ -336,6 +363,7 @@
"oldfieldtype": "Select",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -351,6 +379,7 @@
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "PIN",
@@ -360,6 +389,7 @@
"oldfieldtype": "Int",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -378,7 +408,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:30:00.080548",
+ "modified": "2016-03-30 03:31:43.954827",
"modified_by": "Administrator",
"module": "Stock",
"name": "Warehouse",
@@ -506,5 +536,8 @@
}
],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "DESC",
+ "title_field": "warehouse_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index 610c7b8..901b229 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -14,6 +14,14 @@
if not self.warehouse_name.endswith(suffix):
self.name = self.warehouse_name + suffix
+ def onload(self):
+ '''load account name for General Ledger Report'''
+ account = frappe.db.get_value("Account", {
+ "account_type": "Warehouse", "company": self.company, "warehouse": self.name})
+
+ if account:
+ self.set_onload('account', account)
+
def validate(self):
if self.email_id:
validate_email_add(self.email_id, True)
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 7808e50..9032c7f 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -101,9 +101,8 @@
args.item_code = get_item_code(barcode=args.barcode)
elif not args.item_code and args.serial_no:
args.item_code = get_item_code(serial_no=args.serial_no)
-
+
set_transaction_type(args)
-
return args
@frappe.whitelist()
@@ -433,7 +432,6 @@
# update the value
if fieldname in item and fieldname not in ("name", "doctype"):
item[fieldname] = children[i][fieldname]
-
return args
else:
return {
@@ -511,4 +509,4 @@
})
return out
-
\ No newline at end of file
+
diff --git a/erpnext/support/doctype/issue/issue.json b/erpnext/support/doctype/issue/issue.json
index 1f40a21..6c0662e 100644
--- a/erpnext/support/doctype/issue/issue.json
+++ b/erpnext/support/doctype/issue/issue.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Subject",
@@ -40,6 +42,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -64,6 +67,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Subject",
@@ -87,6 +91,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -110,6 +115,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
@@ -137,6 +143,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Raised By (Email)",
@@ -163,6 +170,7 @@
"fieldtype": "Fold",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -185,6 +193,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -209,6 +218,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
@@ -234,6 +244,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -258,6 +269,7 @@
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Resolution Date",
@@ -283,6 +295,7 @@
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "First Responded On",
@@ -306,6 +319,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -330,6 +344,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Lead",
@@ -354,6 +369,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact",
@@ -378,6 +394,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -401,6 +418,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Customer",
@@ -421,12 +439,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Customer Name",
@@ -448,10 +467,37 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Project",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -476,6 +522,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Resolution Details",
@@ -502,6 +549,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -526,6 +574,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Opening Date",
@@ -551,6 +600,7 @@
"fieldtype": "Time",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Opening Time",
@@ -576,6 +626,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
@@ -600,6 +651,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Content Type",
@@ -623,6 +675,7 @@
"fieldtype": "Attach",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Attachment",
@@ -643,14 +696,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-ticket",
- "idx": 1,
+ "idx": 7,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-03 01:08:48.180242",
+ "modified": "2016-04-06 03:15:20.756565",
"modified_by": "Administrator",
"module": "Support",
"name": "Issue",
@@ -658,26 +711,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 1,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
@@ -702,5 +735,6 @@
"search_fields": "status,customer,subject,raised_by",
"sort_order": "ASC",
"timeline_field": "customer",
- "title_field": "subject"
+ "title_field": "subject",
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
index 1f49cae..63af61d 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +43,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Customer",
@@ -67,6 +70,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -91,6 +95,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Status",
@@ -117,6 +122,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Transaction Date",
@@ -142,6 +148,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -167,6 +174,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -180,7 +188,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -193,6 +201,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Schedule",
@@ -218,6 +227,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Generate Schedule",
@@ -242,6 +252,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Schedules",
@@ -268,6 +279,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Info",
@@ -285,13 +297,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "customer",
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Customer Name",
@@ -318,6 +331,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Person",
@@ -343,6 +357,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mobile No",
@@ -367,6 +382,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Email",
@@ -390,6 +406,7 @@
"fieldtype": "Small Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact",
@@ -413,6 +430,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -436,6 +454,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Address",
@@ -460,6 +479,7 @@
"fieldtype": "Small Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address",
@@ -485,6 +505,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Territory",
@@ -513,6 +534,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
@@ -537,6 +559,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -563,6 +586,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -590,7 +614,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-03 01:09:50.703964",
+ "modified": "2016-04-06 03:15:16.876595",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Schedule",
@@ -621,5 +645,6 @@
"read_only_onload": 0,
"search_fields": "status,customer,customer_name",
"sort_order": "DESC",
- "timeline_field": "customer"
+ "timeline_field": "customer",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.json b/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
index fdeb39c..973e057 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
@@ -87,7 +87,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "customer_name",
"fieldtype": "Data",
@@ -759,7 +759,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-03 05:46:55.140348",
+ "modified": "2016-04-06 03:15:20.528791",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Visit",
@@ -792,5 +792,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "customer_name"
+ "title_field": "customer_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.json b/erpnext/support/doctype/warranty_claim/warranty_claim.json
index dd20fae..f6fcc87 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.json
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.json
@@ -559,7 +559,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "customer",
"fieldname": "customer_name",
@@ -1007,7 +1007,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-03 05:42:57.634257",
+ "modified": "2016-04-06 03:15:18.376985",
"modified_by": "Administrator",
"module": "Support",
"name": "Warranty Claim",
@@ -1040,5 +1040,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "customer_name"
+ "title_field": "customer_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.py b/erpnext/support/doctype/warranty_claim/warranty_claim.py
index 93f5245..b4427be 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.py
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.py
@@ -5,7 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe import session, _
-from frappe.utils import today
+from frappe.utils import today, now_datetime
@@ -21,7 +21,7 @@
if self.status=="Closed" and \
frappe.db.get_value("Warranty Claim", self.name, "status")!="Closed":
- self.resolution_date = today()
+ self.resolution_date = now_datetime()
def on_cancel(self):
lst = frappe.db.sql("""select t1.name
diff --git a/erpnext/tasks.py b/erpnext/tasks.py
deleted file mode 100644
index cef0ac9..0000000
--- a/erpnext/tasks.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# MIT License. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.celery_app import celery_task, task_logger
-from frappe.utils.scheduler import log
-
-@celery_task()
-def send_newsletter(site, newsletter, event):
- # hack! pass event="bulk_long" to queue in longjob queue
- try:
- frappe.connect(site=site)
- doc = frappe.get_doc("Newsletter", newsletter)
- doc.send_bulk()
-
- except:
- frappe.db.rollback()
-
- task_logger.error(site)
- task_logger.error(frappe.get_traceback())
-
- # wasn't able to send emails :(
- doc.db_set("email_sent", 0)
- frappe.db.commit()
-
- log("send_newsletter")
-
- raise
-
- else:
- frappe.db.commit()
-
- finally:
- frappe.destroy()
diff --git a/erpnext/templates/emails/request_for_quotation.html b/erpnext/templates/emails/request_for_quotation.html
new file mode 100644
index 0000000..aedd8e2
--- /dev/null
+++ b/erpnext/templates/emails/request_for_quotation.html
@@ -0,0 +1,11 @@
+<h3>{{_("Request for Quotation")}}</h3>
+<p>{{ message }}</p>
+{% if update_password_link %}
+<p>{{_("Please click on the following link to set your new password")}}:</p>
+<p><a href="{{ update_password_link }}">{{ update_password_link }}</a></p>
+{% else %}
+<p>{{_("Request for quotation can be access by clicking following link")}}:</p>
+<p><a href="{{ rfq_link }}">Submit your Quotation</a></p>
+{% endif %}
+<p>{{_("Thank you")}},<br>
+{{ user_fullname }}</p>
\ No newline at end of file
diff --git a/erpnext/templates/generators/job_opening.html b/erpnext/templates/generators/job_opening.html
index 9cfa888..bbc5fee 100644
--- a/erpnext/templates/generators/job_opening.html
+++ b/erpnext/templates/generators/job_opening.html
@@ -12,8 +12,10 @@
<div>{{ description }}</div>
-<a class='btn btn-primary'
- href='/job_application?job_title={{ doc.job_title }}'>
+<p>
+ <a class='btn btn-primary'
+ href='/job_application?job_title={{ doc.name }}'>
{{ _("Apply Now") }}</a>
+</p>
{% endblock %}
diff --git a/erpnext/templates/includes/cart.css b/erpnext/templates/includes/cart.css
index 7a18530..07302db 100644
--- a/erpnext/templates/includes/cart.css
+++ b/erpnext/templates/includes/cart.css
@@ -23,3 +23,10 @@
margin-top: 80px;
margin-bottom: 60px;
}
+
+.cart-link {
+ margin-top: 40px;
+ text-align: right;
+
+
+}
\ No newline at end of file
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index 0c29569..9cb5e6e 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -147,3 +147,8 @@
$(".cart-icon").hide();
shopping_cart.bind_events();
});
+
+function show_terms() {
+ var html = $(".cart-terms").html();
+ frappe.msgprint(html);
+}
diff --git a/erpnext/templates/includes/projects.css b/erpnext/templates/includes/projects.css
new file mode 100644
index 0000000..8c83e17
--- /dev/null
+++ b/erpnext/templates/includes/projects.css
@@ -0,0 +1,95 @@
+/* CSS used here will be applied after bootstrap.css */
+
+.underline {
+ text-decoration: underline;
+}
+
+.page-container {
+ font-weight: normal;
+ margin: 50px auto;
+ max-width: 700px;
+}
+
+.project-item:hover {
+ background-color: #f7f7f7;
+}
+
+.project-item {
+ color: #6c7680;
+ font-size: 14px;
+}
+
+.task-subject
+{
+ margin: 0px;
+}
+
+.item-timestamp
+{
+ font-size: 10px;
+}
+.page-container .project-item {
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+#project-search {
+ position: relative;
+ outline:none;
+ border:none;
+}
+
+.task-link, .timelog-link {
+ font-weight: bold;
+}
+
+.task-link.seen, .timelog-link.seen {
+ font-weight: normal;
+}
+
+.row-header {
+ font-size: 14px;
+ font-weight: 500;
+ padding-bottom: 8px;
+ border-bottom: 2px solid #d1d8dd;
+ margin: 0!important;
+}
+
+.content_display{
+ padding: 5px;
+ font-weight: normal;
+ font-size: 12px;
+ vertical-align: middle;
+ color: #6c7680;
+}
+
+.close-btn{
+ display: none;
+}
+
+.content_display:hover .close-btn{
+ display : block;
+}
+
+.btn-link{
+ padding: 0 10px 0 0;
+}
+
+.bold {
+ font-weight: bold;
+}
+
+
+.task-btn, .issue-btn, .timelog-btn{
+ padding: 8px;
+}
+
+.gravatar-top{
+ margin-top:8px;
+}
+
+.progress-hg{
+ margin-bottom: 0!important;
+ margin-top: 30px!important;
+ height:5px;
+}
\ No newline at end of file
diff --git a/erpnext/templates/includes/projects/macros.html b/erpnext/templates/includes/projects/macros.html
new file mode 100644
index 0000000..5b22583
--- /dev/null
+++ b/erpnext/templates/includes/projects/macros.html
@@ -0,0 +1,2 @@
+{% macro back_link(doc) %}&back-to=/projects?project={{ doc.name }}&back-to-title={{ doc.project_name }}{% endmacro %}
+
diff --git a/erpnext/templates/includes/projects/project_row.html b/erpnext/templates/includes/projects/project_row.html
new file mode 100644
index 0000000..fcd0e22
--- /dev/null
+++ b/erpnext/templates/includes/projects/project_row.html
@@ -0,0 +1,28 @@
+{% if doc.status=="Open" %}
+<div class="web-list-item">
+ <a class="no-decoration" href="/projects?project={{ doc.name }}">
+ <div class="row">
+ <div class="col-xs-4">
+
+ {{ doc.name }}
+ </div>
+ <div class="col-xs-4">
+ {% if doc.percent_complete %}
+ <div class="progress" style="margin-bottom: 0!important; margin-top: 10px!important; height:5px;">
+ <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success"}}" role="progressbar"
+ aria-valuenow="{{ doc.percent_complete|round|int }}"
+ aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
+ </div>
+ </div>
+ {% else %}
+ <span class="indicator {{ "red" if doc.status=="Open" else "darkgrey" }}">
+ {{ doc.status }}</span>
+ {% endif %}
+ </div>
+ <div class="col-xs-4 text-right small text-muted">
+ {{ frappe.utils.pretty_date(doc.modified) }}
+ </div>
+ </div>
+ </a>
+</div>
+{% endif %}
diff --git a/erpnext/templates/includes/projects/project_search_box.html b/erpnext/templates/includes/projects/project_search_box.html
new file mode 100644
index 0000000..ab02f0c
--- /dev/null
+++ b/erpnext/templates/includes/projects/project_search_box.html
@@ -0,0 +1,30 @@
+<div class="project-search text-muted pull-right">
+ <input type="text" id="project-search" placeholder="Quick Search">
+ <i class="octicon octicon-search"></i>
+</div>
+<div class="clearfix pull-right" style="width:300px;">
+ <h4 class="project-search-results pull-left"></h4>
+ <p class="pull-right">
+ <a style="display: none; padding-left:5px;" href="/projects?project={{doc.name}}" class="octicon octicon-x text-extra-muted clear" title="Clear Search" ></a>
+ </p>
+</div>
+
+<script>
+frappe.ready(function() {
+ if(get_url_arg("q")){
+ var txt = get_url_arg("q");
+ $(".project-search-results").html("Search results for : " + txt);
+ $(".clear").toggle(true);
+ }
+ var thread = null;
+ function findResult(t) {
+ window.location.href="/projects?project={{doc.name}}&q=" + t;
+ }
+
+ $("#project-search").keyup(function() {
+ clearTimeout(thread);
+ var $this = $(this); thread = setTimeout(function(){findResult($this.val())}, 1000);
+ });
+ $(".form-search").on("submit", function() { return false; });
+});
+</script>
\ No newline at end of file
diff --git a/erpnext/templates/includes/projects/project_tasks.html b/erpnext/templates/includes/projects/project_tasks.html
new file mode 100644
index 0000000..b4e5cec
--- /dev/null
+++ b/erpnext/templates/includes/projects/project_tasks.html
@@ -0,0 +1,27 @@
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
+{% for task in doc.tasks %}
+ <div class='task'>
+ <div class='row project-item'>
+ <div class='col-xs-1 gravatar-top'>
+ {% if task.todo %}
+ <span class="avatar avatar-small" title="{{ task.todo.owner }}">
+ <img src="{{ task.todo.user_image }}">
+ </span>
+ {% else %}
+ <span class="avatar avatar-small avatar-empty"></span>
+ {% endif %}
+ </div>
+ <div class='col-xs-11'>
+ <a class="no-decoration task-link {{ task.css_seen }}" href="/tasks?name={{ task.name }}{{ back_link(doc) }}">
+ <div class="task-subject">{{ task.subject }}</div>
+ <span class="item-timestamp">modified {{ frappe.utils.pretty_date(task.modified) }}</span>
+ </a>
+ <span class="pull-right list-comment-count small {{ "text-extra-muted" if task.comment_count==0 else "text-muted" }}">
+ <i class="octicon octicon-comment-discussion"></i>
+ {{ task.comment_count }}
+ </span>
+ </div>
+ </div>
+ </div>
+{% endfor %}
diff --git a/erpnext/templates/includes/projects/project_timelogs.html b/erpnext/templates/includes/projects/project_timelogs.html
new file mode 100644
index 0000000..c9a40b3
--- /dev/null
+++ b/erpnext/templates/includes/projects/project_timelogs.html
@@ -0,0 +1,21 @@
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
+{% for timelog in doc.timelogs %}
+<div class='timelog'>
+ <div class='row project-item'>
+ <div class='col-xs-1 gravatar-top'>
+ <span class="avatar avatar-small" title="{{ timelog.modified_by }}"> <img src="{{ timelog.user_image }}"></span>
+ </div>
+ <div class='col-xs-11'>
+ <a class="no-decoration timelog-link {{ timelog.css_seen }}" href="/time-log?name={{ timelog.name}}{{ back_link(doc) }}">
+ <div class="timelog-subject">{{ timelog.title }}</div>
+ <span class="item-timestamp">From {{ frappe.format_date(timelog.from_time) }} to {{ frappe.format_date(timelog.to_time) }}</span>
+ </a>
+ <span class="pull-right list-comment-count small {{ "text-extra-muted" if timelog.comment_count==0 else "text-muted" }}">
+ <i class="octicon octicon-comment-discussion"></i>
+ {{ timelog.comment_count }}
+ </span>
+ </div>
+ </div>
+</div>
+{% endfor %}
\ No newline at end of file
diff --git a/erpnext/templates/includes/rfq.js b/erpnext/templates/includes/rfq.js
new file mode 100644
index 0000000..ea003d8
--- /dev/null
+++ b/erpnext/templates/includes/rfq.js
@@ -0,0 +1,87 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+window.doc={{ doc.as_json() }};
+
+$(document).ready(function() {
+ new rfq();
+ doc.supplier = "{{ doc.supplier }}"
+ doc.currency = "{{ doc.currency }}"
+ doc.number_format = "{{ doc.number_format }}"
+ doc.buying_price_list = "{{ doc.buying_price_list }}"
+});
+
+rfq = Class.extend({
+ init: function(){
+ this.onfocus_select_all();
+ this.change_qty();
+ this.change_rate();
+ this.terms();
+ this.submit_rfq();
+ },
+
+ onfocus_select_all: function(){
+ $("input").click(function(){
+ $(this).select();
+ })
+ },
+
+ change_qty: function(){
+ var me = this;
+ $('.rfq-items').on("change", ".rfq-qty", function(){
+ me.idx = parseFloat($(this).attr('data-idx'));
+ me.qty = parseFloat($(this).val());
+ me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val());
+ me.update_qty_rate();
+ })
+ },
+
+ change_rate: function(){
+ var me = this;
+ $(".rfq-items").on("change", ".rfq-rate", function(){
+ me.idx = parseFloat($(this).attr('data-idx'));
+ me.rate = parseFloat($(this).val());
+ me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val());
+ me.update_qty_rate();
+ })
+ },
+
+ terms: function(){
+ $(".terms").on("change", ".terms-feedback", function(){
+ doc.terms = $(this).val();
+ })
+ },
+
+ update_qty_rate: function(){
+ var me = this;
+ doc.grand_total = 0.0;
+ $.each(doc.items, function(idx, data){
+ if(data.idx == me.idx){
+ data.qty = me.qty;
+ data.rate = me.rate;
+ data.amount = (me.rate * me.qty) || 0.0;
+ $(repl('.rfq-amount[data-idx=%(idx)s]',{'idx': me.idx})).text(format_number(data.amount, doc.number_format, 2));
+ }
+
+ doc.grand_total += flt(data.amount);
+ $('.tax-grand-total').text(format_number(doc.grand_total, doc.number_format, 2));
+ })
+ },
+
+ submit_rfq: function(){
+ $('.btn-sm').click(function(){
+ frappe.freeze();
+ frappe.call({
+ type: "POST",
+ method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.create_supplier_quotation",
+ args: {
+ doc: doc
+ },
+ btn: this,
+ callback: function(r){
+ frappe.unfreeze();
+ }
+ })
+ })
+ }
+})
diff --git a/erpnext/templates/includes/rfq/rfq_items.html b/erpnext/templates/includes/rfq/rfq_items.html
new file mode 100644
index 0000000..1e99a76
--- /dev/null
+++ b/erpnext/templates/includes/rfq/rfq_items.html
@@ -0,0 +1,30 @@
+{% from "erpnext/templates/includes/rfq/rfq_macros.html" import item_name_and_description %}
+
+{% for d in doc.items %}
+<div class="rfq-item">
+ <div class="row">
+ <div class="col-sm-6 col-xs-6" style="margin-bottom: 10px;margin-top: 5px;">
+ {{ item_name_and_description(d, doc) }}
+ </div>
+ <!-- <div class="col-sm-2 col-xs-2" style="margin-bottom: 10px;">
+ <textarea type="text" style="margin-top: 5px;" class="input-with-feedback form-control rfq-offer_detail" ></textarea>
+ </div> -->
+ <div class="col-sm-2 col-xs-2 text-right">
+ <input type="number" class="form-control text-right rfq-qty" style="margin-top: 5px; max-width: 70px;display: inline-block"
+ value = "{{ d.get_formatted('qty') }}"
+ data-idx="{{ d.idx }}">
+ <p class="text-muted small" style="margin-top: 10px;">
+ {{_("UOM") + ": "+ d.uom}}
+ </p>
+ </div>
+ <div class="col-sm-2 col-xs-2 text-right">
+ {{doc.currency_symbol}} <input type="number" class="form-control text-right rfq-rate"
+ style="margin-top: 5px; max-width: 70px;display: inline-block" value="0.00"
+ data-idx="{{ d.idx }}">
+ </div>
+ <div class="col-sm-2 col-xs-2 text-right" style="padding-top: 9px;">
+ {{doc.currency_symbol}} <span class="rfq-amount" data-idx="{{ d.idx }}">0.00</span>
+ </div>
+ </div>
+ </div>
+{% endfor %}
\ No newline at end of file
diff --git a/erpnext/templates/includes/rfq/rfq_macros.html b/erpnext/templates/includes/rfq/rfq_macros.html
new file mode 100644
index 0000000..95bbcfe
--- /dev/null
+++ b/erpnext/templates/includes/rfq/rfq_macros.html
@@ -0,0 +1,21 @@
+{% from "erpnext/templates/includes/macros.html" import product_image_square %}
+
+{% macro item_name_and_description(d, doc) %}
+ <div class="row">
+ <div class="col-xs-4 col-sm-2 order-image-col">
+ <div class="order-image">
+ {{ product_image_square(d.image) }}
+ </div>
+ </div>
+ <div class="col-xs-8 col-sm-10">
+ {{ d.item_code }}
+ <p class="text-muted small">{{ d.description }}</p>
+ {% set supplier_part_no = frappe.db.get_value("Item Supplier", {'parent': d.item_code, 'supplier': doc.supplier}, "supplier_part_no") %}
+ <p class="text-muted small supplier-part-no">
+ {% if supplier_part_no %}
+ {{_("Supplier Part No") + ": "+ supplier_part_no}}
+ {% endif %}
+ </p>
+ </div>
+ </div>
+{% endmacro %}
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index 6891bce..f2104f9 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -61,6 +61,15 @@
</div>
<div id="cart-totals">
</div>
+ {% if doc.tc_name %}
+ <div class="cart-terms" style="display: none;" title={{doc.tc_name}}>
+ {{doc.tc_name}}
+ {{doc.terms}}
+ </div>
+ <div class="cart-link">
+ <a href="#" onclick="show_terms();return false;">*Terms and Conditions</a>
+ </div>
+ {% endif %}
<div class="cart-addresses">
{% include "templates/includes/cart/cart_address.html" %}
</div>
diff --git a/erpnext/templates/pages/cart_terms.html b/erpnext/templates/pages/cart_terms.html
new file mode 100644
index 0000000..521c583
--- /dev/null
+++ b/erpnext/templates/pages/cart_terms.html
@@ -0,0 +1,2 @@
+
+<div>{{doc.terms}}</div>
\ No newline at end of file
diff --git a/erpnext/templates/pages/edit-profile.html b/erpnext/templates/pages/edit-profile.html
deleted file mode 100644
index f10e0a3..0000000
--- a/erpnext/templates/pages/edit-profile.html
+++ /dev/null
@@ -1,55 +0,0 @@
-{% extends "templates/web.html" %}
-
-{% block title %} {{ "My Profile" }} {% endblock %}
-
-{% block header %}<h2>My Profile</h2>{% endblock %}
-
-{% block page_content %}
-<div class="user-content" style="max-width: 500px;">
- <div class="alert alert-warning" id="message" style="display: none;"></div>
- <form>
- <fieldset>
- <label>Full Name</label>
- <input class="form-control" type="text" id="fullname" placeholder="Your Name">
- </fieldset>
- <fieldset>
- <label>Company Name</label>
- <input class="form-control" type="text" id="company_name" placeholder="Company Name" value="{{ company_name }}">
- </fieldset>
- <fieldset>
- <label>Mobile No</label>
- <input class="form-control" type="text" id="mobile_no" placeholder="Mobile No" value="{{ mobile_no }}">
- </fieldset>
- <fieldset>
- <label>Phone</label>
- <input class="form-control" type="text" id="phone" placeholder="Phone" value="{{ phone }}">
- </fieldset>
- <button id="update_user" type="submit" class="btn btn-default">Update</button>
- </form>
-</div>
-<script>
-frappe.ready(function() {
- $("#fullname").val(getCookie("full_name") || "");
- $("#update_user").click(function() {
- frappe.call({
- method: "erpnext.templates.pages.edit_profile.update_user",
- type: "POST",
- args: {
- fullname: $("#fullname").val(),
- company_name: $("#company_name").val(),
- mobile_no: $("#mobile_no").val(),
- phone: $("#phone").val()
- },
- btn: this,
- msg: $("#message"),
- callback: function(r) {
- if(!r.exc) $("#user-full-name").html($("#fullname").val());
- }
- });
- return false;
- })
-})
-</script>
-<!-- no-sidebar -->
-{% endblock %}
-
diff --git a/erpnext/templates/pages/edit_profile.py b/erpnext/templates/pages/edit_profile.py
deleted file mode 100644
index 5ab5545..0000000
--- a/erpnext/templates/pages/edit_profile.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe import _
-from frappe.utils import cstr
-from erpnext.shopping_cart.cart import get_customer
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- party = get_customer()
- mobile_no, phone = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
- "customer": party.name}, ["mobile_no", "phone"])
-
- return {
- "company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
- "mobile_no": cstr(mobile_no),
- "phone": cstr(phone)
- }
-
-@frappe.whitelist()
-def update_user(fullname, password=None, company_name=None, mobile_no=None, phone=None):
- from erpnext.shopping_cart.cart import update_party
- update_party(fullname, company_name, mobile_no, phone)
-
- if not fullname:
- return _("Name is required")
-
- frappe.db.set_value("User", frappe.session.user, "first_name", fullname)
- frappe.local.cookie_manager.set_cookie("full_name", fullname)
-
- return _("Updated")
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 03e625d..3252eb9 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -1,4 +1,4 @@
-t{% extends "templates/web.html" %}
+{% extends "templates/web.html" %}
{% block header %}
<h1>{{ doc.name }}</h1>
diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html
new file mode 100644
index 0000000..6ecdfb6
--- /dev/null
+++ b/erpnext/templates/pages/projects.html
@@ -0,0 +1,92 @@
+{% extends "templates/web.html" %}
+
+{% block title %}{{ doc.project_name }}{% endblock %}
+
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
+{% block header_actions %}
+{% include 'templates/includes/projects/project_search_box.html' %}
+{% endblock %}
+
+{% block breadcrumbs %}
+ <div class="page-breadcrumbs" data-html-block="breadcrumbs">
+ <ul class="breadcrumb">
+ <li>
+ <span class="icon icon-angle-left"></span>
+ <a href="/project">Projects</a>
+ </li>
+ </ul>
+ </div>
+{% endblock %}
+
+
+{% block style %}
+ <style>
+ {% include "templates/includes/projects.css" %}
+ </style>
+{% endblock %}
+
+
+{% block page_content %}
+
+<div class="row">
+<div class="col-xs-6">
+<h2 class= "title">
+ {{ doc.project_name }}
+</h2>
+</div>
+<div class="col-xs-6">
+ {% if doc.percent_complete %}
+ <div class="progress progress-hg">
+ <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
+ aria-valuenow="{{ doc.percent_complete|round|int }}"
+ aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
+ </div>
+ </div>
+ {% endif %}
+</div>
+</div>
+<hr class="small">
+
+<div class="clearfix">
+ <h4 style="float: left;">{{ _("Tasks") }}</h4>
+ <a class="btn btn-secondary btn-default btn-sm" style="float: right; position: relative; top: 10px;" href='/tasks?new=1&project={{ doc.project_name }}{{ back_link(doc) }}'>New task</a>
+</div>
+
+<p>
+<a class='small underline task-status-switch' data-status='Open'>{{ _("Show closed") }}</a>
+</p>
+
+{% if doc.tasks %}
+ <div class='project-task-section'>
+ <div class='project-task'>
+ {% include "erpnext/templates/includes/projects/project_tasks.html" %}
+ </div>
+ <p><a id= 'more-task' style='display: none;' class='more-tasks small underline'>{{ _("More") }}</a><p>
+ </div>
+{% else %}
+ <p class="text-muted">No tasks</p>
+{% endif %}
+
+
+<div class='padding'></div>
+
+<h4>{{ _("Time Logs") }}</h4>
+
+{% if doc.timelogs %}
+ <div class='project-timelogs'>
+ {% include "erpnext/templates/includes/projects/project_timelogs.html" %}
+ </div>
+ {% if doc.timelogs|length > 9 %}
+ <p><a class='more-timelogs small underline'>{{ _("More") }}</a><p>
+ {% endif %}
+{% else %}
+ <p class="text-muted">No time logs</p>
+{% endif %}
+</div>
+
+<script>
+ {% include "erpnext/templates/pages/projects.js" %}
+</script>
+
+{% endblock %}
diff --git a/erpnext/templates/pages/projects.js b/erpnext/templates/pages/projects.js
new file mode 100644
index 0000000..ecacc34
--- /dev/null
+++ b/erpnext/templates/pages/projects.js
@@ -0,0 +1,119 @@
+frappe.ready(function() {
+
+ $('.task-status-switch').on('click', function() {
+ var $btn = $(this);
+ if($btn.attr('data-status')==='Open') {
+ reload_items('closed', 'task', $btn);
+ } else {
+ reload_items('open', 'task', $btn);
+ }
+ })
+
+
+ $('.issue-status-switch').on('click', function() {
+ var $btn = $(this);
+ if($btn.attr('data-status')==='Open') {
+ reload_items('closed', 'issue', $btn);
+ } else {
+ reload_items('open', 'issue', $btn);
+ }
+ })
+
+ var start = 10;
+ $(".more-tasks").click(function() {
+ more_items('task', true);
+ });
+
+ $(".more-issues").click(function() {
+ more_items('issue', true);
+ });
+
+ $(".more-timelogs").click(function() {
+ more_items('timelog', false);
+ });
+
+ $(".more-timelines").click(function() {
+ more_items('timeline', false);
+ });
+
+
+ var reload_items = function(item_status, item, $btn) {
+ $.ajax({
+ method: "GET",
+ url: "/",
+ dataType: "json",
+ data: {
+ cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
+ project: '{{ doc.name }}',
+ item_status: item_status,
+ },
+ dataType: "json",
+ success: function(data) {
+ if(typeof data.message == 'undefined') {
+ $('.project-'+ item).html("No "+ item_status +" "+ item);
+ $(".more-"+ item).toggle(false);
+ }
+ $('.project-'+ item).html(data.message);
+ $(".more-"+ item).toggle(true);
+
+ // update status
+ if(item_status==='open') {
+ $btn.html(__('Show closed')).attr('data-status', 'Open');
+ } else {
+ $btn.html(__('Show open')).attr('data-status', 'Closed');
+ }
+ }
+ });
+
+ }
+
+ var more_items = function(item, item_status){
+ if(item_status)
+ {
+ var item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-closed-'+ item)
+ ? 'closed' : 'open';
+ }
+ $.ajax({
+ method: "GET",
+ url: "/",
+ dataType: "json",
+ data: {
+ cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
+ project: '{{ doc.name }}',
+ start: start,
+ item_status: item_status,
+ },
+ dataType: "json",
+ success: function(data) {
+
+ $(data.message).appendTo('.project-'+ item);
+ if(typeof data.message == 'undefined') {
+ $(".more-"+ item).toggle(false);
+ }
+ start = start+10;
+ }
+ });
+ }
+
+ var close_item = function(item, item_name){
+ var args = {
+ project: '{{ doc.name }}',
+ item_name: item_name,
+ }
+ frappe.call({
+ btn: this,
+ type: "POST",
+ method: "erpnext.templates.pages.projects.set_"+ item +"_status",
+ args: args,
+ callback: function(r) {
+ if(r.exc) {
+ if(r._server_messages)
+ frappe.msgprint(r._server_messages);
+ } else {
+ $(this).remove();
+ }
+ }
+ })
+ return false;
+ }
+});
\ No newline at end of file
diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py
new file mode 100644
index 0000000..86f064c
--- /dev/null
+++ b/erpnext/templates/pages/projects.py
@@ -0,0 +1,85 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+import json
+
+def get_context(context):
+ context.no_cache = 1
+
+ project = frappe.get_doc('Project', frappe.form_dict.project)
+
+ project.has_permission('read')
+
+ project.tasks = get_tasks(project.name, start=0, item_status='open',
+ search=frappe.form_dict.get("q"))
+
+ project.timelogs = get_timelogs(project.name, start=0,
+ search=frappe.form_dict.get("q"))
+
+
+ context.doc = project
+
+
+def get_tasks(project, start=0, search=None, item_status=None):
+ filters = {"project": project}
+ if search:
+ filters["subject"] = ("like", "%{0}%".format(search))
+ if item_status:
+ filters["status"] = item_status
+ tasks = frappe.get_all("Task", filters=filters,
+ fields=["name", "subject", "status", "_seen", "_comments", "modified", "description"],
+ limit_start=start, limit_page_length=10)
+
+ for task in tasks:
+ task.todo = frappe.get_all('ToDo',filters={'reference_name':task.name, 'reference_type':'Task'},
+ fields=["assigned_by", "owner", "modified", "modified_by"])
+
+ if task.todo:
+ task.todo=task.todo[0]
+ task.todo.user_image = frappe.db.get_value('User', task.todo.owner, 'user_image')
+
+
+ task.comment_count = len(json.loads(task._comments or "[]"))
+
+ task.css_seen = ''
+ if task._seen:
+ if frappe.session.user in json.loads(task._seen):
+ task.css_seen = 'seen'
+
+ return tasks
+
+@frappe.whitelist()
+def get_task_html(project, start=0, item_status=None):
+ return frappe.render_template("erpnext/templates/includes/projects/project_tasks.html",
+ {"doc": {
+ "name": project,
+ "project_name": project,
+ "tasks": get_tasks(project, start, item_status=item_status)}
+ }, is_path=True)
+
+def get_timelogs(project, start=0, search=None):
+ filters = {"project": project}
+ if search:
+ filters["title"] = ("like", "%{0}%".format(search))
+
+ timelogs = frappe.get_all('Time Log', filters=filters,
+ fields=['name','title','task','activity_type','from_time','to_time','_comments','_seen','status','modified','modified_by'],
+ limit_start=start, limit_page_length=10)
+ for timelog in timelogs:
+ timelog.user_image = frappe.db.get_value('User', timelog.modified_by, 'user_image')
+
+ timelog.comment_count = len(json.loads(timelog._comments or "[]"))
+
+ timelog.css_seen = ''
+ if timelog._seen:
+ if frappe.session.user in json.loads(timelog._seen):
+ timelog.css_seen = 'seen'
+ return timelogs
+
+@frappe.whitelist()
+def get_timelog_html(project, start=0):
+ return frappe.render_template("erpnext/templates/includes/projects/project_timelogs.html",
+ {"doc": {"timelogs": get_timelogs(project, start)}}, is_path=True)
+
diff --git a/erpnext/templates/pages/rfq.html b/erpnext/templates/pages/rfq.html
new file mode 100644
index 0000000..e4dc4e6
--- /dev/null
+++ b/erpnext/templates/pages/rfq.html
@@ -0,0 +1,82 @@
+{% extends "templates/web.html" %}
+
+{% block header %}
+<h1>{{ doc.name }}</h1>
+{% endblock %}
+
+{% block script %}
+<script>{% include "templates/includes/rfq.js" %}</script>
+{% endblock %}
+
+{% block breadcrumbs %}
+ {% include "templates/includes/breadcrumbs.html" %}
+{% endblock %}
+
+{% block style %}
+<style>
+ {% include "templates/includes/order/order.css" %}
+</style>
+{% endblock %}
+
+{% block header_actions %}
+{% if doc.items %}
+<button class="btn btn-primary btn-sm"
+ type="button">
+ {{ _("Submit") }}</button>
+{% endif %}
+{% endblock %}
+
+{% block page_content %}
+<div class="row">
+ <div class="col-xs-6">
+ <div class="rfq-supplier">{{ doc.supplier }}</div>
+ </div>
+ <div class="col-xs-6 text-muted text-right h6">
+ {{ doc.get_formatted("transaction_date") }}
+ </div>
+</div>
+
+<div class="rfq-content">
+ <div id="order-container">
+ <div id="rfq-items">
+ <div class="row cart-item-header">
+ <div class="col-sm-6 col-xs-6">
+ Items
+ </div>
+ <div class="col-sm-2 col-xs-2 text-right">
+ Qty
+ </div>
+ <div class="col-sm-2 col-xs-2 text-right">
+ Rate
+ </div>
+ <div class="col-sm-2 col-xs-2 text-right">
+ Amount
+ </div>
+ </div>
+ <hr>
+ {% if doc.items %}
+ <div class="rfq-items">
+ {% include "templates/includes/rfq/rfq_items.html" %}
+ </div>
+ {% endif %}
+ </div>
+ {% if doc.items %}
+ <div class="row grand-total-row">
+ <div class="col-xs-10 text-right">{{ _("Grand Total") }}</div>
+ <div class="col-xs-2 text-right">
+ {{doc.currency_symbol}} <span class="tax-grand-total">0.0</span>
+ </div>
+ </div>
+ {% endif %}
+ <div class="row terms">
+ <div class="col-xs-6">
+ <br><br>
+ <p class="text-muted small">{{ _("Notes: ") }}</p>
+ <textarea class="form-control terms-feedback" style="height: 100px;"></textarea>
+ </div>
+ </div>
+ </div>
+</div>
+
+<!-- no-sidebar -->
+{% endblock %}
diff --git a/erpnext/templates/pages/rfq.py b/erpnext/templates/pages/rfq.py
new file mode 100644
index 0000000..4c488d9
--- /dev/null
+++ b/erpnext/templates/pages/rfq.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.controllers.website_list_for_contact import (get_customers_suppliers,
+ get_party_details)
+
+def get_context(context):
+ context.no_cache = 1
+ context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
+ context.parents = frappe.form_dict.parents
+ context.doc.supplier = get_supplier()
+ unauthorized_user(context.doc.supplier)
+ update_supplier_details(context)
+ context["title"] = frappe.form_dict.name
+
+def get_supplier():
+ doctype = frappe.form_dict.doctype
+ parties_doctype = 'Request for Quotation Supplier' if doctype == 'Request for Quotation' else doctype
+ customers, suppliers = get_customers_suppliers(parties_doctype, frappe.session.user)
+ key, parties = get_party_details(customers, suppliers)
+ return parties[0] if key == 'supplier' else ''
+
+def check_supplier_has_docname_access(supplier):
+ status = True
+ if frappe.form_dict.name not in frappe.db.sql_list("""select parent from `tabRequest for Quotation Supplier`
+ where supplier = '{supplier}'""".format(supplier=supplier)):
+ status = False
+ return status
+
+def unauthorized_user(supplier):
+ status = check_supplier_has_docname_access(supplier) or False
+ if status == False:
+ frappe.throw(_("Not Permitted"), frappe.PermissionError)
+
+def update_supplier_details(context):
+ supplier_doc = frappe.get_doc("Supplier", context.doc.supplier)
+ context.doc.currency = supplier_doc.default_currency or frappe.db.get_value("Company", context.doc.company, "default_currency")
+ context.doc.currency_symbol = frappe.db.get_value("Currency", context.doc.currency, "symbol")
+ context.doc.number_format = frappe.db.get_value("Currency", context.doc.currency, "number_format")
+ context.doc.buying_price_list = supplier_doc.default_price_list or ''
\ No newline at end of file
diff --git a/erpnext/templates/pages/task_info.html b/erpnext/templates/pages/task_info.html
new file mode 100644
index 0000000..c756cd5
--- /dev/null
+++ b/erpnext/templates/pages/task_info.html
@@ -0,0 +1,149 @@
+{% extends "templates/web.html" %}
+{% block title %} {{ doc.name }} {% endblock %}
+{% block breadcrumbs %}
+<div class="page-breadcrumbs" data-html-block="breadcrumbs">
+ <ul class="breadcrumb">
+ <li>
+ <span class="icon icon-angle-left"></span>
+ <a href="/projects?project={{ doc.project }}">{{ doc.project }}</a>
+ </li>
+ </ul>
+</div>
+{% endblock %}
+{% block page_content %}
+<div class="row">
+ <div class=" col-sm-8 ">
+ <h1> {{ doc.subject }} </h1>
+ </div>
+
+ <div class="col-sm-4">
+ <div class="page-header-actions-block" data-html-block="header-actions">
+ <button type="submit" class="btn btn-primary btn-sm btn-form-submit">
+ Update</button>
+ <a href="tasks" class="btn btn-default btn-sm">
+ Cancel</a>
+ </div>
+ </div>
+</div>
+
+<div class="page-content-block">
+ <form role="form" data-web-form="tasks">
+
+ <input type="hidden" name="web_form" value="tasks">
+ <input type="hidden" name="doctype" value="Task">
+ <input type="hidden" name="name" value="TASK00056">
+
+ <div class="row">
+ <div class="col-sm-12" style="max-width: 500px;">
+ <div class="form-group">
+ <label for="project" class="control-label text-muted small">Project</label>
+ <input type="text" class="form-control" name="project" readonly value= "{{ doc.project }}">
+ </div>
+
+ <div class="form-group">
+ <label for="subject" class="control-label text-muted small">Subject</label>
+ <input type="text" class="form-control" name="subject" readonly value="{{ doc.subject }}">
+ </div>
+
+ <div class="form-group">
+ <label for="description" class="control-label text-muted small">Details</label>
+ <textarea class="form-control" style="height: 200px;" name="description">{{ doc.description }}</textarea>
+ </div>
+
+ <div class="form-group">
+ <label for="priority" class="control-label text-muted small">Priority</label>
+ <input type="text" class="form-control" name="priority" readonly value="{{ doc.priority }}">
+ </div>
+
+ <div class="form-group">
+ <label for="exp_start_date" class="control-label text-muted small">Expected Start Date</label>
+ <input type="text" class="form-control hasDatepicker" name="exp_start_date" readonly value="{{ doc.exp_start_date }}">
+ </div>
+
+ <div class="form-group">
+ <label for="exp_end_date" class="control-label text-muted small">Expected End Date</label>
+ <input type="text" class="form-control hasDatepicker" name="exp_end_date" readonly value="{{ doc.exp_end_date }}">
+ </div>
+
+ <div class="form-group">
+ <label for="status" class="control-label text-muted small">Status</label>
+ <select class="form-control" name="status" id="status" data-label="Status" data-fieldtype="Select">
+ <option value="Open" selected="selected">
+ Open</option><option value="Working">
+ Working</option><option value="Pending Review">
+ Pending Review</option><option value="Overdue">
+ Overdue</option><option value="Closed">
+ Closed</option><option value="Cancelled">
+ Cancelled</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ </form>
+</div>
+
+<div class="comments">
+ <h3>Comments</h3>
+ <div class="no-comment">
+ {% for comment in comments %}
+ <p class="text-muted">{{comment.sender_full_name}} : {{comment.subject}} on {{comment.communication_date.strftime('%Y-%m-%d')}}</p>
+ {% endfor %}
+ </div>
+ <div class="comment-form-wrapper">
+ <a class="add-comment btn btn-default btn-sm">Add Comment</a>
+ <div style="display: none;" id="comment-form">
+ <p>Add Comment</p>
+ <form>
+ <fieldset>
+ <textarea class="form-control" name="comment" rows="5" placeholder="Comment"></textarea>
+ <p>
+ <button class="btn btn-primary btn-sm" id="submit-comment">Submit</button>
+ </p>
+ </fieldset>
+ </form>
+ </div>
+ </div>
+</div>
+ <script>
+ frappe.ready(function() {
+ var n_comments = $(".comment-row").length;
+ $(".add-comment").click(function() {
+ $(this).toggle(false);
+ $("#comment-form").toggle();
+ $("#comment-form textarea").val("");
+ })
+ $("#submit-comment").click(function() {
+ var args = {
+ comment_by_fullname: "test",
+ comment_by: "admin@localhost.com",
+ comment: $("[name='comment']").val(),
+ reference_doctype: "Task",
+ reference_name: "TASK00069",
+ comment_type: "Comment",
+ page_name: "tasks",
+ }
+
+ frappe.call({
+ btn: this,
+ type: "POST",
+ method: "frappe.templates.includes.comments.comments.add_comment",
+ args: args,
+ callback: function(r) {
+ if(r.exc) {
+ if(r._server_messages)
+ frappe.msgprint(r._server_messages);
+ } else {
+ $(r.message).appendTo("#comment-list");
+ $(".no-comment, .add-comment").toggle(false);
+ $("#comment-form")
+ .replaceWith('<div class="text-muted">Thank you for your comment!</div>')
+ }
+ }
+ })
+
+ return false;
+ })
+ });
+ </script>
+
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/task_info.py b/erpnext/templates/pages/task_info.py
new file mode 100644
index 0000000..b832b88
--- /dev/null
+++ b/erpnext/templates/pages/task_info.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+import frappe
+
+from frappe import _
+
+def get_context(context):
+ context.no_cache = 1
+
+ task = frappe.get_doc('Task', frappe.form_dict.task)
+
+ context.comments = frappe.get_all('Communication', filters={'reference_name': task.name, 'comment_type': 'comment'},
+ fields=['subject', 'sender_full_name', 'communication_date'])
+
+ context.doc = task
\ No newline at end of file
diff --git a/erpnext/templates/pages/timelog_info.html b/erpnext/templates/pages/timelog_info.html
new file mode 100644
index 0000000..76dbc32
--- /dev/null
+++ b/erpnext/templates/pages/timelog_info.html
@@ -0,0 +1,48 @@
+{% extends "templates/web.html" %}
+{% block title %} {{ doc.name }} {% endblock %}
+{% block breadcrumbs %}
+<div class="page-breadcrumbs" data-html-block="breadcrumbs">
+ <ul class="breadcrumb">
+ <li>
+ <span class="icon icon-angle-left"></span>
+ <a href="/projects?project={{ doc.project }}">{{ doc.project }}</a>
+ </li>
+</ul>
+</div>
+{% endblock %}
+
+{% block page_content %}
+ <div class=" col-sm-8 ">
+ <h1> {{ doc.name }} </h1>
+ </div>
+
+ <div class="page-content-block">
+ <div class="row">
+ <div class="col-sm-12" style="max-width: 500px;">
+ <label for="project" class="control-label text-muted small">Project</label>
+ <input type="text" class="form-control" name="project" readonly value= "{{ doc.project }}">
+
+ <label for="activity_type" class="control-label text-muted small">Activity Type</label>
+ <input type="text" class="form-control" name="activity_type" readonly value= "{{ doc.activity_type }}">
+
+ <label for="task" class="control-label text-muted small">Task</label>
+ <input type="text" class="form-control" name="task" readonly value= "{{ doc.task }}">
+
+ <label for="from_time" class="control-label text-muted small">From Time</label>
+ <input type="text" class="form-control" name="from_time" readonly value= "{{ doc.from_time }}">
+
+ <label for="to_time" class="control-label text-muted small">To Time</label>
+ <input type="text" class="form-control" name="to_time" readonly value= "{{ doc.to_time }}">
+
+ <label for="to_time" class="control-label text-muted small">Hours</label>
+ <input type="text" class="form-control" name="Hours" readonly value= "{{ doc.hours }}">
+
+ <label for="status" class="control-label text-muted small">Status</label>
+ <input type="text" class="form-control" name="status" readonly value= "{{ doc.status }}">
+
+ <label for="Note" class="control-label text-muted small">Note</label>
+ <textarea class="form-control" name="Hours" readonly> {{ doc.note }} </textarea>
+ </div>
+ </div>
+ </div>
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/timelog_info.py b/erpnext/templates/pages/timelog_info.py
new file mode 100644
index 0000000..7a3361c
--- /dev/null
+++ b/erpnext/templates/pages/timelog_info.py
@@ -0,0 +1,11 @@
+from __future__ import unicode_literals
+import frappe
+
+from frappe import _
+
+def get_context(context):
+ context.no_cache = 1
+
+ timelog = frappe.get_doc('Time Log', frappe.form_dict.timelog)
+
+ context.doc = timelog
\ No newline at end of file
diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html
index 99215e8..e8a98f0 100644
--- a/erpnext/templates/print_formats/includes/item_table_description.html
+++ b/erpnext/templates/print_formats/includes/item_table_description.html
@@ -2,8 +2,9 @@
{%- set compact_fields = doc.flags.compact_item_fields -%}
{% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
-<div class="pull-left" style="max-width: 38.2%; margin-right: 10px;">
- <img src="{{ doc.image }}" class="img-responsive">
+<div class="pull-left" style="width: 20%; margin-right: 10px;">
+ <div class="square-image" style="background-image: url('{{ doc.image }}')">
+ </div>
</div>
{%- endif %}
diff --git a/erpnext/utilities/bot.py b/erpnext/utilities/bot.py
new file mode 100644
index 0000000..23e1dd4
--- /dev/null
+++ b/erpnext/utilities/bot.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+
+from __future__ import unicode_literals
+
+from frappe.utils.bot import BotParser
+
+import frappe
+from frappe import _
+
+class FindItemBot(BotParser):
+ def get_reply(self):
+ if self.startswith('where is', 'find item', 'locate'):
+ if not frappe.has_permission('Warehouse'):
+ raise frappe.PermissionError
+
+ item = '%{0}%'.format(self.strip_words(self.query, 'where is', 'find item', 'locate'))
+ items = frappe.db.sql('''select name from `tabItem` where item_code like %(txt)s
+ or item_name like %(txt)s or description like %(txt)s''', dict(txt=item))
+
+ if items:
+ out = []
+ warehouses = frappe.get_all("Warehouse")
+ for item in items:
+ found = False
+ for warehouse in warehouses:
+ qty = frappe.db.get_value("Bin", {'item_code': item[0], 'warehouse': warehouse.name}, 'actual_qty')
+ if qty:
+ out.append(_('{0} units of [{1}](#Form/Item/{1}) found in [{2}](#Form/Warehouse/{2})').format(qty,
+ item[0], warehouse.name))
+ found = True
+
+ if not found:
+ out.append(_('[{0}](#Form/Item/{0}) is out of stock').format(item[0]))
+
+ return "\n\n".join(out)
+
+ else:
+ return _("Did not find any item called {0}".format(item))
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/address/address.json b/erpnext/utilities/doctype/address/address.json
index 313f643..d148368 100644
--- a/erpnext/utilities/doctype/address/address.json
+++ b/erpnext/utilities/doctype/address/address.json
@@ -482,7 +482,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "eval:!doc.is_your_company_address",
"fieldname": "customer_name",
@@ -533,7 +533,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "eval:!doc.is_your_company_address",
"fieldname": "supplier_name",
@@ -637,14 +637,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-map-marker",
- "idx": 1,
+ "idx": 5,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-16 16:10:26.435426",
+ "modified": "2016-04-06 05:39:46.951866",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Address",
@@ -735,5 +735,6 @@
"read_only_onload": 0,
"search_fields": "customer, supplier, sales_partner, country, state",
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/contact/contact.json b/erpnext/utilities/doctype/contact/contact.json
index 9fef425..486b93b 100644
--- a/erpnext/utilities/doctype/contact/contact.json
+++ b/erpnext/utilities/doctype/contact/contact.json
@@ -16,6 +16,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -24,6 +25,7 @@
"options": "icon-user",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -39,6 +41,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "First Name",
@@ -48,6 +51,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -57,12 +61,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "last_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Last Name",
@@ -72,6 +77,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -81,12 +87,13 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "email_id",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Email Id",
@@ -97,6 +104,7 @@
"options": "Email",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -112,12 +120,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -134,6 +144,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
@@ -142,6 +153,33 @@
"options": "Passive\nOpen\nReplied",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "phone",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Phone",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "contact_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -153,19 +191,20 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "phone",
- "fieldtype": "Data",
- "hidden": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Phone",
+ "label": "Image",
"length": 0,
"no_copy": 0,
- "oldfieldname": "contact_no",
- "oldfieldtype": "Data",
"permlevel": 0,
- "print_hide": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -181,6 +220,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
@@ -189,6 +229,7 @@
"options": "icon-pushpin",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -204,6 +245,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "User Id",
@@ -213,6 +255,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -222,13 +265,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer",
@@ -239,6 +283,7 @@
"options": "Customer",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -248,13 +293,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Name",
@@ -262,6 +308,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -277,6 +324,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -284,6 +332,7 @@
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -294,13 +343,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier",
@@ -309,6 +359,7 @@
"options": "Supplier",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -318,13 +369,14 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"depends_on": "",
"fieldname": "supplier_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Supplier Name",
@@ -332,6 +384,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -348,6 +401,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Partner",
@@ -356,6 +410,7 @@
"options": "Sales Partner",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -373,6 +428,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Primary Contact",
@@ -382,6 +438,7 @@
"oldfieldtype": "Select",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -397,6 +454,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -405,6 +463,7 @@
"options": "icon-file-text",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -420,6 +479,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mobile No",
@@ -429,6 +489,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -445,6 +506,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Department",
@@ -452,6 +514,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -468,6 +531,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Designation",
@@ -475,6 +539,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -490,6 +555,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Unsubscribed",
@@ -497,6 +563,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -509,13 +576,14 @@
"hide_toolbar": 0,
"icon": "icon-user",
"idx": 1,
+ "image_field": "image",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:43.760924",
+ "modified": "2016-04-06 05:39:47.125816",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Contact",
@@ -764,5 +832,7 @@
}
],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_order": "ASC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py
index dff05bc..a687880 100644
--- a/erpnext/utilities/doctype/contact/contact.py
+++ b/erpnext/utilities/doctype/contact/contact.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.utils import cstr
+from frappe.utils import cstr, has_gravatar
from frappe import _
from erpnext.controllers.status_updater import StatusUpdater
@@ -24,6 +24,8 @@
self.set_status()
self.validate_primary_contact()
self.set_user()
+ if self.email_id:
+ self.image = has_gravatar(self.email_id)
def set_user(self):
if not self.user and self.email_id:
@@ -92,3 +94,13 @@
"contact_department": contact.get("department")
}
return out
+
+def update_contact(doc, method):
+ '''Update contact when user is updated, if contact is found. Called via hooks'''
+ contact_name = frappe.db.get_value("Contact", {"email_id": doc.name})
+ if contact_name:
+ contact = frappe.get_doc("Contact", contact_name)
+ for key in ("first_name", "last_name", "phone"):
+ if doc.get(key):
+ contact.set(key, doc.get(key))
+ contact.save(ignore_permissions=True)