Merge remote-tracking branch 'webnotes/4.0.0-wip' into permissions
Conflicts:
erpnext/accounts/page/accounts_browser/accounts_browser.css
erpnext/controllers/buying_controller.py
erpnext/manufacturing/doctype/production_order/production_order.py
erpnext/patches/patch_list.py
erpnext/selling/doctype/customer/customer.txt
erpnext/selling/doctype/sales_order/sales_order.py
erpnext/selling/doctype/sales_order/test_sales_order.py
erpnext/setup/doctype/features_setup/features_setup.txt
erpnext/stock/doctype/stock_entry/test_stock_entry.py
erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
startup/query_handlers.py
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 8837586..407b2d4 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -37,7 +37,7 @@
// read-only for root accounts
if(!doc.parent_account) {
- cur_frm.perm = [[1,0,0], [1,0,0]];
+ cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root account and cannot be edited."));
} else {
// credit days and type if customer or supplier
diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt
index 459e102..50a6d6d 100644
--- a/erpnext/accounts/doctype/account/account.txt
+++ b/erpnext/accounts/doctype/account/account.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-30 12:49:46",
"docstatus": 0,
- "modified": "2013-09-24 11:22:18",
+ "modified": "2013-12-20 19:23:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -138,6 +138,7 @@
"doctype": "DocField",
"fieldname": "parent_account",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Account",
"oldfieldname": "parent_account",
"oldfieldtype": "Link",
@@ -154,7 +155,6 @@
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable\nWarehouse",
- "permlevel": 0,
"search_index": 0
},
{
@@ -257,7 +257,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Accounts User",
"write": 1
},
@@ -265,7 +267,9 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Auditor",
"write": 0
},
@@ -273,7 +277,9 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Sales User",
"write": 0
},
@@ -281,7 +287,9 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Purchase User",
"write": 0
},
@@ -297,7 +305,12 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
+ "export": 0,
+ "import": 0,
"permlevel": 0,
+ "print": 1,
+ "restrict": 1,
"role": "Accounts Manager",
"write": 1
},
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
index 026cf61..f36e218 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-24 15:49:57",
"docstatus": 0,
- "modified": "2013-09-24 11:52:58",
+ "modified": "2013-12-20 19:22:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Accounts Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "Accounts Manager",
"write": 1
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
index 9905398..47ff4f1 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:37",
"docstatus": 0,
- "modified": "2013-11-03 14:11:31",
+ "modified": "2013-12-20 19:22:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.txt
index f53ff52..31312c9 100644
--- a/erpnext/accounts/doctype/budget_detail/budget_detail.txt
+++ b/erpnext/accounts/doctype/budget_detail/budget_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:04",
"docstatus": 0,
- "modified": "2013-08-22 17:27:59",
+ "modified": "2013-12-20 19:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
index ae668ab..992c8be 100644
--- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
+++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:05",
"docstatus": 0,
- "modified": "2013-07-22 15:30:37",
+ "modified": "2013-12-20 19:23:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -82,7 +82,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"write": 1
},
{
diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
index c8207bd..a171bf6 100644
--- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
+++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:38",
"docstatus": 0,
- "modified": "2013-07-10 14:54:06",
+ "modified": "2013-12-20 19:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt
index 21d6550..d5ff32b 100644
--- a/erpnext/accounts/doctype/c_form/c_form.txt
+++ b/erpnext/accounts/doctype/c_form/c_form.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:06",
"docstatus": 0,
- "modified": "2013-11-02 14:05:25",
+ "modified": "2013-12-20 19:23:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -157,6 +157,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "C-Form",
@@ -166,14 +167,18 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Accounts User",
"write": 1
},
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Accounts Manager",
"write": 1
},
diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
index 99335b7..77dfa72 100644
--- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
+++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:38",
"docstatus": 0,
- "modified": "2013-11-02 16:58:31",
+ "modified": "2013-12-20 19:23:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt
index a9c7add..3f1fab2 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.txt
+++ b/erpnext/accounts/doctype/cost_center/cost_center.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-01-23 19:57:17",
"docstatus": 0,
- "modified": "2013-07-22 15:23:10",
+ "modified": "2013-12-20 19:24:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_copy": 1,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:cost_center_name",
"description": "Track separate Income and Expense for product verticals or divisions.",
@@ -30,11 +31,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Cost Center",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -74,6 +77,7 @@
"doctype": "DocField",
"fieldname": "parent_cost_center",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Cost Center",
"oldfieldname": "parent_cost_center",
"oldfieldtype": "Link",
@@ -171,6 +175,7 @@
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "old_parent",
"no_copy": 1,
"oldfieldname": "old_parent",
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
index 1cf98fb..afa4858 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-22 16:50:25",
"docstatus": 0,
- "modified": "2013-11-25 11:40:02",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:year",
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"doctype": "DocType",
@@ -25,11 +26,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Fiscal Year",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1
},
{
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.txt
index 5740579..3ec5ec6 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.txt
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:06",
"docstatus": 0,
- "modified": "2013-11-03 14:14:09",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "GL Entry",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
index b47d7ed..9de2abb 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-25 10:53:52",
"docstatus": 0,
- "modified": "2013-11-03 14:11:33",
+ "modified": "2013-12-20 19:24:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Journal Voucher",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -459,6 +461,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index aea5d12..53a56aa 100644
--- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:39",
"docstatus": 0,
- "modified": "2013-08-02 18:15:56",
+ "modified": "2013-12-20 19:23:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/mis_control/mis_control.txt b/erpnext/accounts/doctype/mis_control/mis_control.txt
index ed0bedb..28a0df4 100644
--- a/erpnext/accounts/doctype/mis_control/mis_control.txt
+++ b/erpnext/accounts/doctype/mis_control/mis_control.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-03-27 14:35:49",
"docstatus": 0,
- "modified": "2013-07-10 14:54:11",
+ "modified": "2013-12-20 19:23:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
index 5d004e3..5830030 100644
--- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
+++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
@@ -2,11 +2,12 @@
{
"creation": "2012-12-04 17:49:20",
"docstatus": 0,
- "modified": "2013-07-05 14:46:28",
+ "modified": "2013-12-20 19:24:14",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:mode_of_payment",
"doctype": "DocType",
@@ -27,11 +28,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Mode of Payment",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
index accf515..bc4e0f7 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-30 12:49:46",
"docstatus": 0,
- "modified": "2013-07-22 15:31:00",
+ "modified": "2013-12-20 19:23:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Payment to Invoice Matching Tool",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"submit": 0,
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
index 5259f74..1017a98 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:39",
"docstatus": 0,
- "modified": "2013-07-10 14:54:11",
+ "modified": "2013-12-20 19:23:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
index 6c3fadd..37a22a0 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:07",
"docstatus": 0,
- "modified": "2013-08-12 17:13:23",
+ "modified": "2013-12-20 19:24:15",
"modified_by": "Administrator",
"owner": "jai@webnotestech.com"
},
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Period Closing Voucher",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -80,6 +82,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt
index 09a3757..22edcdd 100755
--- a/erpnext/accounts/doctype/pos_setting/pos_setting.txt
+++ b/erpnext/accounts/doctype/pos_setting/pos_setting.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
- "modified": "2013-11-02 16:58:38",
+ "modified": "2013-12-20 19:24:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -23,11 +23,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "POS Setting",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
index af0eb8e..6df4df4 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
- "modified": "2013-11-22 17:15:27",
+ "modified": "2013-12-20 19:24:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Purchase Invoice",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -181,6 +183,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -787,7 +790,6 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "match": "supplier",
"role": "Supplier",
"submit": 0,
"write": 0
diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
index 49aa688..f10d30e 100644
--- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-08 15:36:46",
"docstatus": 0,
- "modified": "2013-07-10 14:54:12",
+ "modified": "2013-12-20 19:23:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index 1a79636..3f1ae05 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2013-11-02 19:41:17",
+ "modified": "2013-12-20 19:23:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
index 5ea7fc0..9a2a75d 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:04",
"docstatus": 0,
- "modified": "2013-07-10 14:54:18",
+ "modified": "2013-12-20 19:23:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
index f902ade..1430c43 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
- "modified": "2013-07-22 15:22:25",
+ "modified": "2013-12-20 19:24:24",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
{
+ "allow_import": 1,
"autoname": "field:title",
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"doctype": "DocType",
@@ -25,11 +26,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Purchase Taxes and Charges Master",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
index 99bfe5c..7de68a0 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
- "modified": "2013-11-18 15:16:50",
+ "modified": "2013-12-20 19:24:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -30,11 +30,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Invoice",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -141,6 +143,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -1219,7 +1222,6 @@
},
{
"doctype": "DocPerm",
- "match": "customer",
"role": "Customer"
}
]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
index b82f4ac..ad1a9eb 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:41",
"docstatus": 0,
- "modified": "2013-07-10 14:54:19",
+ "modified": "2013-12-20 19:21:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index d7dac74..339115d 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-04 11:02:19",
"docstatus": 0,
- "modified": "2013-11-02 19:41:24",
+ "modified": "2013-12-20 19:21:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
index b006c1d..ab4da2a 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-24 11:39:32",
"docstatus": 0,
- "modified": "2013-12-17 12:38:08",
+ "modified": "2013-12-20 19:21:45",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
index cddf10e..485aa94 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:09",
"docstatus": 0,
- "modified": "2013-10-31 19:25:09",
+ "modified": "2013-12-20 19:24:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:title",
"description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"doctype": "DocType",
@@ -26,11 +27,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Taxes and Charges Master",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
index 27aaa70..082cddc 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-25 11:48:03",
"docstatus": 0,
- "modified": "2013-10-31 19:24:50",
+ "modified": "2013-12-20 19:24:35",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,11 +24,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Shipping Rule",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
index 3784ecb..22af554 100644
--- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
+++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-25 11:54:50",
"docstatus": 0,
- "modified": "2013-07-10 14:54:22",
+ "modified": "2013-12-20 19:21:46",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.css b/erpnext/accounts/page/accounts_browser/accounts_browser.css
deleted file mode 100644
index 718da36..0000000
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.css
+++ /dev/null
@@ -1,29 +0,0 @@
-select.accbrowser-company-select {
- width: 200px;
- margin-top: 2px;
- margin-left: 10px;
-}
-
-span.tree-node-toolbar {
- padding: 2px;
- margin-left: 15px;
- border-radius: 3px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- background-color: #ddd;
-}
-
-.tree-area a.selected {
- font-weight: bold;
- text-decoration: underline;
-}
-
-span.balance-area {
- float: right;
- height: 13px;
-}
-
-span.balance-bold {
- font-weight: bold;
-}
\ 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 fe7f06c..c421332 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -8,7 +8,6 @@
// see ledger
pscript['onload_Accounts Browser'] = function(wrapper){
- console.log($(wrapper).html());
wn.ui.make_app_page({
parent: wrapper,
single_column: true
@@ -122,14 +121,14 @@
}
// bold
- $('.balance-bold').removeClass('balance-bold'); // deselect
- $(link).parent().find('.balance-area:first').addClass('balance-bold'); // select
+ $('.bold').removeClass('bold'); // deselect
+ $(link).parent().find('.balance-area:first').addClass('bold'); // select
},
onrender: function(treenode) {
if (ctype == 'Account' && treenode.data) {
if(treenode.data.balance) {
- treenode.parent.append('<span class="balance-area">'
+ treenode.parent.append('<span class="balance-area pull-right">'
+ format_currency(treenode.data.balance, treenode.data.currency)
+ '</span>');
}
@@ -142,7 +141,7 @@
var data = $(link).data('node-data');
if(!data) return;
- link.toolbar = $('<span class="tree-node-toolbar"></span>').insertAfter(link);
+ link.toolbar = $('<span class="tree-node-toolbar highlight"></span>').insertAfter(link);
var node_links = [];
// edit
diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.txt
index 2b0c6ad..b91a355 100644
--- a/erpnext/buying/doctype/buying_settings/buying_settings.txt
+++ b/erpnext/buying/doctype/buying_settings/buying_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-25 11:04:03",
"docstatus": 0,
- "modified": "2013-08-09 14:38:46",
+ "modified": "2013-12-20 19:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Buying Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.txt
index 40f5756..c796c04 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.txt
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-03-27 14:35:51",
"docstatus": 0,
- "modified": "2013-07-10 14:54:12",
+ "modified": "2013-12-20 19:23:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt
index 3f3937c..0266b80 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.txt
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
- "modified": "2013-11-22 17:20:58",
+ "modified": "2013-12-20 19:24:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Purchase Order",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -141,6 +143,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 0,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -694,7 +697,6 @@
},
{
"doctype": "DocPerm",
- "match": "supplier",
"role": "Supplier"
}
]
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
index 4145a7f..a78c485 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:06",
"docstatus": 0,
- "modified": "2013-11-02 19:41:27",
+ "modified": "2013-12-20 19:23:32",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
index 05ea4e2..f2860cd 100644
--- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
+++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:42",
"docstatus": 0,
- "modified": "2013-07-25 16:33:05",
+ "modified": "2013-12-20 19:23:33",
"modified_by": "Administrator",
"owner": "dhanalekshmi@webnotestech.com"
},
diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
index 1522510..c1ace7c 100644
--- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
+++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:42",
"docstatus": 0,
- "modified": "2013-07-25 16:34:11",
+ "modified": "2013-12-20 19:23:37",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
index d4a2d8f..aa8aa18 100644
--- a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
+++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-30 13:13:03",
"docstatus": 0,
- "modified": "2013-11-02 14:05:38",
+ "modified": "2013-12-20 19:24:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Quality Inspection",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Quality Manager",
@@ -206,6 +208,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
index 0c68cc7..f08e7cd 100644
--- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
+++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:43",
"docstatus": 0,
- "modified": "2013-07-10 14:54:18",
+ "modified": "2013-12-20 19:23:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index 00eaf90..99c7352 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -151,8 +151,7 @@
acc = webnotes.conn.sql("select name from `tabAccount` where master_type = 'Supplier' \
and master_name = %s and docstatus < 2", self.doc.name)
if acc:
- from webnotes.model import delete_doc
- delete_doc('Account', acc[0][0])
+ webnotes.delete_doc('Account', acc[0][0])
def on_trash(self):
self.delete_supplier_address()
diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt
index 5c722f1..c76eb65 100644
--- a/erpnext/buying/doctype/supplier/supplier.txt
+++ b/erpnext/buying/doctype/supplier/supplier.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:11",
"docstatus": 0,
- "modified": "2013-11-19 11:31:28",
+ "modified": "2013-12-20 19:24:36",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "naming_series:",
"description": "Supplier of Goods or Services.",
@@ -28,11 +29,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Supplier",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
index e532aa6..f3bc30c 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:45",
"docstatus": 0,
- "modified": "2013-12-14 17:27:47",
+ "modified": "2013-12-20 19:24:36",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Supplier Quotation",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -141,6 +143,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -632,7 +635,6 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "match": "supplier",
"role": "Supplier",
"submit": 0,
"write": 0
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
index f09f5a8..f0810ff 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
- "modified": "2013-11-02 19:41:29",
+ "modified": "2013-12-20 19:21:50",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index 6382e0d..40de926 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -50,13 +50,12 @@
break
def validate_warehouse(self):
- from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
+ from erpnext.stock.utils import validate_warehouse_company
warehouses = list(set([d.warehouse for d in
self.doclist.get({"doctype": self.tname}) if d.warehouse]))
for w in warehouses:
- validate_warehouse_user(w)
validate_warehouse_company(w, self.doc.company)
def get_purchase_tax_details(self):
diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt
index 8dde5f9..8821b7d 100644
--- a/erpnext/home/doctype/feed/feed.txt
+++ b/erpnext/home/doctype/feed/feed.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-07-03 13:29:42",
"docstatus": 0,
- "modified": "2013-11-15 10:16:00",
+ "modified": "2013-12-20 19:24:07",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -23,11 +23,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Feed",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "System Manager"
diff --git a/erpnext/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.txt
index 8aaa7e1..c7d9aaf 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.txt
+++ b/erpnext/hr/doctype/appraisal/appraisal.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:12",
"docstatus": 0,
- "modified": "2013-07-05 14:24:59",
+ "modified": "2013-12-20 19:23:55",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Appraisal",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"write": 1
@@ -217,6 +219,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
index 794a879..5c15ac6 100644
--- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
+++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:44",
"docstatus": 0,
- "modified": "2013-07-10 14:54:03",
+ "modified": "2013-12-20 19:22:53",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
index 63c14f0..ff887c4 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
@@ -2,11 +2,12 @@
{
"creation": "2012-07-03 13:30:39",
"docstatus": 0,
- "modified": "2013-07-05 14:25:14",
+ "modified": "2013-12-20 19:23:55",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
{
+ "allow_import": 1,
"autoname": "field:kra_title",
"doctype": "DocType",
"document_type": "Master",
@@ -25,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Appraisal Template",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
index 074c247..0657f64 100644
--- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
+++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:44",
"docstatus": 0,
- "modified": "2013-07-10 14:54:03",
+ "modified": "2013-12-20 19:22:54",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
diff --git a/erpnext/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.txt
index 5186a8d..7d383fb 100644
--- a/erpnext/hr/doctype/attendance/attendance.txt
+++ b/erpnext/hr/doctype/attendance/attendance.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:13",
"docstatus": 0,
- "modified": "2013-11-02 14:05:42",
+ "modified": "2013-12-20 19:23:55",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
{
+ "allow_import": 1,
"autoname": "naming_series:",
"doctype": "DocType",
"document_type": "Master",
@@ -28,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Attendance",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -154,6 +157,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Attendance",
diff --git a/erpnext/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.txt
index 3df2cd6..13aa087 100644
--- a/erpnext/hr/doctype/branch/branch.txt
+++ b/erpnext/hr/doctype/branch/branch.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:13",
"docstatus": 0,
- "modified": "2013-07-22 15:30:08",
+ "modified": "2013-12-20 19:23:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:branch",
"doctype": "DocType",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Branch",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.txt
index 1e38f0b..e24064e 100644
--- a/erpnext/hr/doctype/deduction_type/deduction_type.txt
+++ b/erpnext/hr/doctype/deduction_type/deduction_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-22 16:50:30",
"docstatus": 0,
- "modified": "2013-07-22 15:25:14",
+ "modified": "2013-12-20 19:24:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:deduction_name",
"doctype": "DocType",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Deduction Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.txt
index 1f4e420..4cfdcaf 100644
--- a/erpnext/hr/doctype/department/department.txt
+++ b/erpnext/hr/doctype/department/department.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-02-05 11:48:26",
"docstatus": 0,
- "modified": "2013-07-22 15:25:03",
+ "modified": "2013-12-20 19:24:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:department_name",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Department",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.txt
index 75110c2..f9b48e4 100644
--- a/erpnext/hr/doctype/designation/designation.txt
+++ b/erpnext/hr/doctype/designation/designation.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:13",
"docstatus": 0,
- "modified": "2013-07-05 14:35:42",
+ "modified": "2013-12-20 19:24:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:designation_name",
"doctype": "DocType",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Designation",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.txt
index 902a4ed..c5ead63 100644
--- a/erpnext/hr/doctype/earning_type/earning_type.txt
+++ b/erpnext/hr/doctype/earning_type/earning_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-24 11:03:32",
"docstatus": 0,
- "modified": "2013-12-09 16:24:07",
+ "modified": "2013-12-20 19:24:05",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:earning_name",
"doctype": "DocType",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Earning Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index c185963..da72ec7 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -7,13 +7,11 @@
from webnotes.utils import getdate, validate_email_add, cstr, cint
from webnotes.model.doc import make_autoname
from webnotes import msgprint, _
+import webnotes.permissions
+from webnotes.defaults import get_restrictions
+from webnotes.model.controller import DocListController
-
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
-
+class DocType(DocListController):
def autoname(self):
naming_method = webnotes.conn.get_value("HR Settings", None, "emp_created_by")
if not naming_method:
@@ -39,28 +37,36 @@
def on_update(self):
if self.doc.user_id:
+ self.restrict_user()
self.update_user_default()
self.update_profile()
+
+ self.restrict_leave_approver()
+ def restrict_user(self):
+ """restrict to this employee for user"""
+ self.add_restriction_if_required("Employee", self.doc.user_id)
+
def update_user_default(self):
- webnotes.conn.set_default("employee", self.doc.name, self.doc.user_id)
webnotes.conn.set_default("employee_name", self.doc.employee_name, self.doc.user_id)
webnotes.conn.set_default("company", self.doc.company, self.doc.user_id)
- self.set_default_leave_approver()
- def set_default_leave_approver(self):
- employee_leave_approvers = self.doclist.get({"parentfield": "employee_leave_approvers"})
-
- if len(employee_leave_approvers):
- webnotes.conn.set_default("leave_approver", employee_leave_approvers[0].leave_approver,
- self.doc.user_id)
-
- elif self.doc.reports_to:
- from webnotes.profile import Profile
- reports_to_user = webnotes.conn.get_value("Employee", self.doc.reports_to, "user_id")
- if "Leave Approver" in Profile(reports_to_user).get_roles():
- webnotes.conn.set_default("leave_approver", reports_to_user, self.doc.user_id)
-
+ def restrict_leave_approver(self):
+ """restrict to this employee for leave approver"""
+ employee_leave_approvers = [d.leave_approver for d in self.doclist.get({"parentfield": "employee_leave_approvers"})]
+ if self.doc.reports_to and self.doc.reports_to not in employee_leave_approvers:
+ employee_leave_approvers.append(webnotes.conn.get_value("Employee", self.doc.reports_to, "user_id"))
+
+ for user in employee_leave_approvers:
+ self.add_restriction_if_required("Employee", user)
+ self.add_restriction_if_required("Leave Application", user)
+
+ def add_restriction_if_required(self, doctype, user):
+ if webnotes.permissions.has_only_non_restrict_role(webnotes.get_doctype(doctype), user) \
+ and self.doc.name not in get_restrictions(user).get("Employee", []):
+
+ webnotes.defaults.add_default("Employee", self.doc.name, user, "Restriction")
+
def update_profile(self):
# add employee role if missing
if not "Employee" in webnotes.conn.sql_list("""select role from tabUserRole
diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt
index 856f26e..f8b08e0 100644
--- a/erpnext/hr/doctype/employee/employee.txt
+++ b/erpnext/hr/doctype/employee/employee.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-03-07 09:04:18",
"docstatus": 0,
- "modified": "2013-11-03 11:19:10",
+ "modified": "2013-12-23 19:35:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "naming_series:",
"doctype": "DocType",
@@ -28,11 +29,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Employee",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -415,6 +418,7 @@
"doctype": "DocField",
"fieldname": "reports_to",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Reports to",
"oldfieldname": "reports_to",
"oldfieldtype": "Link",
@@ -749,7 +753,6 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "match": "employee",
"role": "Employee",
"write": 0
},
@@ -757,7 +760,7 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
- "match": "company",
+ "restrict": 0,
"role": "HR User",
"write": 1
},
@@ -765,6 +768,7 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "restrict": 1,
"role": "HR Manager",
"write": 1
}
diff --git a/erpnext/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.txt
index 69bbbde..9204c63 100644
--- a/erpnext/hr/doctype/employee_education/employee_education.txt
+++ b/erpnext/hr/doctype/employee_education/employee_education.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:45",
"docstatus": 0,
- "modified": "2013-07-10 14:54:08",
+ "modified": "2013-12-20 19:23:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
index 2d54729..962c981 100644
--- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
+++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:45",
"docstatus": 0,
- "modified": "2013-07-10 14:54:08",
+ "modified": "2013-12-20 19:23:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
index 9cd03ce..2c964fa 100644
--- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
+++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:45",
"docstatus": 0,
- "modified": "2013-07-10 14:54:08",
+ "modified": "2013-12-20 19:23:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
index d51d6a1..4b176d1 100644
--- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
+++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-12 06:56:15",
"docstatus": 0,
- "modified": "2013-08-05 14:15:44",
+ "modified": "2013-12-20 19:23:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.txt
index cabfbd7..a13fd87 100644
--- a/erpnext/hr/doctype/employment_type/employment_type.txt
+++ b/erpnext/hr/doctype/employment_type/employment_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:14",
"docstatus": 0,
- "modified": "2013-07-22 15:31:58",
+ "modified": "2013-12-20 19:24:07",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:employee_type_name",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Employment Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.txt
index 45ff19b..5e65aa8 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.txt
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:14",
"docstatus": 0,
- "modified": "2013-09-25 11:36:11",
+ "modified": "2013-12-20 19:24:07",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Expense Claim",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"write": 1
@@ -208,6 +210,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -226,7 +229,6 @@
"amend": 1,
"cancel": 1,
"doctype": "DocPerm",
- "match": "exp_approver:user",
"role": "Expense Approver",
"submit": 1
},
diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
index e9c5a99..18b8036 100644
--- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
+++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:46",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:13",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
index 4d70350..689da6e 100644
--- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
+++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2012-03-27 14:35:55",
"docstatus": 0,
- "modified": "2013-07-05 14:37:47",
+ "modified": "2013-12-20 19:24:07",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
+ "allow_import": 1,
"autoname": "field:expense_type",
"doctype": "DocType",
"document_type": "Master",
@@ -25,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Expense Claim Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR Manager",
diff --git a/erpnext/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.txt
index fdfa5c7..4743bf1 100644
--- a/erpnext/hr/doctype/grade/grade.txt
+++ b/erpnext/hr/doctype/grade/grade.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:14",
"docstatus": 0,
- "modified": "2013-07-26 15:24:31",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:grade_name",
"doctype": "DocType",
"document_type": "Master",
@@ -32,11 +33,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Grade",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.txt
index 3b87bb0..ad8ddb0 100644
--- a/erpnext/hr/doctype/holiday/holiday.txt
+++ b/erpnext/hr/doctype/holiday/holiday.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:46",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.txt
index 5978f14..8f0832b 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list.txt
+++ b/erpnext/hr/doctype/holiday_list/holiday_list.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:14",
"docstatus": 0,
- "modified": "2013-07-05 14:40:02",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"doctype": "DocType",
"document_type": "Master",
"icon": "icon-calendar",
@@ -25,11 +26,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Holiday List",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR Manager",
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.txt
index bf4b011..cd1cf05 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.txt
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-08-02 13:45:23",
"docstatus": 0,
- "modified": "2013-10-02 15:44:38",
+ "modified": "2013-12-20 19:23:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "HR Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.txt
index d795fa8..8f0d41a 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.txt
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-29 19:25:37",
"docstatus": 0,
- "modified": "2013-09-10 10:51:51",
+ "modified": "2013-12-20 19:24:10",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Job Applicant",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.txt
index a507547..dcf76dd 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.txt
+++ b/erpnext/hr/doctype/job_opening/job_opening.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-15 16:13:36",
"docstatus": 0,
- "modified": "2013-07-05 14:43:35",
+ "modified": "2013-12-20 19:24:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Job Opening",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "HR User",
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
index 38e3eb5..6e5fe64 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-20 19:10:38",
"docstatus": 0,
- "modified": "2013-12-12 17:41:52",
+ "modified": "2013-12-20 19:24:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Leave Allocation",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -158,6 +160,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 0,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index c87c36a..04b03a7 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -12,6 +12,7 @@
class LeaveDayBlockedError(webnotes.ValidationError): pass
class OverlapError(webnotes.ValidationError): pass
class InvalidLeaveApproverError(webnotes.ValidationError): pass
+class LeaveApproverIdentityError(webnotes.ValidationError): pass
from webnotes.model.controller import DocListController
class DocType(DocListController):
@@ -150,7 +151,7 @@
employee = webnotes.bean("Employee", self.doc.employee)
leave_approvers = [l.leave_approver for l in
employee.doclist.get({"parentfield": "employee_leave_approvers"})]
-
+
if len(leave_approvers) and self.doc.leave_approver not in leave_approvers:
msgprint(("[" + _("For Employee") + ' "' + self.doc.employee + '"] '
+ _("Leave Approver can be one of") + ": "
@@ -160,6 +161,10 @@
where parent=%s and role='Leave Approver'""", self.doc.leave_approver):
msgprint(get_fullname(self.doc.leave_approver) + ": " \
+ _("does not have role 'Leave Approver'"), raise_exception=InvalidLeaveApproverError)
+
+ elif self.doc.docstatus==1 and len(leave_approvers) and self.doc.leave_approver != webnotes.session.user:
+ msgprint(_("Only the selected Leave Approver can submit this Leave Application"),
+ raise_exception=LeaveApproverIdentityError)
def notify_employee(self, status):
employee = webnotes.doc("Employee", self.doc.employee)
diff --git a/erpnext/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.txt
index d5feb57..24de6a8 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.txt
+++ b/erpnext/hr/doctype/leave_application/leave_application.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-20 11:18:11",
"docstatus": 0,
- "modified": "2013-07-05 14:44:37",
+ "modified": "2013-12-23 19:53:41",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -220,6 +220,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Leave Application",
@@ -230,8 +231,9 @@
{
"create": 1,
"doctype": "DocPerm",
- "match": "employee",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
"role": "Employee",
"write": 1
@@ -250,8 +252,11 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
+ "restrict": 1,
"role": "HR User",
"submit": 1,
"write": 1
@@ -261,8 +266,9 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "match": "leave_approver:user",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
"role": "Leave Approver",
"submit": 1,
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 44e818d..9bb0134 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -10,6 +10,9 @@
def tearDown(self):
webnotes.set_user("Administrator")
+ # so that this test doesn't affect other tests
+ webnotes.conn.sql("""delete from `tabEmployee Leave Approver`""")
+
def _clear_roles(self):
webnotes.conn.sql("""delete from `tabUserRole` where parent in
("test@example.com", "test1@example.com", "test2@example.com")""")
@@ -160,12 +163,12 @@
webnotes.set_user("test1@example.com")
application.doc.status = "Approved"
- from webnotes.model.bean import BeanPermissionError
- self.assertRaises(BeanPermissionError, application.submit)
-
+ from erpnext.hr.doctype.leave_application.leave_application import LeaveApproverIdentityError
+ self.assertRaises(LeaveApproverIdentityError, application.submit)
+
webnotes.conn.sql("""delete from `tabEmployee Leave Approver` where parent=%s""",
"_T-Employee-0001")
-
+
def _test_leave_approval_valid_leave_approver_insert(self):
self._clear_applications()
self._add_employee_leave_approver("_T-Employee-0001", "test2@example.com")
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
index 770bfee..6f331b0 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-02-18 17:43:12",
"docstatus": 0,
- "modified": "2013-07-05 14:44:45",
+ "modified": "2013-12-20 19:24:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:leave_block_list_name",
"description": "Block Holidays on important days.",
"doctype": "DocType",
@@ -26,11 +27,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Leave Block List",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "HR User",
"write": 1
diff --git a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
index 13fa42c..d386704 100644
--- a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
+++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
@@ -8,23 +8,23 @@
class TestLeaveBlockList(unittest.TestCase):
def tearDown(self):
- webnotes.session.user = "Administrator"
+ webnotes.set_user("Administrator")
def test_get_applicable_block_dates(self):
- webnotes.session.user = "test@example.com"
+ webnotes.set_user("test@example.com")
webnotes.conn.set_value("Department", "_Test Department", "leave_block_list",
"_Test Leave Block List")
self.assertTrue("2013-01-02" in
[d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
def test_get_applicable_block_dates_for_allowed_user(self):
- webnotes.session.user = "test1@example.com"
+ webnotes.set_user("test1@example.com")
webnotes.conn.set_value("Department", "_Test Department 1", "leave_block_list",
"_Test Leave Block List")
self.assertEquals([], [d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
def test_get_applicable_block_dates_all_lists(self):
- webnotes.session.user = "test1@example.com"
+ webnotes.set_user("test1@example.com")
webnotes.conn.set_value("Department", "_Test Department 1", "leave_block_list",
"_Test Leave Block List")
self.assertTrue("2013-01-02" in
diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
index 1e8c86b..94fd3de 100644
--- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
+++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:47",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
index c13e2d5..138c9e4 100644
--- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
+++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:47",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.txt
index dd339dc..adae0d9 100644
--- a/erpnext/hr/doctype/leave_type/leave_type.txt
+++ b/erpnext/hr/doctype/leave_type/leave_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-02-21 09:55:58",
"docstatus": 0,
- "modified": "2013-07-22 15:32:07",
+ "modified": "2013-12-20 19:24:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:leave_type_name",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Leave Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.txt
index 641adae..1f94aa8 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.txt
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:15",
"docstatus": 0,
- "modified": "2013-08-02 19:23:13",
+ "modified": "2013-12-20 19:24:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,11 +24,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Salary Slip",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -248,6 +250,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 0,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
index d0a4f47..2b29090 100644
--- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
+++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:48",
"docstatus": 0,
- "modified": "2013-07-22 15:27:44",
+ "modified": "2013-12-20 19:23:42",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
index 3fc25fa..3375ab5 100644
--- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
+++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:48",
"docstatus": 0,
- "modified": "2013-07-22 15:27:56",
+ "modified": "2013-12-20 19:23:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.txt
index 1c6a86b..e54ebd7 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.txt
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 18:50:29",
"docstatus": 0,
- "modified": "2013-08-06 17:15:53",
+ "modified": "2013-12-20 19:24:28",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
"amend": 0,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Salary Structure",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
index 0af2632..845a70f 100644
--- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
+++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:48",
"docstatus": 0,
- "modified": "2013-08-06 17:11:40",
+ "modified": "2013-12-20 19:23:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
index 609fd6c..d90c3cd 100644
--- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
+++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:48",
"docstatus": 0,
- "modified": "2013-08-06 17:11:31",
+ "modified": "2013-12-20 19:23:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
index ea861be..5c72761 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-25 11:34:53",
"docstatus": 0,
- "modified": "2013-07-05 15:02:09",
+ "modified": "2013-12-20 19:21:54",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Upload Attendance",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"submit": 0,
diff --git a/erpnext/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.txt
index a5ff125..505d8d7 100644
--- a/erpnext/manufacturing/doctype/bom/bom.txt
+++ b/erpnext/manufacturing/doctype/bom/bom.txt
@@ -2,15 +2,14 @@
{
"creation": "2013-01-22 15:11:38",
"docstatus": 0,
- "modified": "2013-12-09 16:25:50",
+ "modified": "2013-12-20 19:23:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 0,
- "allow_email": 0,
- "allow_print": 0,
+ "allow_import": 1,
"allow_rename": 0,
"doctype": "DocType",
"document_type": "Master",
@@ -38,11 +37,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "BOM",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -239,6 +240,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "BOM",
diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
index abc74cd..55342aa 100644
--- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
+++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:57",
"docstatus": 0,
- "modified": "2013-07-10 14:54:04",
+ "modified": "2013-12-20 19:22:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
index e498c71..b7017f4 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.txt
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-07-25 16:34:42",
+ "modified": "2013-12-20 19:22:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
index cffdf4c..6ace745 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-12-04 11:18:59",
+ "modified": "2013-12-20 19:22:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 8d0223e..8a47a8e 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -54,10 +54,9 @@
self.validate_production_order_against_so()
def validate_warehouse(self):
- from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
+ from erpnext.stock.utils import validate_warehouse_company
for w in [self.doc.fg_warehouse, self.doc.wip_warehouse]:
- validate_warehouse_user(w)
validate_warehouse_company(w, self.doc.company)
def validate_production_order_against_so(self):
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.txt
index 5e76c0e..ed1c668 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.txt
+++ b/erpnext/manufacturing/doctype/production_order/production_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:16",
"docstatus": 0,
- "modified": "2013-12-18 13:22:14",
+ "modified": "2013-12-20 19:24:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Production Order",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Manufacturing User",
@@ -251,6 +253,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py
index 62bb26e..9b1300f 100644
--- a/erpnext/manufacturing/doctype/production_order/test_production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py
@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import unittest
import webnotes
+from webnotes.utils import cstr, getdate
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.manufacturing.doctype.production_order.production_order import make_stock_entry
@@ -32,7 +33,7 @@
stock_entry = make_stock_entry(pro_bean.doc.name, "Manufacture/Repack")
stock_entry = webnotes.bean(stock_entry)
-
+ stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013"
stock_entry.doc.fg_completed_qty = 4
stock_entry.run_method("get_items")
stock_entry.submit()
@@ -50,7 +51,7 @@
stock_entry = make_stock_entry(pro_order, "Manufacture/Repack")
stock_entry = webnotes.bean(stock_entry)
-
+ stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013"
stock_entry.doc.fg_completed_qty = 15
stock_entry.run_method("get_items")
stock_entry.insert()
diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
index 7bcaaca..2068188 100644
--- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
+++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-08-08 12:12:27",
+ "modified": "2013-12-20 19:23:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
index fab7dd0..11a02a5 100644
--- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
+++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
- "modified": "2013-07-22 15:26:23",
+ "modified": "2013-12-20 19:23:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
index c3a1d8f..4c3b065 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-21 12:03:47",
"docstatus": 0,
- "modified": "2013-08-08 12:01:02",
+ "modified": "2013-12-20 19:23:25",
"modified_by": "Administrator",
"owner": "jai@webnotestech.com"
},
@@ -27,11 +27,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Production Planning Tool",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"role": "Manufacturing User",
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.txt
index c9114ff..306ca4e 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.txt
+++ b/erpnext/manufacturing/doctype/workstation/workstation.txt
@@ -2,12 +2,12 @@
{
"creation": "2013-01-10 16:34:17",
"docstatus": 0,
- "modified": "2013-10-28 15:42:38",
+ "modified": "2013-12-20 19:24:41",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
- "allow_email": 0,
+ "allow_import": 1,
"autoname": "field:workstation_name",
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +27,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Workstation",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Manufacturing User",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e69de29..ce41342 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -0,0 +1,4 @@
+# patches after permission rewrite
+patches.1312.p02_update_user_properties
+patches.1312.p03_move_warehouse_user_to_restrictions
+patches.1312.p04_new_permissions
\ No newline at end of file
diff --git a/erpnext/patches/december_2012/deprecate_tds.py b/erpnext/patches/december_2012/deprecate_tds.py
index e43fbfc..a5db729 100644
--- a/erpnext/patches/december_2012/deprecate_tds.py
+++ b/erpnext/patches/december_2012/deprecate_tds.py
@@ -3,7 +3,6 @@
def execute():
import webnotes
- from webnotes.model import delete_doc
from webnotes.model.code import get_obj
from webnotes.model.doc import addchild
@@ -12,7 +11,7 @@
"TDS Rate Chart", "TDS Category", "TDS Control", "TDS Detail",
"TDS Payment Detail", "TDS Rate Detail", "TDS Category Account",
"Form 16A Ack Detail", "Form 16A Tax Detail"]:
- delete_doc("DocType", dt)
+ webnotes.delete_doc("DocType", dt)
webnotes.conn.commit()
webnotes.conn.sql("drop table if exists `tab%s`" % dt)
diff --git a/erpnext/patches/december_2012/production_cleanup.py b/erpnext/patches/december_2012/production_cleanup.py
index 9065666..b8133a9 100644
--- a/erpnext/patches/december_2012/production_cleanup.py
+++ b/erpnext/patches/december_2012/production_cleanup.py
@@ -10,9 +10,8 @@
rebuild_exploded_bom()
def delete_doctypes():
- from webnotes.model import delete_doc
- delete_doc("DocType", "Production Control")
- delete_doc("DocType", "BOM Control")
+ webnotes.delete_doc("DocType", "Production Control")
+ webnotes.delete_doc("DocType", "BOM Control")
def rename_module():
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 608ba77..350ca37 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -256,11 +256,11 @@
"patches.1311.p06_fix_report_columns",
"execute:webnotes.delete_doc('DocType', 'Documentation Tool')",
"execute:webnotes.delete_doc('Report', 'Stock Ledger') #2013-11-29",
- "patches.1312.p01_delete_old_stock_reports",
"execute:webnotes.delete_doc('Report', 'Payment Collection With Ageing')",
"execute:webnotes.delete_doc('Report', 'Payment Made With Ageing')",
"patches.1311.p07_scheduler_errors_digest",
"patches.1311.p08_email_digest_recipients",
"execute:webnotes.delete_doc('DocType', 'Warehouse Type')",
+ "patches.1312.p01_delete_old_stock_reports",
"patches.1312.p02_update_item_details_in_item_price",
]
\ No newline at end of file
diff --git a/erpnext/patches/september_2012/deprecate_account_balance.py b/erpnext/patches/september_2012/deprecate_account_balance.py
index 1f5ce72..d39f82c 100644
--- a/erpnext/patches/september_2012/deprecate_account_balance.py
+++ b/erpnext/patches/september_2012/deprecate_account_balance.py
@@ -3,11 +3,10 @@
from __future__ import unicode_literals
import webnotes
-from webnotes.model import delete_doc
def execute():
# remove doctypes
for dt in ["Period", "Account Balance", "Multi Ledger Report",
"Multi Ledger Report Detail", "Period Control", "Reposting Tool",
"Lease Agreement", "Lease Installment"]:
- delete_doc("DocType", dt)
\ No newline at end of file
+ webnotes.delete_doc("DocType", dt)
\ No newline at end of file
diff --git a/erpnext/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.txt
index 94fffe7..d8a50c5 100644
--- a/erpnext/projects/doctype/activity_type/activity_type.txt
+++ b/erpnext/projects/doctype/activity_type/activity_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-03-05 10:14:59",
"docstatus": 0,
- "modified": "2013-07-05 14:23:55",
+ "modified": "2013-12-20 19:23:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:activity_type",
"doctype": "DocType",
"document_type": "Master",
@@ -30,11 +31,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Activity Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"write": 1
diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt
index 9f21dce..a1967bb 100644
--- a/erpnext/projects/doctype/project/project.txt
+++ b/erpnext/projects/doctype/project/project.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:07",
"docstatus": 0,
- "modified": "2013-11-06 15:13:55",
+ "modified": "2013-12-20 19:24:17",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -292,7 +292,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"role": "Projects User",
"write": 1
},
diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.txt
index 31722d6..d5be81e 100644
--- a/erpnext/projects/doctype/project_milestone/project_milestone.txt
+++ b/erpnext/projects/doctype/project_milestone/project_milestone.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:50",
"docstatus": 0,
- "modified": "2013-07-10 14:54:12",
+ "modified": "2013-12-20 19:23:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt
index 1c12c8a..7ddd51a 100644
--- a/erpnext/projects/doctype/task/task.txt
+++ b/erpnext/projects/doctype/task/task.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-29 19:25:50",
"docstatus": 0,
- "modified": "2013-10-02 14:25:00",
+ "modified": "2013-12-20 19:24:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Task",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Projects User",
diff --git a/erpnext/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.txt
index 1c8e00f..2ad9d64 100644
--- a/erpnext/projects/doctype/time_log/time_log.txt
+++ b/erpnext/projects/doctype/time_log/time_log.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-04-03 16:38:41",
"docstatus": 0,
- "modified": "2013-11-02 14:05:45",
+ "modified": "2013-12-20 19:24:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"autoname": "naming_series:",
"description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.",
"doctype": "DocType",
@@ -28,11 +29,13 @@
"amend": 1,
"cancel": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Time Log",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -190,6 +193,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Time Log",
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
index 74bcc4d..458f0ed 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-28 17:57:33",
"docstatus": 0,
- "modified": "2013-11-02 14:05:45",
+ "modified": "2013-12-20 19:24:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -29,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Time Log Batch",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Projects User",
@@ -110,6 +112,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Time Log Batch",
diff --git a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
index 98eca10..973fc57 100644
--- a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
+++ b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-05 09:11:06",
"docstatus": 0,
- "modified": "2013-07-10 14:54:25",
+ "modified": "2013-12-20 19:21:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.txt
index 7025bf5..07cddd4 100644
--- a/erpnext/selling/doctype/campaign/campaign.txt
+++ b/erpnext/selling/doctype/campaign/campaign.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:18",
"docstatus": 0,
- "modified": "2013-07-05 14:29:57",
+ "modified": "2013-12-20 19:23:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:campaign_name",
"description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
"doctype": "DocType",
@@ -26,13 +27,14 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Campaign",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
- "report": 1,
"submit": 0
},
{
@@ -77,6 +79,8 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
+ "import": 0,
+ "report": 0,
"role": "Sales Manager",
"write": 0
},
@@ -84,6 +88,7 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
+ "report": 1,
"role": "Sales User",
"write": 0
},
@@ -91,6 +96,7 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "report": 1,
"role": "Sales Master Manager",
"write": 1
}
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index a54f23d..ee54f93 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -144,8 +144,7 @@
acc = webnotes.conn.sql("select name from `tabAccount` where master_type = 'Customer' \
and master_name = %s and docstatus < 2", self.doc.name)
if acc:
- from webnotes.model import delete_doc
- delete_doc('Account', acc[0][0])
+ webnotes.delete_doc('Account', acc[0][0])
def on_trash(self):
self.delete_customer_address()
diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt
index 43a3977..aaf4b9d 100644
--- a/erpnext/selling/doctype/customer/customer.txt
+++ b/erpnext/selling/doctype/customer/customer.txt
@@ -7,7 +7,7 @@
"owner": "Administrator"
},
{
- "allow_print": 0,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "naming_series:",
"description": "Buyer of Goods and Services.",
@@ -346,7 +346,9 @@
"cancel": 0,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
"role": "Sales User",
"submit": 0,
@@ -362,7 +364,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
"role": "Sales Master Manager",
"submit": 0,
diff --git a/erpnext/selling/doctype/customer_discount/customer_discount.txt b/erpnext/selling/doctype/customer_discount/customer_discount.txt
index 135871d..5abe3b6 100644
--- a/erpnext/selling/doctype/customer_discount/customer_discount.txt
+++ b/erpnext/selling/doctype/customer_discount/customer_discount.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-07-22 12:43:40",
"docstatus": 0,
- "modified": "2013-11-02 19:41:31",
+ "modified": "2013-12-20 19:23:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.txt
index 3c97b3e..e65fc38 100644
--- a/erpnext/selling/doctype/industry_type/industry_type.txt
+++ b/erpnext/selling/doctype/industry_type/industry_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2012-03-27 14:36:09",
"docstatus": 0,
- "modified": "2013-07-05 14:40:42",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
+ "allow_import": 1,
"autoname": "field:industry",
"doctype": "DocType",
"document_type": "Master",
@@ -30,11 +31,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Industry Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.txt
index af81d7f..d23a68a 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.txt
+++ b/erpnext/selling/doctype/installation_note/installation_note.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-30 13:13:06",
"docstatus": 0,
- "modified": "2013-11-02 16:58:44",
+ "modified": "2013-12-20 19:24:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -219,6 +219,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -257,7 +258,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"submit": 1,
"write": 1
},
diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
index 7435d46..94f648e 100644
--- a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
+++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:51",
"docstatus": 0,
- "modified": "2013-10-10 17:02:31",
+ "modified": "2013-12-20 19:23:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt
index 6e6b61a..dc8bcdb 100644
--- a/erpnext/selling/doctype/lead/lead.txt
+++ b/erpnext/selling/doctype/lead/lead.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-10 11:45:37",
"docstatus": 0,
- "modified": "2013-11-25 11:38:00",
+ "modified": "2013-12-20 19:24:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
"amend": 0,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Lead",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt
index fec94c8..d0dc0f5 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.txt
+++ b/erpnext/selling/doctype/opportunity/opportunity.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 18:50:30",
"docstatus": 0,
- "modified": "2013-11-25 11:36:40",
+ "modified": "2013-12-20 19:24:15",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -31,11 +31,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Opportunity",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -415,6 +417,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
index efa1ee9..94c6dd2 100644
--- a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
+++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:51",
"docstatus": 0,
- "modified": "2013-11-02 19:41:31",
+ "modified": "2013-12-20 19:23:22",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt
index 93346d3..3657e4a 100644
--- a/erpnext/selling/doctype/quotation/quotation.txt
+++ b/erpnext/selling/doctype/quotation/quotation.txt
@@ -2,13 +2,12 @@
{
"creation": "2013-05-24 19:29:08",
"docstatus": 0,
- "modified": "2013-12-14 17:25:46",
+ "modified": "2013-12-20 19:24:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
- "allow_email": 0,
"allow_import": 1,
"autoname": "naming_series:",
"doctype": "DocType",
@@ -32,11 +31,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Quotation",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -178,6 +179,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -863,7 +865,6 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "match": "customer",
"role": "Customer",
"submit": 0,
"write": 0
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt
index 3764208..e669937 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.txt
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:57",
"docstatus": 0,
- "modified": "2013-11-02 19:41:32",
+ "modified": "2013-12-20 19:23:41",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.txt
index 9a9b6e6..cd1ea28 100644
--- a/erpnext/selling/doctype/sales_bom/sales_bom.txt
+++ b/erpnext/selling/doctype/sales_bom/sales_bom.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-06-20 11:53:21",
"docstatus": 0,
- "modified": "2013-07-05 14:54:08",
+ "modified": "2013-12-20 19:24:28",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales BOM",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
index 9e880bc..e06d8f8 100644
--- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
+++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-23 16:55:51",
"docstatus": 0,
- "modified": "2013-09-09 15:47:56",
+ "modified": "2013-12-20 19:21:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 4527574..8e7a89d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -128,13 +128,12 @@
if not self.doc.delivery_status: self.doc.delivery_status = 'Not Delivered'
def validate_warehouse(self):
- from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
+ from erpnext.stock.utils import validate_warehouse_company
warehouses = list(set([d.reserved_warehouse for d in
self.doclist.get({"doctype": self.tname}) if d.reserved_warehouse]))
for w in warehouses:
- validate_warehouse_user(w)
validate_warehouse_company(w, self.doc.company)
def validate_with_previous_doc(self):
diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt
index 7a1af77..f9582fb 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.txt
+++ b/erpnext/selling/doctype/sales_order/sales_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-18 12:39:59",
"docstatus": 0,
- "modified": "2013-11-03 14:20:16",
+ "modified": "2013-12-20 19:24:32",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -30,11 +30,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Order",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1
},
{
@@ -149,6 +151,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -921,7 +924,6 @@
},
{
"doctype": "DocPerm",
- "match": "customer",
"role": "Customer"
}
]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index 31c7cbc..68e6775 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -6,6 +6,9 @@
import unittest
class TestSalesOrder(unittest.TestCase):
+ def tearDown(self):
+ webnotes.set_user("Administrator")
+
def test_make_material_request(self):
from erpnext.selling.doctype.sales_order.sales_order import make_material_request
@@ -276,28 +279,29 @@
so.doclist[1].reserved_warehouse, 20.0)
def test_warehouse_user(self):
+ webnotes.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction")
webnotes.bean("Profile", "test@example.com").get_controller()\
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
webnotes.bean("Profile", "test2@example.com").get_controller()\
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
- webnotes.session.user = "test@example.com"
+ webnotes.set_user("test@example.com")
- from erpnext.stock.utils import UserNotAllowedForWarehouse
+ from webnotes.model.bean import BeanPermissionError
so = webnotes.bean(copy = test_records[0])
so.doc.company = "_Test Company 1"
so.doc.conversion_rate = 0.02
so.doc.plc_conversion_rate = 0.02
so.doclist[1].reserved_warehouse = "_Test Warehouse 2 - _TC1"
- self.assertRaises(UserNotAllowedForWarehouse, so.insert)
+ self.assertRaises(BeanPermissionError, so.insert)
- webnotes.session.user = "test2@example.com"
+ webnotes.set_user("test2@example.com")
so.insert()
+
+ webnotes.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", parenttype="Restriction")
- webnotes.session.user = "Administrator"
-
-test_dependencies = ["Sales BOM"]
+test_dependencies = ["Sales BOM", "Currency Exchange"]
test_records = [
[
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
index 4754aa1..eb656a6 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:58",
"docstatus": 0,
- "modified": "2013-11-03 14:14:17",
+ "modified": "2013-12-20 19:21:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt
index ae50814b..9b58429 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.txt
+++ b/erpnext/selling/doctype/sales_team/sales_team.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-19 13:30:51",
"docstatus": 0,
- "modified": "2013-07-10 14:54:22",
+ "modified": "2013-12-20 19:21:46",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.txt
index a112a7c..2a93263 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.txt
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-25 10:25:16",
"docstatus": 0,
- "modified": "2013-11-02 16:58:56",
+ "modified": "2013-12-20 19:21:46",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Selling Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
index 1737c65..7cd61f7 100644
--- a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
+++ b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-20 16:00:18",
"docstatus": 0,
- "modified": "2013-08-09 14:47:15",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
index ffc3635..f52cc60 100644
--- a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
+++ b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-19 15:57:32",
"docstatus": 0,
- "modified": "2013-11-02 16:58:56",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Shopping Cart Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "Website Manager",
"write": 1
diff --git a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
index 8c9c34a..91b41c2 100644
--- a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
+++ b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-07-03 13:15:34",
"docstatus": 0,
- "modified": "2013-07-10 14:54:25",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
index a61f8db..ba44199 100644
--- a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
+++ b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-20 16:57:03",
"docstatus": 0,
- "modified": "2013-07-10 14:54:25",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
index 10d84d1..3a5b0f3 100644
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
+++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-20 12:48:38",
"docstatus": 0,
- "modified": "2013-11-02 16:58:57",
+ "modified": "2013-12-20 19:22:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.txt
index 897994b..c5628d2 100644
--- a/erpnext/setup/doctype/authorization_control/authorization_control.txt
+++ b/erpnext/setup/doctype/authorization_control/authorization_control.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-03-27 14:36:18",
"docstatus": 0,
- "modified": "2013-07-10 14:54:03",
+ "modified": "2013-12-20 19:22:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
index 4af3eaa..36467f2 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:22",
"docstatus": 0,
- "modified": "2013-08-07 14:44:52",
+ "modified": "2013-12-20 19:23:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "AR.####",
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Authorization Rule",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.txt
index cf4dbcc..259bf37 100644
--- a/erpnext/setup/doctype/backup_manager/backup_manager.txt
+++ b/erpnext/setup/doctype/backup_manager/backup_manager.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-30 12:58:38",
"docstatus": 0,
- "modified": "2013-07-05 14:26:02",
+ "modified": "2013-12-20 19:22:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Backup Manager",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.txt
index 1fd9cec..3dcb016 100644
--- a/erpnext/setup/doctype/brand/brand.txt
+++ b/erpnext/setup/doctype/brand/brand.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-02-22 01:27:54",
"docstatus": 0,
- "modified": "2013-07-23 12:06:41",
+ "modified": "2013-12-20 19:23:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:brand",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Brand",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.txt
index 8c3860a..1e763ea 100644
--- a/erpnext/setup/doctype/company/company.txt
+++ b/erpnext/setup/doctype/company/company.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-04-10 08:35:39",
"docstatus": 0,
- "modified": "2013-11-02 14:24:11",
+ "modified": "2013-12-20 19:23:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:company_name",
"description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
@@ -26,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Company",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1
},
{
diff --git a/erpnext/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.txt
index 80caeae..a5a0d01 100644
--- a/erpnext/setup/doctype/contact_control/contact_control.txt
+++ b/erpnext/setup/doctype/contact_control/contact_control.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-03-27 14:36:19",
"docstatus": 0,
- "modified": "2013-07-10 14:54:06",
+ "modified": "2013-12-20 19:23:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
{
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Contact Control",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.txt
index 8b811a3..991c8a9 100644
--- a/erpnext/setup/doctype/country/country.txt
+++ b/erpnext/setup/doctype/country/country.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-19 10:23:30",
"docstatus": 0,
- "modified": "2013-07-23 12:05:08",
+ "modified": "2013-12-20 19:24:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:country_name",
"doctype": "DocType",
"document_type": "Master",
@@ -26,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Country",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.txt
index 7476ccf..709e360 100644
--- a/erpnext/setup/doctype/currency/currency.txt
+++ b/erpnext/setup/doctype/currency/currency.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-28 10:06:02",
"docstatus": 0,
- "modified": "2013-07-23 12:05:26",
+ "modified": "2013-12-20 19:24:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Currency",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
index db20839..f0f5c39 100644
--- a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
+++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-20 15:40:29",
"docstatus": 0,
- "modified": "2013-07-05 16:26:11",
+ "modified": "2013-12-20 19:24:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Currency Exchange",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
diff --git a/erpnext/setup/doctype/customer_group/customer_group.js b/erpnext/setup/doctype/customer_group/customer_group.js
index 3e76986..17a08c6 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.js
+++ b/erpnext/setup/doctype/customer_group/customer_group.js
@@ -8,7 +8,7 @@
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root customer group
if(!doc.parent_customer_group) {
- cur_frm.perm = [[1,0,0], [1,0,0]];
+ cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root customer group and cannot be edited."));
} else {
cur_frm.set_intro(null);
diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt
index f76a2e1..5b7158f 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.txt
+++ b/erpnext/setup/doctype/customer_group/customer_group.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:23",
"docstatus": 0,
- "modified": "2013-11-02 16:52:51",
+ "modified": "2013-12-20 19:24:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:customer_group_name",
"doctype": "DocType",
@@ -29,11 +30,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Customer Group",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -66,6 +69,7 @@
"doctype": "DocField",
"fieldname": "parent_customer_group",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Customer Group",
"oldfieldname": "parent_customer_group",
"oldfieldtype": "Link",
@@ -127,6 +131,7 @@
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "old_parent",
"no_copy": 1,
"oldfieldname": "old_parent",
diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt
index b04885a..ca35916 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.txt
+++ b/erpnext/setup/doctype/email_digest/email_digest.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-21 14:15:31",
"docstatus": 0,
- "modified": "2013-12-16 12:37:43",
+ "modified": "2013-12-20 19:24:05",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -351,7 +351,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"permlevel": 0,
+ "print": 1,
"report": 1,
"write": 1
},
diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt
index d68f489..dd2df02 100644
--- a/erpnext/setup/doctype/features_setup/features_setup.txt
+++ b/erpnext/setup/doctype/features_setup/features_setup.txt
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Features Setup",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"submit": 0,
diff --git a/erpnext/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js
index 78df609..65e0588 100644
--- a/erpnext/setup/doctype/item_group/item_group.js
+++ b/erpnext/setup/doctype/item_group/item_group.js
@@ -18,7 +18,7 @@
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root item group
if(!doc.parent_item_group) {
- cur_frm.perm = [[1,0,0], [1,0,0]];
+ cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root item group and cannot be edited."));
} else {
cur_frm.set_intro(null);
diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt
index b365893..83e32b2 100644
--- a/erpnext/setup/doctype/item_group/item_group.txt
+++ b/erpnext/setup/doctype/item_group/item_group.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-03-28 10:35:29",
"docstatus": 0,
- "modified": "2013-11-02 19:41:37",
+ "modified": "2013-12-20 19:24:10",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:item_group_name",
"description": "Item Classification",
@@ -31,11 +32,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Item Group",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -71,6 +74,7 @@
"doctype": "DocField",
"fieldname": "parent_item_group",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Item Group",
"no_copy": 0,
"oldfieldname": "parent_item_group",
@@ -166,6 +170,7 @@
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "old_parent",
"no_copy": 1,
"oldfieldname": "old_parent",
diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
index 769fc27..24a4240 100644
--- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
+++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-15 16:50:01",
"docstatus": 0,
- "modified": "2013-07-05 14:43:39",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Jobs Email Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.txt
index 28d4765..dd28eac 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.txt
+++ b/erpnext/setup/doctype/naming_series/naming_series.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-25 11:35:08",
"docstatus": 0,
- "modified": "2013-07-05 14:46:46",
+ "modified": "2013-12-20 19:23:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Naming Series",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"role": "System Manager",
diff --git a/erpnext/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.txt
index d6cbe95..861e547 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.txt
+++ b/erpnext/setup/doctype/print_heading/print_heading.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-07-05 14:50:55",
+ "modified": "2013-12-20 19:24:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:print_heading",
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Print Heading",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "All",
diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
index d9174e3..6fccf61 100644
--- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
+++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-07-22 15:29:22",
+ "modified": "2013-12-20 19:24:26",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:order_lost_reason",
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Quotation Lost Reason",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Sales Master Manager",
diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
index 1757812..f5f8a97 100644
--- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
+++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-16 10:25:26",
"docstatus": 0,
- "modified": "2013-07-05 14:54:14",
+ "modified": "2013-12-20 19:21:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Email Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "System Manager",
"write": 1
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.txt
index 7d0750f..6ab274c 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.txt
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-04-12 15:34:06",
"docstatus": 0,
- "modified": "2013-11-02 16:59:04",
+ "modified": "2013-12-20 19:24:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:partner_name",
"description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.",
"doctype": "DocType",
@@ -28,11 +29,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Partner",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js
index a25a3d1..19c13b1 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.js
+++ b/erpnext/setup/doctype/sales_person/sales_person.js
@@ -8,7 +8,7 @@
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root
if(!doc.parent_sales_person) {
- cur_frm.perm = [[1,0,0], [1,0,0]];
+ cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root sales person and cannot be edited."));
} else {
cur_frm.set_intro(null);
@@ -37,4 +37,4 @@
}
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
- return{ query: "erpnext.controllers.queries.employee_query" } }
\ No newline at end of file
+ return{ query: "erpnext.controllers.queries.employee_query" } }
diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt
index 037c6de..76d9811 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.txt
+++ b/erpnext/setup/doctype/sales_person/sales_person.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-09-10 10:53:28",
+ "modified": "2013-12-20 19:24:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:sales_person_name",
"description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.",
@@ -29,11 +30,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Sales Person",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -65,6 +68,7 @@
"doctype": "DocField",
"fieldname": "parent_sales_person",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Sales Person",
"oldfieldname": "parent_sales_person",
"oldfieldtype": "Link",
diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
index 38cca31..c4ebb8f 100755
--- a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
+++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:58",
"docstatus": 0,
- "modified": "2013-07-10 14:54:23",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.txt
index 200dc81..c7c2b57 100644
--- a/erpnext/setup/doctype/supplier_type/supplier_type.txt
+++ b/erpnext/setup/doctype/supplier_type/supplier_type.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-07-05 14:57:16",
+ "modified": "2013-12-20 19:24:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:supplier_type",
"doctype": "DocType",
@@ -26,11 +27,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Supplier Type",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.txt
index 71debd3..3ae395f 100644
--- a/erpnext/setup/doctype/target_detail/target_detail.txt
+++ b/erpnext/setup/doctype/target_detail/target_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:58",
"docstatus": 0,
- "modified": "2013-11-02 19:41:37",
+ "modified": "2013-12-20 19:21:51",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
index 0ddc8f5..e3ff486 100644
--- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
+++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-07-05 14:58:02",
+ "modified": "2013-12-20 19:24:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.",
@@ -26,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Terms and Conditions",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/setup/doctype/territory/territory.js b/erpnext/setup/doctype/territory/territory.js
index 18dbbb3..9cb1d70 100644
--- a/erpnext/setup/doctype/territory/territory.js
+++ b/erpnext/setup/doctype/territory/territory.js
@@ -8,7 +8,7 @@
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root territory
if(!doc.parent_territory) {
- cur_frm.perm = [[1,0,0], [1,0,0]];
+ cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root territory and cannot be edited."));
} else {
cur_frm.set_intro(null);
diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt
index 200f24f..00b7aac 100644
--- a/erpnext/setup/doctype/territory/territory.txt
+++ b/erpnext/setup/doctype/territory/territory.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-11-02 16:59:08",
+ "modified": "2013-12-20 19:24:39",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:territory_name",
"description": "Classification of Customers by region",
@@ -31,11 +32,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Territory",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -68,6 +71,7 @@
"doctype": "DocField",
"fieldname": "parent_territory",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Parent Territory",
"oldfieldname": "parent_territory",
"oldfieldtype": "Link",
@@ -136,6 +140,7 @@
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "old_parent",
"no_copy": 1,
"oldfieldname": "old_parent",
diff --git a/erpnext/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.txt
index 51d9806..070c5a4 100644
--- a/erpnext/setup/doctype/uom/uom.txt
+++ b/erpnext/setup/doctype/uom/uom.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-10-10 15:06:53",
+ "modified": "2013-12-20 19:24:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "field:uom_name",
"doctype": "DocType",
"document_type": "Master",
@@ -25,11 +26,13 @@
{
"amend": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "UOM",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt
index 0a8a3aa..a2a6e7e 100644
--- a/erpnext/setup/doctype/website_item_group/website_item_group.txt
+++ b/erpnext/setup/doctype/website_item_group/website_item_group.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:09",
"docstatus": 0,
- "modified": "2013-11-02 19:41:38",
+ "modified": "2013-12-20 19:21:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.txt
index 5b7a840..17145ff 100644
--- a/erpnext/stock/doctype/batch/batch.txt
+++ b/erpnext/stock/doctype/batch/batch.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-03-05 14:50:38",
"docstatus": 0,
- "modified": "2013-07-05 14:26:48",
+ "modified": "2013-12-20 19:23:55",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"autoname": "field:batch_id",
"doctype": "DocType",
"document_type": "Master",
@@ -28,11 +29,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Batch",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Material Master Manager",
diff --git a/erpnext/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.txt
index a66b5e8..2775191 100644
--- a/erpnext/stock/doctype/bin/bin.txt
+++ b/erpnext/stock/doctype/bin/bin.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:25",
"docstatus": 0,
- "modified": "2013-08-07 14:45:48",
+ "modified": "2013-12-20 19:23:56",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Bin",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt
index 480d45d..36615a2 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.txt
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:09",
"docstatus": 0,
- "modified": "2013-12-14 17:26:12",
+ "modified": "2013-12-20 19:24:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -30,11 +30,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Delivery Note",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -167,6 +169,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -1058,7 +1061,6 @@
},
{
"doctype": "DocPerm",
- "match": "customer",
"role": "Customer"
}
]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
index a118715..96c01f6 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-22 13:15:44",
"docstatus": 0,
- "modified": "2013-11-02 19:41:38",
+ "modified": "2013-12-20 19:23:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt
index 22c5dcc..cc12fda 100644
--- a/erpnext/stock/doctype/item/item.txt
+++ b/erpnext/stock/doctype/item/item.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
- "modified": "2013-11-02 19:41:40",
+ "modified": "2013-12-20 19:24:09",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:item_code",
"default_print_format": "Standard",
@@ -30,11 +31,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Item",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
@@ -847,6 +850,7 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "import": 1,
"role": "Material Master Manager",
"write": 1
},
diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
index def1dff..9d9b6ca 100644
--- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
+++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-08 15:37:16",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.txt
index fc411eb..c21f127 100644
--- a/erpnext/stock/doctype/item_price/item_price.txt
+++ b/erpnext/stock/doctype/item_price/item_price.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-05-02 16:29:48",
"docstatus": 0,
- "modified": "2013-10-31 12:59:02",
+ "modified": "2013-12-20 19:24:10",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"autoname": "RFD/.#####",
"description": "Multiple Item prices.",
"doctype": "DocType",
@@ -30,11 +31,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Item Price",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"write": 1
diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
index df8c817..8ec87d7 100644
--- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
+++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:01",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.txt
index ae9de1e..74df09a 100644
--- a/erpnext/stock/doctype/item_reorder/item_reorder.txt
+++ b/erpnext/stock/doctype/item_reorder/item_reorder.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:59",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.txt
index e0e0e6d..02e0bd7 100644
--- a/erpnext/stock/doctype/item_supplier/item_supplier.txt
+++ b/erpnext/stock/doctype/item_supplier/item_supplier.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:01",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.txt
index cbc112e..243ee1f 100644
--- a/erpnext/stock/doctype/item_tax/item_tax.txt
+++ b/erpnext/stock/doctype/item_tax/item_tax.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:01",
"docstatus": 0,
- "modified": "2013-07-10 14:54:09",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
index c3c1d34..164da81 100644
--- a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
+++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:01",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:16",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
index bfd6216..bf8af3a 100644
--- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
+++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:02",
"docstatus": 0,
- "modified": "2013-09-02 17:36:19",
+ "modified": "2013-12-20 19:23:18",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
index 5f0bc90..8d02e3a 100644
--- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
+++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:02",
"docstatus": 0,
- "modified": "2013-09-02 13:44:28",
+ "modified": "2013-12-20 19:23:18",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
index 40f2e23..587d0e3 100644
--- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
+++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-22 16:50:39",
"docstatus": 0,
- "modified": "2013-09-02 19:13:09",
+ "modified": "2013-12-20 19:23:18",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -24,11 +24,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Landed Cost Wizard",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"submit": 0,
diff --git a/erpnext/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.txt
index c71d7d1..8762c03 100644
--- a/erpnext/stock/doctype/material_request/material_request.txt
+++ b/erpnext/stock/doctype/material_request/material_request.txt
@@ -2,14 +2,13 @@
{
"creation": "2013-03-07 14:48:38",
"docstatus": 0,
- "modified": "2013-11-03 15:30:49",
+ "modified": "2013-12-20 19:24:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
"allow_import": 1,
- "allow_print": 0,
"autoname": "naming_series:",
"doctype": "DocType",
"icon": "icon-ticket",
@@ -32,11 +31,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Material Request",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -83,6 +84,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt
index e0b9330..6e8a0d6 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.txt
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:02",
"docstatus": 0,
- "modified": "2013-12-18 14:52:02",
+ "modified": "2013-12-20 19:23:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.txt
index 8320502..45a1d4d 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.txt
+++ b/erpnext/stock/doctype/packed_item/packed_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:00",
"docstatus": 0,
- "modified": "2013-10-16 16:37:31",
+ "modified": "2013-12-20 19:23:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt
index c86e90f..065a056 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.txt
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-11 15:32:24",
"docstatus": 0,
- "modified": "2013-11-02 14:05:59",
+ "modified": "2013-12-20 19:24:15",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -31,11 +31,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Packing Slip",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -205,6 +207,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Packing Slip",
diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
index 41dd044..54e6991 100644
--- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
+++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-08 13:10:16",
"docstatus": 0,
- "modified": "2013-07-25 16:37:30",
+ "modified": "2013-12-20 19:23:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.txt
index d43076b..dabc7e0 100644
--- a/erpnext/stock/doctype/price_list/price_list.txt
+++ b/erpnext/stock/doctype/price_list/price_list.txt
@@ -2,15 +2,14 @@
{
"creation": "2013-01-25 11:35:09",
"docstatus": 0,
- "modified": "2013-10-31 19:24:33",
+ "modified": "2013-12-20 18:28:50",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 0,
- "allow_email": 1,
- "allow_print": 1,
+ "allow_import": 1,
"autoname": "field:price_list_name",
"description": "Price List Master",
"doctype": "DocType",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
index 95e254e..fca3e39 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
- "modified": "2013-11-22 17:15:47",
+ "modified": "2013-12-20 19:24:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Purchase Receipt",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -581,6 +583,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@@ -831,7 +834,6 @@
},
{
"doctype": "DocPerm",
- "match": "supplier",
"role": "Supplier"
}
]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
index 9a641c2..4f50040 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:10",
"docstatus": 0,
- "modified": "2013-12-18 10:38:39",
+ "modified": "2013-12-20 19:23:36",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.txt
index b29a1a8..0999570 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.txt
+++ b/erpnext/stock/doctype/serial_no/serial_no.txt
@@ -2,12 +2,13 @@
{
"creation": "2013-05-16 10:59:15",
"docstatus": 0,
- "modified": "2013-11-02 19:41:52",
+ "modified": "2013-12-20 19:24:34",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
+ "allow_import": 1,
"allow_rename": 1,
"autoname": "field:serial_no",
"description": "Distinct unit of an Item",
@@ -29,11 +30,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Serial No",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 3ba0deb..078b8f5 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -288,7 +288,7 @@
if not returnable_qty:
webnotes.throw("{item}: {item_code} {returned}".format(
item=_("Item"), item_code=item.item_code,
- returned=_("already returned though some other documents")))
+ returned=_("already returned though some other documents")), StockOverReturnError)
elif item.transfer_qty > returnable_qty:
webnotes.throw("{item}: {item_code}, {returned}: {qty}".format(
item=_("Item"), item_code=item.item_code,
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt
index 18a07a3..84023ab 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.txt
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt
@@ -2,15 +2,13 @@
{
"creation": "2013-04-09 11:43:55",
"docstatus": 0,
- "modified": "2013-12-09 16:24:10",
+ "modified": "2013-12-20 19:24:35",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 0,
- "allow_email": 0,
- "allow_print": 0,
"allow_rename": 0,
"autoname": "naming_series:",
"doctype": "DocType",
@@ -41,11 +39,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Stock Entry",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 1,
@@ -587,6 +587,7 @@
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
+ "ignore_restrictions": 1,
"in_filter": 0,
"label": "Amended From",
"no_copy": 1,
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 8014c99..1d7c2e4 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -7,9 +7,9 @@
from erpnext.stock.doctype.serial_no.serial_no import *
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
-
class TestStockEntry(unittest.TestCase):
def tearDown(self):
+ webnotes.set_user("Administrator")
set_perpetual_inventory(0)
if hasattr(self, "old_default_company"):
webnotes.conn.set_default("company", self.old_default_company)
@@ -39,46 +39,6 @@
webnotes.conn.set_default("company", self.old_default_company)
- def test_warehouse_company_validation(self):
- set_perpetual_inventory(0)
- self._clear_stock_account_balance()
- webnotes.bean("Profile", "test2@example.com").get_controller()\
- .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
- webnotes.session.user = "test2@example.com"
-
- from erpnext.stock.utils import InvalidWarehouseCompany
- st1 = webnotes.bean(copy=test_records[0])
- st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
- st1.insert()
- self.assertRaises(InvalidWarehouseCompany, st1.submit)
-
- webnotes.session.user = "Administrator"
-
- def test_warehouse_user(self):
- set_perpetual_inventory(0)
- from erpnext.stock.utils import UserNotAllowedForWarehouse
-
- webnotes.bean("Profile", "test@example.com").get_controller()\
- .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
-
- webnotes.bean("Profile", "test2@example.com").get_controller()\
- .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
- webnotes.session.user = "test@example.com"
- st1 = webnotes.bean(copy=test_records[0])
- st1.doc.company = "_Test Company 1"
- st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
- st1.insert()
- self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
-
- webnotes.session.user = "test2@example.com"
- st1 = webnotes.bean(copy=test_records[0])
- st1.doc.company = "_Test Company 1"
- st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
- st1.insert()
- st1.submit()
-
- webnotes.session.user = "Administrator"
-
def test_material_receipt_gl_entry(self):
self._clear_stock_account_balance()
set_perpetual_inventory()
@@ -799,7 +759,49 @@
serial_no = get_serial_nos(se.doclist[1].serial_no)[0]
self.assertFalse(webnotes.conn.get_value("Serial No", serial_no, "warehouse"))
+
+ def test_warehouse_company_validation(self):
+ set_perpetual_inventory(0)
+ self._clear_stock_account_balance()
+ webnotes.bean("Profile", "test2@example.com").get_controller()\
+ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
+ webnotes.set_user("test2@example.com")
+ from erpnext.stock.utils import InvalidWarehouseCompany
+ st1 = webnotes.bean(copy=test_records[0])
+ st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
+ st1.insert()
+ self.assertRaises(InvalidWarehouseCompany, st1.submit)
+
+ # permission tests
+ def test_warehouse_user(self):
+ import webnotes.defaults
+ from webnotes.model.bean import BeanPermissionError
+ set_perpetual_inventory(0)
+
+ webnotes.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction")
+ webnotes.defaults.add_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", "Restriction")
+ webnotes.bean("Profile", "test@example.com").get_controller()\
+ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
+ webnotes.bean("Profile", "test2@example.com").get_controller()\
+ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
+
+ webnotes.set_user("test@example.com")
+ st1 = webnotes.bean(copy=test_records[0])
+ st1.doc.company = "_Test Company 1"
+ st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
+ self.assertRaises(BeanPermissionError, st1.insert)
+
+ webnotes.set_user("test2@example.com")
+ st1 = webnotes.bean(copy=test_records[0])
+ st1.doc.company = "_Test Company 1"
+ st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
+ st1.insert()
+ st1.submit()
+
+ webnotes.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", parenttype="Restriction")
+ webnotes.defaults.clear_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", parenttype="Restriction")
+
def make_serialized_item():
se = webnotes.bean(copy=test_records[0])
se.doclist[1].item_code = "_Test Serialized Item With Series"
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
index b97928b..88c08a7 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-29 18:22:12",
"docstatus": 0,
- "modified": "2013-11-08 16:15:44",
+ "modified": "2013-12-20 19:21:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index c14918f..e43761c 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -13,10 +13,9 @@
self.doclist = doclist
def validate(self):
- from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
+ from erpnext.stock.utils import validate_warehouse_company
self.validate_mandatory()
self.validate_item()
- validate_warehouse_user(self.doc.warehouse)
validate_warehouse_company(self.doc.warehouse, self.doc.company)
self.scrub_posting_time()
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
index c9959d3..f95a1dd 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
@@ -2,15 +2,13 @@
{
"creation": "2013-03-28 10:35:31",
"docstatus": 0,
- "modified": "2013-09-24 15:35:12",
+ "modified": "2013-12-20 16:06:50",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 0,
"allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
"autoname": "SR/.######",
"description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.",
"doctype": "DocType",
@@ -78,6 +76,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Stock Reconciliation",
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.txt
index 634ee3a..de8c864 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.txt
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-24 16:37:54",
"docstatus": 0,
- "modified": "2013-11-02 19:41:56",
+ "modified": "2013-12-20 19:21:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -25,11 +25,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Stock Settings",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "Material Manager",
"write": 1
diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
index 6862a86..a4f368e 100644
--- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
+++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:30",
"docstatus": 0,
- "modified": "2013-07-25 17:39:14",
+ "modified": "2013-12-20 19:21:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -26,11 +26,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Stock UOM Replace Utility",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 0,
"submit": 0,
diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
index d775513..0843921 100644
--- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
+++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:04",
"docstatus": 0,
- "modified": "2013-07-22 17:17:53",
+ "modified": "2013-12-20 19:21:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/doctype/warehouse/test_warehouse.py b/erpnext/stock/doctype/warehouse/test_warehouse.py
index ffc5a28..b0e7641 100644
--- a/erpnext/stock/doctype/warehouse/test_warehouse.py
+++ b/erpnext/stock/doctype/warehouse/test_warehouse.py
@@ -19,10 +19,6 @@
"warehouse_name": "_Test Warehouse 2",
"create_account_under": "Stock Assets - _TC",
"company": "_Test Company 1"
- }, {
- "doctype": "Warehouse User",
- "parentfield": "warehouse_users",
- "user": "test2@example.com"
}],
[{
"doctype": "Warehouse",
diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt
index e194349..627e9dd 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.txt
+++ b/erpnext/stock/doctype/warehouse/warehouse.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-03-07 18:50:32",
"docstatus": 0,
- "modified": "2013-11-19 12:12:33",
+ "modified": "2013-12-20 19:24:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"description": "A logical Warehouse against which stock entries are made.",
"doctype": "DocType",
@@ -25,11 +26,13 @@
},
{
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Warehouse",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1
},
@@ -75,15 +78,13 @@
"fieldname": "create_account_under",
"fieldtype": "Link",
"label": "Parent Account",
- "options": "Account",
- "permlevel": 0
+ "options": "Account"
},
{
"doctype": "DocField",
"fieldname": "column_break_4",
"fieldtype": "Section Break",
"label": "Allow For Users",
- "permlevel": 0,
"read_only": 0
},
{
diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
index fee6221..c28a37f 100644
--- a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
+++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:05",
"docstatus": 0,
- "modified": "2013-07-10 14:54:25",
+ "modified": "2013-12-20 19:21:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index b748029..69a024b 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -8,7 +8,6 @@
from webnotes.defaults import get_global_default
from webnotes.utils.email_lib import sendmail
-class UserNotAllowedForWarehouse(webnotes.ValidationError): pass
class InvalidWarehouseCompany(webnotes.ValidationError): pass
def get_stock_balance_on(warehouse, posting_date=None):
@@ -191,33 +190,7 @@
raise_exception=1)
return valid_serial_nos
-
-def get_warehouse_list(doctype, txt, searchfield, start, page_len, filters):
- """used in search queries"""
- wlist = []
- for w in webnotes.conn.sql_list("""select name from tabWarehouse
- where name like '%%%s%%'""" % txt):
- if webnotes.session.user=="Administrator":
- wlist.append([w])
- else:
- warehouse_users = webnotes.conn.sql_list("""select user from `tabWarehouse User`
- where parent=%s""", w)
- if not warehouse_users:
- wlist.append([w])
- elif webnotes.session.user in warehouse_users:
- wlist.append([w])
- return wlist
-def validate_warehouse_user(warehouse):
- if webnotes.session.user=="Administrator" or not warehouse:
- return
- warehouse_users = [p[0] for p in webnotes.conn.sql("""select user from `tabWarehouse User`
- where parent=%s""", warehouse)]
-
- if warehouse_users and not (webnotes.session.user in warehouse_users):
- webnotes.throw(_("Not allowed entry in Warehouse") \
- + ": " + warehouse, UserNotAllowedForWarehouse)
-
def validate_warehouse_company(warehouse, company):
warehouse_company = webnotes.conn.get_value("Warehouse", warehouse, "company")
if warehouse_company and warehouse_company != company:
diff --git a/erpnext/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.txt
index f9fbc6b..ae16c2c 100644
--- a/erpnext/support/doctype/customer_issue/customer_issue.txt
+++ b/erpnext/support/doctype/customer_issue/customer_issue.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:30",
"docstatus": 0,
- "modified": "2013-11-02 16:59:22",
+ "modified": "2013-12-20 19:24:02",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
@@ -13,7 +13,7 @@
"is_submittable": 0,
"module": "Support",
"name": "__common__",
- "search_fields": "status,customer,customer_name,allocated_to,allocated_on, territory"
+ "search_fields": "status,customer,customer_name,territory"
},
{
"doctype": "DocField",
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Customer Issue",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Maintenance User",
@@ -410,6 +412,7 @@
"fieldname": "amended_from",
"fieldtype": "Data",
"hidden": 1,
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
index bdf14a1..ff97b95 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:30",
"docstatus": 0,
- "modified": "2013-11-02 16:59:23",
+ "modified": "2013-12-20 19:24:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Maintenance Schedule",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Maintenance Manager",
@@ -169,6 +171,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
index e55a69c..8b52d8b 100644
--- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
+++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:05",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
index 648a328..f42b48b 100644
--- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
+++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:05",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
index f68a1f4..2b2986e 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:31",
"docstatus": 0,
- "modified": "2013-11-02 16:59:24",
+ "modified": "2013-12-20 19:24:13",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
@@ -28,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Maintenance Visit",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "Maintenance User",
@@ -230,6 +232,7 @@
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Data",
+ "ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
index 53fa0a2..6a45e55 100644
--- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
+++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:28:06",
"docstatus": 0,
- "modified": "2013-07-10 14:54:10",
+ "modified": "2013-12-20 19:23:20",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt
index 123eeed..9482ed7 100644
--- a/erpnext/support/doctype/newsletter/newsletter.txt
+++ b/erpnext/support/doctype/newsletter/newsletter.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:31",
"docstatus": 0,
- "modified": "2013-11-02 14:06:04",
+ "modified": "2013-12-20 19:24:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,18 +24,20 @@
"permlevel": 0
},
{
- "cancel": 1,
- "create": 1,
+ "cancel": 0,
+ "create": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Newsletter",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
- "write": 1
+ "write": 0
},
{
"doctype": "DocType",
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt
index 4fa4874..59093f7 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.txt
+++ b/erpnext/support/doctype/support_ticket/support_ticket.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-01 10:36:25",
"docstatus": 0,
- "modified": "2013-12-14 17:27:02",
+ "modified": "2013-12-20 19:24:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -27,11 +27,13 @@
"amend": 0,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Support Ticket",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
@@ -278,7 +280,6 @@
{
"cancel": 0,
"doctype": "DocPerm",
- "match": "customer",
"role": "Customer"
},
{
diff --git a/erpnext/utilities/demo/make_demo.py b/erpnext/utilities/demo/make_demo.py
index f469139..4d40670 100644
--- a/erpnext/utilities/demo/make_demo.py
+++ b/erpnext/utilities/demo/make_demo.py
@@ -3,7 +3,7 @@
import webnotes, os, datetime
import webnotes.utils
-from webnotes.utils import random_string
+from webnotes.utils import random_string, cstr
from webnotes.widgets import query_report
import random
import json
@@ -153,7 +153,7 @@
for po in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Purchase Receipt")]:
pr = webnotes.bean(make_purchase_receipt(po))
pr.doc.posting_date = current_date
- pr.doc.fiscal_year = current_date.year
+ pr.doc.fiscal_year = cstr(current_date.year)
pr.insert()
try:
pr.submit()
@@ -169,7 +169,7 @@
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]:
dn = webnotes.bean(make_delivery_note(so))
dn.doc.posting_date = current_date
- dn.doc.fiscal_year = current_date.year
+ dn.doc.fiscal_year = cstr(current_date.year)
dn.insert()
try:
dn.submit()
@@ -192,7 +192,7 @@
mr = webnotes.new_bean("Material Request")
mr.doc.material_request_type = "Purchase"
mr.doc.transaction_date = current_date
- mr.doc.fiscal_year = current_date.year
+ mr.doc.fiscal_year = cstr(current_date.year)
mr.doclist.append({
"doctype": "Material Request Item",
"parentfield": "indent_details",
@@ -211,7 +211,7 @@
if row[0] != "Total":
sq = webnotes.bean(make_supplier_quotation(row[0]))
sq.doc.transaction_date = current_date
- sq.doc.fiscal_year = current_date.year
+ sq.doc.fiscal_year = cstr(current_date.year)
sq.insert()
sq.submit()
webnotes.conn.commit()
@@ -224,7 +224,7 @@
if row[0] != "Total":
po = webnotes.bean(make_purchase_order(row[0]))
po.doc.transaction_date = current_date
- po.doc.fiscal_year = current_date.year
+ po.doc.fiscal_year = cstr(current_date.year)
po.insert()
po.submit()
webnotes.conn.commit()
@@ -283,7 +283,7 @@
try:
st = webnotes.bean(make_stock_entry(pro_id, purpose))
st.doc.posting_date = current_date
- st.doc.fiscal_year = current_date.year
+ st.doc.fiscal_year = cstr(current_date.year)
for d in st.doclist.get({"parentfield": "mtn_details"}):
d.expense_account = "Stock Adjustment - " + company_abbr
d.cost_center = "Main - " + company_abbr
@@ -303,7 +303,7 @@
"customer": get_random("Customer"),
"order_type": "Sales",
"transaction_date": current_date,
- "fiscal_year": current_date.year
+ "fiscal_year": cstr(current_date.year)
}])
add_random_children(b, {
diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.txt
index 5b4ada9..669da2b 100644
--- a/erpnext/utilities/doctype/address/address.txt
+++ b/erpnext/utilities/doctype/address/address.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
- "modified": "2013-12-12 12:17:46",
+ "modified": "2013-12-20 19:23:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +28,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Address",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/utilities/doctype/contact/contact.txt b/erpnext/utilities/doctype/contact/contact.txt
index 1c8a5cf..65c22b3 100644
--- a/erpnext/utilities/doctype/contact/contact.txt
+++ b/erpnext/utilities/doctype/contact/contact.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
- "modified": "2013-12-12 12:18:19",
+ "modified": "2013-12-20 19:23:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_import": 1,
"allow_rename": 1,
"doctype": "DocType",
"document_type": "Master",
@@ -27,11 +28,13 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Contact",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"submit": 0,
diff --git a/erpnext/utilities/doctype/note/note.txt b/erpnext/utilities/doctype/note/note.txt
index 5c6b771..055619a 100644
--- a/erpnext/utilities/doctype/note/note.txt
+++ b/erpnext/utilities/doctype/note/note.txt
@@ -2,12 +2,11 @@
{
"creation": "2013-05-24 13:41:00",
"docstatus": 0,
- "modified": "2013-07-05 14:47:11",
+ "modified": "2013-12-20 19:24:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
- "allow_print": 0,
"allow_rename": 1,
"description": "Note is a free page where users can share documents / notes",
"doctype": "DocType",
@@ -29,11 +28,13 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "Note",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"role": "All",
"write": 1
diff --git a/erpnext/utilities/doctype/note_user/note_user.txt b/erpnext/utilities/doctype/note_user/note_user.txt
index fcc1d11..86fdc44 100644
--- a/erpnext/utilities/doctype/note_user/note_user.txt
+++ b/erpnext/utilities/doctype/note_user/note_user.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 14:24:48",
"docstatus": 0,
- "modified": "2013-07-10 14:54:11",
+ "modified": "2013-12-20 19:23:22",
"modified_by": "Administrator",
"owner": "Administrator"
},
diff --git a/erpnext/utilities/doctype/sms_control/sms_control.txt b/erpnext/utilities/doctype/sms_control/sms_control.txt
index bd63dab..f8e0fae 100644
--- a/erpnext/utilities/doctype/sms_control/sms_control.txt
+++ b/erpnext/utilities/doctype/sms_control/sms_control.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
- "modified": "2013-07-05 14:55:40",
+ "modified": "2013-12-20 19:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -17,13 +17,17 @@
{
"create": 1,
"doctype": "DocPerm",
+ "email": 1,
+ "export": 0,
+ "import": 0,
"name": "__common__",
"parent": "SMS Control",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
- "report": 1,
+ "report": 0,
"role": "System Manager",
"submit": 0,
"write": 1
diff --git a/erpnext/utilities/doctype/sms_log/sms_log.txt b/erpnext/utilities/doctype/sms_log/sms_log.txt
index 094adfd..43cb1ff 100644
--- a/erpnext/utilities/doctype/sms_log/sms_log.txt
+++ b/erpnext/utilities/doctype/sms_log/sms_log.txt
@@ -2,7 +2,7 @@
{
"creation": "2012-03-27 14:36:47",
"docstatus": 0,
- "modified": "2013-07-05 14:55:45",
+ "modified": "2013-12-20 19:24:35",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,11 +24,13 @@
{
"create": 0,
"doctype": "DocPerm",
+ "email": 1,
"name": "__common__",
"parent": "SMS Log",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
+ "print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
diff --git a/patches/1312/p02_update_user_properties.py b/patches/1312/p02_update_user_properties.py
new file mode 100644
index 0000000..085f2c1
--- /dev/null
+++ b/patches/1312/p02_update_user_properties.py
@@ -0,0 +1,102 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+import webnotes.permissions
+import webnotes.model.doctype
+import webnotes.defaults
+
+def execute():
+ webnotes.reload_doc("core", "doctype", "docperm")
+ update_user_properties()
+ update_user_match()
+ add_employee_restrictions_to_leave_approver()
+ update_permissions()
+ remove_duplicate_restrictions()
+ webnotes.defaults.clear_cache()
+ webnotes.clear_cache()
+
+def update_user_properties():
+ webnotes.reload_doc("core", "doctype", "docfield")
+
+ for d in webnotes.conn.sql("""select parent, defkey, defvalue from tabDefaultValue
+ where parent not in ('__global', 'Control Panel')""", as_dict=True):
+ df = webnotes.conn.sql("""select options from tabDocField
+ where fieldname=%s and fieldtype='Link'""", d.defkey, as_dict=True)
+
+ if df:
+ webnotes.conn.sql("""update tabDefaultValue
+ set defkey=%s, parenttype='Restriction'
+ where defkey=%s and
+ parent not in ('__global', 'Control Panel')""", (df[0].options, d.defkey))
+
+def update_user_match():
+ import webnotes.defaults
+ doctype_matches = {}
+ for doctype, match in webnotes.conn.sql("""select parent, `match` from `tabDocPerm`
+ where `match` like %s and ifnull(`match`, '')!="leave_approver:user" """, "%:user"):
+ doctype_matches.setdefault(doctype, []).append(match)
+
+ for doctype, user_matches in doctype_matches.items():
+ meta = webnotes.get_doctype(doctype)
+
+ # for each user with roles of this doctype, check if match condition applies
+ for profile in webnotes.conn.sql_list("""select name from `tabProfile`
+ where enabled=1 and user_type='System User'"""):
+
+ perms = webnotes.permissions.get_user_perms(meta, "read", profile)
+ # user does not have required roles
+ if not perms:
+ continue
+
+ # assume match
+ user_match = True
+ for perm in perms:
+ if not perm.match:
+ # aha! non match found
+ user_match = False
+ break
+
+ if not user_match:
+ continue
+
+ # if match condition applies, restrict that user
+ # add that doc's restriction to that user
+ for match in user_matches:
+ for name in webnotes.conn.sql_list("""select name from `tab{doctype}`
+ where `{field}`=%s""".format(doctype=doctype, field=match.split(":")[0]), profile):
+
+ webnotes.defaults.add_default(doctype, name, profile, "Restriction")
+
+def add_employee_restrictions_to_leave_approver():
+ from webnotes.core.page.user_properties import user_properties
+
+ # add restrict rights to HR User and HR Manager
+ webnotes.conn.sql("""update `tabDocPerm` set `restrict`=1 where parent in ('Employee', 'Leave Application')
+ and role in ('HR User', 'HR Manager') and permlevel=0 and `read`=1""")
+ webnotes.model.doctype.clear_cache()
+
+ # add Employee restrictions (in on_update method)
+ for employee in webnotes.conn.sql_list("""select name from `tabEmployee`
+ where exists(select leave_approver from `tabEmployee Leave Approver`
+ where `tabEmployee Leave Approver`.parent=`tabEmployee`.name)
+ or ifnull(`reports_to`, '')!=''"""):
+
+ webnotes.bean("Employee", employee).save()
+
+def update_permissions():
+ # clear match conditions other than owner
+ webnotes.conn.sql("""update tabDocPerm set `match`=''
+ where ifnull(`match`,'') not in ('', 'owner')""")
+
+def remove_duplicate_restrictions():
+ # remove duplicate restrictions (if they exist)
+ for d in webnotes.conn.sql("""select parent, defkey, defvalue,
+ count(*) as cnt from tabDefaultValue
+ where parent not in ('__global', 'Control Panel')
+ group by parent, defkey, defvalue""", as_dict=1):
+ if d.cnt > 1:
+ # order by parenttype so that restriction does not get removed!
+ webnotes.conn.sql("""delete from tabDefaultValue where parent=%s, defkey=%s,
+ defvalue=%s order by parenttype limit %s""", (d.parent, d.defkey, d.defvalue, d.cnt-1))
diff --git a/patches/1312/p03_move_warehouse_user_to_restrictions.py b/patches/1312/p03_move_warehouse_user_to_restrictions.py
new file mode 100644
index 0000000..4e6a2ed
--- /dev/null
+++ b/patches/1312/p03_move_warehouse_user_to_restrictions.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ from webnotes.core.page.user_properties import user_properties
+ for warehouse, profile in webnotes.conn.sql("""select parent, user from `tabWarehouse User`"""):
+ user_properties.add(profile, "Warehouse", warehouse)
+
+ webnotes.delete_doc("DocType", "Warehouse User")
\ No newline at end of file
diff --git a/patches/1312/p04_new_permissions.py b/patches/1312/p04_new_permissions.py
new file mode 100644
index 0000000..9dffdd4
--- /dev/null
+++ b/patches/1312/p04_new_permissions.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ # reset Page perms
+ from webnotes.core.page.permission_manager.permission_manager import reset
+ reset("Page")
+ reset("Report")
+
+ # patch to move print, email into DocPerm
+ for doctype, hide_print, hide_email in webnotes.conn.sql("""select name, ifnull(allow_print, 0), ifnull(allow_email, 0)
+ from `tabDocType` where ifnull(issingle, 0)=0 and ifnull(istable, 0)=0 and
+ (ifnull(allow_print, 0)=0 or ifnull(allow_email, 0)=0)"""):
+
+ if not hide_print:
+ webnotes.conn.sql("""update `tabDocPerm` set `print`=1
+ where permlevel=0 and `read`=1 and parent=%s""", doctype)
+
+ if not hide_email:
+ webnotes.conn.sql("""update `tabDocPerm` set `email`=1
+ where permlevel=0 and `read`=1 and parent=%s""", doctype)