diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index 8837586b06..407b2d452d 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -37,7 +37,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { // 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 459e102d51..50a6d6da37 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 026cf613f7..f36e21840d 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 9905398d3f..47ff4f1344 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 f53ff52e58..31312c9208 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 ae668abe8d..992c8bec81 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 c8207bda58..a171bf69cc 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 21d655026a..d5ff32b33b 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 99335b7023..77dfa72430 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 a9c7add775..3f1fab279d 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 1cf98fb278..afa4858969 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 5740579088..3ec5ec6c74 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 b47d7ed4c1..9de2abb642 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 aea5d1256d..53a56aa507 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 ed0bedb12a..28a0df4d72 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 5d004e3422..58300306f1 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 accf51595d..bc4e0f7d92 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 5259f74667..1017a98ef5 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 6c3fadd304..37a22a0497 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 09a3757985..22edcddea3 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 af0eb8e559..6df4df40d3 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 49aa68887b..f10d30e88b 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 1a79636183..3f1ae05bd4 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 5ea7fc09ff..9a2a75d4d7 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 f902ade3d1..1430c43d2e 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 99bfe5cdf0..7de68a06ed 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 b82f4acabd..ad1a9eb8fb 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 d7dac74343..339115d25e 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 b006c1d85c..ab4da2aa4f 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 cddf10ec85..485aa94ac1 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 27aaa70115..082cddcaeb 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 3784ecbfb2..22af554466 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 718da365da..0000000000 --- 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 fe7f06cb1b..c421332571 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 @@ erpnext.AccountsChart = Class.extend({ } // 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('' + treenode.parent.append('' + format_currency(treenode.data.balance, treenode.data.currency) + ''); } @@ -142,7 +141,7 @@ erpnext.AccountsChart = Class.extend({ var data = $(link).data('node-data'); if(!data) return; - link.toolbar = $('').insertAfter(link); + link.toolbar = $('').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 2b0c6ad0f0..b91a3557b5 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 40f5756f25..c796c042a9 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 3f3937cd12..0266b80e32 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 4145a7fb38..a78c485f89 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 05ea4e2863..f2860cde54 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 15225103cd..c1ace7ceff 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 d4a2d8fd79..aa8aa18394 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 0c68cc74c7..f08e7cd5d2 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 00eaf90354..99c7352360 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -151,8 +151,7 @@ class DocType(TransactionBase): 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 5c722f1c31..c76eb653cf 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 e532aa6dd1..f3bc30c738 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 f09f5a82e2..f0810ff449 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 6382e0dd92..40de926ea0 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -50,13 +50,12 @@ class BuyingController(StockController): 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 8dde5f953d..8821b7d36f 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 8aaa7e109c..c7d9aafbbb 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 794a879734..5c15ac6edc 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 63c14f0889..ff887c449a 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 074c247cca..0657f64e1c 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 5186a8dbe6..7d383fb9e4 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 3df2cd666d..13aa087b24 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 1e38f0b79e..e24064e14d 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 1f4e4207d8..4cfdcaf8ca 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 75110c2123..f9b48e46c2 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 902a4ed85b..c5ead6366e 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 c185963b72..da72ec7f39 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -7,13 +7,11 @@ import webnotes 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 @@ class DocType: 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 856f26ee29..f8b08e08d4 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 69bbbdeace..9204c63779 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 2d5472927a..962c98194e 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 9cd03ceea2..2c964faba8 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 d51d6a128b..4b176d1c0f 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 cabfbd7a9b..a13fd872b7 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 45ff19b377..5e65aa8ba6 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 e9c5a99693..18b8036b33 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 4d7035063d..689da6eb48 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 fdfa5c737c..4743bf1ccc 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 3b87bb08c7..ad8ddb07d3 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 5978f1457b..8f0832b130 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 bf4b0119aa..cd1cf05d05 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 d795fa83bc..8f0d41ae3a 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 a507547d6e..dcf76ddb3a 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 38e3eb57c9..6e5fe64019 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 c87c36ad53..04b03a79bc 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -12,6 +12,7 @@ from webnotes import msgprint 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 @@ class DocType(DocListController): 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 @@ class DocType(DocListController): 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 d5feb57a9e..24de6a82fc 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 44e818d97c..9bb01340e1 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 @@ class TestLeaveApplication(unittest.TestCase): 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 @@ class TestLeaveApplication(unittest.TestCase): 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 770bfeecfa..6f331b0c53 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 13fa42c069..d386704d21 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 @@ from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_ 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 1e8c86b8c1..94fd3de796 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 c13e2d57c2..138c9e47b5 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 dd339dc53c..adae0d9836 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 641adae946..1f94aa83e0 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 d0a4f47192..2b2909038c 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 3fc25facb2..3375ab55d1 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 1c6a86b94b..e54ebd7e59 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 0af263274d..845a70fde7 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 609fd6c156..d90c3cdd3b 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 ea861be185..5c727619ed 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 a5ff125293..505d8d75aa 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 abc74cd35b..55342aa59f 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 e498c71270..b7017f487c 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 cffdf4c9f0..6ace745c14 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 8d0223e188..8a47a8e155 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -54,10 +54,9 @@ class DocType: 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 5e76c0e18f..ed1c66886b 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 62bb26eecf..9b1300f039 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 @@ class TestProductionOrder(unittest.TestCase): stock_entry = make_stock_entry(pro_bean.doc.name, "Manufacture/Repack") stock_entry = webnotes.bean(stock_entry) - + stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" stock_entry.doc.fg_completed_qty = 4 stock_entry.run_method("get_items") stock_entry.submit() @@ -50,7 +51,7 @@ class TestProductionOrder(unittest.TestCase): 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 7bcaaca298..20681881c3 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 fab7dd0ddb..11a02a56aa 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 c3a1d8f0d5..4c3b065f4a 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 c9114ff85f..306ca4ecef 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 e69de29bb2..ce41342f79 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 e43fbfc482..a5db729d9e 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 @@ def execute(): "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 9065666e1a..b8133a90d5 100644 --- a/erpnext/patches/december_2012/production_cleanup.py +++ b/erpnext/patches/december_2012/production_cleanup.py @@ -10,9 +10,8 @@ def execute(): 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 608ba77168..350ca37432 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -256,11 +256,11 @@ patch_list = [ "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 1f5ce72305..d39f82cb55 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 94fffe7eb6..d8a50c519d 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 9f21dce946..a1967bb310 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 31722d6359..d5be81e9d8 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 1c12c8a534..7ddd51a494 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 1c8e00f4f2..2ad9d647b9 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 74bcc4dc8a..458f0ed31b 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 98eca10092..973fc576b7 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 7025bf5654..07cddd419f 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 a54f23da94..ee54f9319f 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -144,8 +144,7 @@ class DocType(TransactionBase): 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 43a397743a..aaf4b9d6d6 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 135871db81..5abe3b6ac9 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 3c97b3e682..e65fc3812a 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 af81d7fb5b..d23a68ac18 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 7435d461b4..94f648e3a6 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 6e6b61af85..dc8bcdbb1a 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 fec94c8dca..d0dc0f54b6 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 efa1ee90bd..94c6dd25b6 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 93346d3029..3657e4acef 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 37642086b8..e669937d09 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 9a9b6e67cc..cd1ea28d85 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 9e880bc8cd..e06d8f8241 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 452757423a..8e7a89da3e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -128,13 +128,12 @@ class DocType(SellingController): 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 7a1af77947..f9582fb213 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 31c7cbc151..68e6775b49 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 @@ from webnotes.utils import flt 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 @@ class TestSalesOrder(unittest.TestCase): 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 4754aa1404..eb656a600a 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 ae50814b11..9b584296e8 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 a112a7cd69..2a93263de7 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 1737c65c90..7cd61f7370 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 ffc3635660..f52cc60c7f 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 8c9c34a079..91b41c2fb4 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 a61f8dbdf1..ba4419997b 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 10d84d14c5..3a5b0f351b 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 897994b732..c5628d23dd 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 4af3eaad67..36467f2f4f 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 cf4dbcc4f2..259bf378dd 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 1fd9cec210..3dcb016166 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 8c3860ab2d..1e763ea678 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 80caeae1e2..a5a0d01c27 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 8b811a3342..991c8a9310 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 7476ccf435..709e360204 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 db2083910c..f0f5c39cc8 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 3e76986948..17a08c6d70 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.refresh = function(doc, cdt, cdn) { 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 f76a2e1ef3..5b7158fbf6 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 b04885a4c9..ca35916437 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 d68f489af7..dd2df028de 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 78df60925b..65e0588ebd 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.refresh = function(doc, cdt, cdn) { 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 b365893596..83e32b218b 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 769fc27cfe..24a424054c 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 28d4765cb4..dd28eac340 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 d6cbe95d63..861e5479ab 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 d9174e359c..6fccf61dfb 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 17578128fb..f5f8a97fa1 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 7d0750ffcd..6ab274cc77 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 a25a3d186e..19c13b18a4 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.refresh = function(doc, cdt, cdn) { 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['target_details'].grid.get_field("item_group").get_query = f } 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 037c6de353..76d9811122 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 38cca31d77..c4ebb8f84f 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 200dc8115e..c7c2b57f62 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 71debd37b0..3ae395fc22 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 0ddc8f5d5d..e3ff486ea9 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 18dbbb3017..9cb1d7094b 100644 --- a/erpnext/setup/doctype/territory/territory.js +++ b/erpnext/setup/doctype/territory/territory.js @@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { 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 200f24f82f..00b7aac422 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 51d9806755..070c5a4148 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 0a8a3aacc9..a2a6e7e78f 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 5b7a8409ab..17145fffa7 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 a66b5e8eb1..2775191070 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 480d45d014..36615a28d0 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 a118715cd3..96c01f6001 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 22c5dcc7cf..cc12fdaebf 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 def1dff230..9d9b6ca078 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 fc411eb1d6..c21f127b7a 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 df8c817de1..8ec87d7cc1 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 ae9de1e724..74df09a0ae 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 e0e0e6d0a4..02e0bd7cac 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 cbc112e1f0..243ee1f31b 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 c3c1d34751..164da81ca7 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 bfd6216dfe..bf8af3a37b 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 5f0bc9079f..8d02e3a10c 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 40f2e23c90..587d0e313c 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 c71d7d15c0..8762c03edd 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 e0b9330baa..6e8a0d6f98 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 8320502cf7..45a1d4d9b2 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 c86e90faa3..065a056ef5 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 41dd044c7c..54e69914d0 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 d43076bcc8..dabc7e0dc9 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 95e254ef2f..fca3e39007 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 9a641c2ba3..4f5004021c 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 b29a1a8ea2..09995704fa 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 3ba0debf5b..078b8f57d8 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -288,7 +288,7 @@ class DocType(StockController): 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 18a07a3550..84023ab2be 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 8014c99f10..1d7c2e444d 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 webnotes.utils import flt 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 @@ class TestStockEntry(unittest.TestCase): 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 @@ class TestStockEntry(unittest.TestCase): 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 b97928b961..88c08a77b0 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 c14918f0d4..e43761ce78 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 @@ class DocType(DocListController): 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 c9959d36e3..f95a1dddba 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 634ee3a60f..de8c864ebb 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 6862a86ef5..a4f368efc2 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 d775513cd4..0843921150 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 ffc5a284d9..b0e7641a28 100644 --- a/erpnext/stock/doctype/warehouse/test_warehouse.py +++ b/erpnext/stock/doctype/warehouse/test_warehouse.py @@ -19,10 +19,6 @@ test_records = [ "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 e194349947..627e9dd8f2 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 fee6221727..c28a37f5f0 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 b748029187..69a024b7e9 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -8,7 +8,6 @@ from webnotes.utils import flt, cstr, nowdate, add_days, cint 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 @@ def get_valid_serial_nos(sr_nos, qty=0, item_code=''): 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 f9fbc6bd6a..ae16c2ccf7 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 bdf14a18f7..ff97b957bf 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 e55a69c8d5..8b52d8b671 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 648a328913..f42b48bf55 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 f68a1f4ffa..2b2986edc2 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 53fa0a2e19..6a45e55c4e 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 123eeedeff..9482ed712e 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 4fa4874a9c..59093f772f 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 f469139513..4d40670bf4 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 @@ def run_stock(current_date): 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 @@ def run_stock(current_date): 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 @@ def run_purchase(current_date): 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 @@ def run_purchase(current_date): 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 @@ def run_purchase(current_date): 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 @@ def make_stock_entry_from_pro(pro_id, purpose, current_date): 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 @@ def make_quotation(current_date): "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 5b4ada995e..669da2b1c0 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 1c8a5cf94a..65c22b32a0 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 5c6b7713bb..055619a550 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 fcc1d1168f..86fdc44a9f 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 bd63dab3d2..f8e0fae9dc 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 094adfd660..43cb1ffbcd 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 0000000000..085f2c1883 --- /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 0000000000..4e6a2ed1f9 --- /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 0000000000..9dffdd4dfa --- /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)