Merge pull request #1747 from anandpdoshi/apply_user_permissions

Apply user permissions
This commit is contained in:
Anand Doshi 2014-06-04 18:38:25 +05:30
commit 8fbe4b9c3b
215 changed files with 9148 additions and 3510 deletions

View File

@ -74,7 +74,7 @@
{ {
"fieldname": "parent_account", "fieldname": "parent_account",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Parent Account", "label": "Parent Account",
"oldfieldname": "parent_account", "oldfieldname": "parent_account",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -218,7 +218,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -234,7 +234,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -248,7 +248,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -262,7 +262,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -288,7 +288,6 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -298,8 +297,8 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restrict": 1,
"role": "Accounts Manager", "role": "Accounts Manager",
"set_user_permissions": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
}, },

View File

@ -85,7 +85,7 @@
"icon": "icon-check", "icon": "icon-check",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2014-05-06 16:26:08.984595", "modified": "2014-05-27 03:37:21.783216",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Reconciliation", "name": "Bank Reconciliation",
@ -93,6 +93,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 0,
"cancel": 0, "cancel": 0,
"create": 1, "create": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -126,7 +126,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "C-Form", "options": "C-Form",
@ -139,13 +139,14 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 3, "max_attachments": 3,
"modified": "2014-05-09 02:18:00.162685", "modified": "2014-05-27 03:49:08.272135",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "C-Form", "name": "C-Form",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -31,7 +31,7 @@
{ {
"fieldname": "parent_cost_center", "fieldname": "parent_cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Parent Cost Center", "label": "Parent Cost Center",
"oldfieldname": "parent_cost_center", "oldfieldname": "parent_cost_center",
@ -131,7 +131,7 @@
"fieldname": "old_parent", "fieldname": "old_parent",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "old_parent", "label": "old_parent",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "old_parent", "oldfieldname": "old_parent",
@ -145,7 +145,7 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-05-07 06:37:48.038993", "modified": "2014-05-27 03:49:08.910126",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Cost Center", "name": "Cost Center",
@ -153,7 +153,6 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -167,7 +166,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -180,16 +179,19 @@
"write": 0 "write": 0
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Sales User" "role": "Sales User"
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Purchase User" "role": "Purchase User"
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Material User" "role": "Material User"

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:year", "autoname": "field:year",
"creation": "2013-01-22 16:50:25.000000", "creation": "2013-01-22 16:50:25",
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.", "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -11,6 +11,7 @@
"description": "For e.g. 2012, 2012-13", "description": "For e.g. 2012, 2012-13",
"fieldname": "year", "fieldname": "year",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Year Name", "label": "Year Name",
"oldfieldname": "year", "oldfieldname": "year",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -20,6 +21,7 @@
{ {
"fieldname": "year_start_date", "fieldname": "year_start_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Year Start Date", "label": "Year Start Date",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "year_start_date", "oldfieldname": "year_start_date",
@ -30,6 +32,7 @@
{ {
"fieldname": "year_end_date", "fieldname": "year_end_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Year End Date", "label": "Year End Date",
"no_copy": 1, "no_copy": 1,
"permlevel": 0, "permlevel": 0,
@ -40,6 +43,7 @@
"description": "Entries are not allowed against this Fiscal Year if the year is closed.", "description": "Entries are not allowed against this Fiscal Year if the year is closed.",
"fieldname": "is_fiscal_year_closed", "fieldname": "is_fiscal_year_closed",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Year Closed", "label": "Year Closed",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "is_fiscal_year_closed", "oldfieldname": "is_fiscal_year_closed",
@ -51,14 +55,13 @@
], ],
"icon": "icon-calendar", "icon": "icon-calendar",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:46.000000", "modified": "2014-05-27 03:49:10.942338",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Fiscal Year", "name": "Fiscal Year",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -71,6 +74,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -186,7 +186,7 @@
"icon": "icon-list", "icon": "icon-list",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-05-09 02:16:29.981405", "modified": "2014-05-27 03:49:10.998572",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "GL Entry", "name": "GL Entry",
@ -194,7 +194,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,
@ -207,7 +207,6 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 0, "create": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -426,7 +426,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -440,7 +440,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:47.686703", "modified": "2014-05-27 03:49:12.326026",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Journal Voucher", "name": "Journal Voucher",
@ -448,6 +448,7 @@
"permissions": [ "permissions": [
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -476,6 +477,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,

View File

@ -31,7 +31,7 @@
"description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.", "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.",
"fieldname": "default_account", "fieldname": "default_account",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Default Account", "label": "Default Account",
"options": "Account", "options": "Account",
@ -41,7 +41,7 @@
], ],
"icon": "icon-credit-card", "icon": "icon-credit-card",
"idx": 1, "idx": 1,
"modified": "2014-05-07 05:06:13.702313", "modified": "2014-05-27 03:49:13.846602",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Mode of Payment", "name": "Mode of Payment",
@ -59,6 +59,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,

View File

@ -44,7 +44,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
@ -101,7 +101,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:36.920034", "modified": "2014-05-26 03:05:50.722547",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Period Closing Voucher", "name": "Period Closing Voucher",

View File

@ -205,14 +205,13 @@
], ],
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"modified": "2014-05-09 02:17:34.814856", "modified": "2014-05-27 03:49:14.735138",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "POS Setting", "name": "POS Setting",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -225,7 +224,7 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 0, "apply_user_permissions": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -278,7 +278,7 @@
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restrict": 1, "set_user_permissions": 1,
"role": "System Manager", "role": "System Manager",
"write": 1 "write": 1
} }

View File

@ -146,7 +146,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -744,16 +744,17 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:52.618986", "modified": "2014-06-04 08:45:25.582170",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Invoice", "name": "Purchase Invoice",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 1,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "cancel": 1,
"create": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,
@ -761,11 +762,12 @@
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Accounts User", "role": "Accounts User",
"submit": 0, "submit": 1,
"write": 0 "write": 1
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
@ -780,6 +782,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
@ -808,6 +811,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,

View File

@ -1,430 +1,164 @@
{ {
"_last_update": null,
"_user_tags": null,
"allow_attach": null,
"allow_copy": null,
"allow_email": null,
"allow_import": null,
"allow_print": null,
"allow_rename": null,
"allow_trash": null,
"autoname": "PVTD.######", "autoname": "PVTD.######",
"change_log": null,
"client_script": null,
"client_script_core": null,
"client_string": null,
"colour": null,
"creation": "2013-05-21 16:16:04", "creation": "2013-05-21 16:16:04",
"custom": null,
"default_print_format": null,
"description": null,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": null,
"dt_template": null,
"fields": [ "fields": [
{ {
"allow_on_submit": null,
"default": "Valuation and Total", "default": "Valuation and Total",
"depends_on": null,
"description": null,
"fieldname": "category", "fieldname": "category",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0, "in_list_view": 0,
"label": "Consider Tax or Charge for", "label": "Consider Tax or Charge for",
"no_column": null,
"no_copy": null,
"oldfieldname": "category", "oldfieldname": "category",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Valuation and Total\nValuation\nTotal", "options": "Valuation and Total\nValuation\nTotal",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "reqd": 1
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": "Add", "default": "Add",
"depends_on": null,
"description": null,
"fieldname": "add_deduct_tax", "fieldname": "add_deduct_tax",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Add or Deduct", "label": "Add or Deduct",
"no_column": null,
"no_copy": null,
"oldfieldname": "add_deduct_tax", "oldfieldname": "add_deduct_tax",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Add\nDeduct", "options": "Add\nDeduct",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "reqd": 1
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "charge_type", "fieldname": "charge_type",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Type", "label": "Type",
"no_column": null,
"no_copy": null,
"oldfieldname": "charge_type", "oldfieldname": "charge_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "reqd": 1
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"description": null,
"fieldname": "row_id", "fieldname": "row_id",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Reference Row #", "label": "Reference Row #",
"no_column": null,
"no_copy": null,
"oldfieldname": "row_id", "oldfieldname": "row_id",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 0
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Description", "label": "Description",
"no_column": null,
"no_copy": null,
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": "300px", "print_width": "300px",
"read_only": 0, "read_only": 0,
"report_hide": null,
"reqd": 1, "reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "300px" "width": "300px"
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "col_break1", "fieldname": "col_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": null, "permlevel": 0
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": null,
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "account_head", "fieldname": "account_head",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0, "in_list_view": 0,
"label": "Account Head", "label": "Account Head",
"no_column": null,
"no_copy": null,
"oldfieldname": "account_head", "oldfieldname": "account_head",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "reqd": 1
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": ":Company", "default": ":Company",
"depends_on": null,
"description": null,
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0, "in_list_view": 0,
"label": "Cost Center", "label": "Cost Center",
"no_column": null,
"no_copy": null,
"oldfieldname": "cost_center", "oldfieldname": "cost_center",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Cost Center", "options": "Cost Center",
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 0
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "rate", "fieldname": "rate",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Rate", "label": "Rate",
"no_column": null,
"no_copy": null,
"oldfieldname": "rate", "oldfieldname": "rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "reqd": 0
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount", "fieldname": "tax_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Amount", "label": "Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": "tax_amount", "oldfieldname": "tax_amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1, "read_only": 1,
"report_hide": null, "reqd": 0
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "total", "fieldname": "total",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Total", "label": "Total",
"no_column": null,
"no_copy": null,
"oldfieldname": "total", "oldfieldname": "total",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 1
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "item_wise_tax_detail", "fieldname": "item_wise_tax_detail",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Item Wise Tax Detail ", "label": "Item Wise Tax Detail ",
"no_column": null,
"no_copy": null,
"oldfieldname": "item_wise_tax_detail", "oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_width": null, "read_only": 1
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "parenttype", "fieldname": "parenttype",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": 1, "in_filter": 1,
"in_list_view": null,
"label": "Parenttype", "label": "Parenttype",
"no_column": null,
"no_copy": null,
"oldfieldname": "parenttype", "oldfieldname": "parenttype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_width": null,
"read_only": 0, "read_only": 0,
"report_hide": null, "search_index": 0
"reqd": null,
"search_index": 0,
"set_only_once": null,
"trigger": null,
"width": null
} }
], ],
"hide_heading": 1, "hide_heading": 1,
"hide_toolbar": null,
"icon": null,
"idx": 1, "idx": 1,
"in_create": null,
"in_dialog": null,
"is_submittable": null,
"is_transaction_doc": null,
"issingle": null,
"istable": 1, "istable": 1,
"max_attachments": null, "modified": "2014-05-30 03:43:32.494112",
"menu_index": null,
"modified": "2014-04-15 09:48:45.892548",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Taxes and Charges", "name": "Purchase Taxes and Charges",
"name_case": null,
"owner": "Administrator", "owner": "Administrator",
"parent": null, "permissions": []
"parent_node": null,
"parentfield": null,
"parenttype": null,
"permissions": [],
"plugin": null,
"print_outline": null,
"read_only": null,
"read_only_onload": null,
"search_fields": null,
"server_code": null,
"server_code_compiled": null,
"server_code_core": null,
"server_code_error": null,
"show_in_menu": null,
"smallicon": null,
"subject": null,
"tag_fields": null,
"title_field": null,
"use_template": null,
"version": null
} }

View File

@ -106,7 +106,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -1180,7 +1180,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:17:00.217556", "modified": "2014-05-27 03:49:17.806077",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice", "name": "Sales Invoice",
@ -1202,6 +1202,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
@ -1215,6 +1216,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,

View File

@ -1,430 +1,155 @@
{ {
"_last_update": null,
"_user_tags": null,
"allow_attach": null,
"allow_copy": null,
"allow_email": null,
"allow_import": null,
"allow_print": null,
"allow_rename": null,
"allow_trash": null,
"autoname": "INVTD.######", "autoname": "INVTD.######",
"change_log": null,
"client_script": null,
"client_script_core": null,
"client_string": null,
"colour": null,
"creation": "2013-04-24 11:39:32", "creation": "2013-04-24 11:39:32",
"custom": null,
"default_print_format": null,
"description": null,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": null,
"dt_template": null,
"fields": [ "fields": [
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "charge_type", "fieldname": "charge_type",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Type", "label": "Type",
"no_column": null,
"no_copy": null,
"oldfieldname": "charge_type", "oldfieldname": "charge_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
"permlevel": 0, "permlevel": 0,
"print_hide": null, "reqd": 1
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"description": null,
"fieldname": "row_id", "fieldname": "row_id",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Reference Row #", "label": "Reference Row #",
"no_column": null,
"no_copy": null,
"oldfieldname": "row_id", "oldfieldname": "row_id",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": null, "permlevel": 0
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Description", "label": "Description",
"no_column": null,
"no_copy": null,
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": "300px", "print_width": "300px",
"read_only": null,
"report_hide": null,
"reqd": 1, "reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "300px" "width": "300px"
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "col_break_1", "fieldname": "col_break_1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": null,
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "50%" "width": "50%"
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "account_head", "fieldname": "account_head",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0, "in_list_view": 0,
"label": "Account Head", "label": "Account Head",
"no_column": null,
"no_copy": null,
"oldfieldname": "account_head", "oldfieldname": "account_head",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": ":Company", "default": ":Company",
"depends_on": null,
"description": null,
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0, "in_list_view": 0,
"label": "Cost Center", "label": "Cost Center",
"no_column": null,
"no_copy": null,
"oldfieldname": "cost_center_other_charges", "oldfieldname": "cost_center_other_charges",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Cost Center", "options": "Cost Center",
"permlevel": 0, "permlevel": 0
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "rate", "fieldname": "rate",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Rate", "label": "Rate",
"no_column": null,
"no_copy": null,
"oldfieldname": "rate", "oldfieldname": "rate",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null, "reqd": 1
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount", "fieldname": "tax_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Amount", "label": "Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": "tax_amount", "oldfieldname": "tax_amount",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1, "read_only": 1,
"report_hide": null, "reqd": 0
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "total", "fieldname": "total",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Total", "label": "Total",
"no_column": null,
"no_copy": null,
"oldfieldname": "total", "oldfieldname": "total",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 1
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"default": null,
"depends_on": null,
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
"fieldname": "included_in_print_rate", "fieldname": "included_in_print_rate",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Is this Tax included in Basic Rate?", "label": "Is this Tax included in Basic Rate?",
"no_column": null,
"no_copy": 0, "no_copy": 0,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_width": "150px", "print_width": "150px",
"read_only": null,
"report_hide": 1, "report_hide": 1,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "150px" "width": "150px"
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount_after_discount_amount", "fieldname": "tax_amount_after_discount_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Tax Amount After Discount Amount", "label": "Tax Amount After Discount Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 1
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "item_wise_tax_detail", "fieldname": "item_wise_tax_detail",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Item Wise Tax Detail", "label": "Item Wise Tax Detail",
"no_column": null,
"no_copy": null,
"oldfieldname": "item_wise_tax_detail", "oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 1
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "parenttype", "fieldname": "parenttype",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": 1, "in_filter": 1,
"in_list_view": null,
"label": "Parenttype", "label": "Parenttype",
"no_column": null,
"no_copy": null,
"oldfieldname": "parenttype", "oldfieldname": "parenttype",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_width": null, "search_index": 1
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": 1,
"set_only_once": null,
"trigger": null,
"width": null
} }
], ],
"hide_heading": 1, "hide_heading": 1,
"hide_toolbar": null,
"icon": null,
"idx": 1, "idx": 1,
"in_create": null,
"in_dialog": null,
"is_submittable": null,
"is_transaction_doc": null,
"issingle": null,
"istable": 1, "istable": 1,
"max_attachments": null, "modified": "2014-05-30 03:43:39.740638",
"menu_index": null,
"modified": "2014-04-14 18:40:48.450796",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Taxes and Charges", "name": "Sales Taxes and Charges",
"name_case": null,
"owner": "Administrator", "owner": "Administrator",
"parent": null, "permissions": []
"parent_node": null,
"parentfield": null,
"parenttype": null,
"permissions": [],
"plugin": null,
"print_outline": null,
"read_only": null,
"read_only_onload": null,
"search_fields": null,
"server_code": null,
"server_code_compiled": null,
"server_code_core": null,
"server_code_error": null,
"show_in_menu": null,
"smallicon": null,
"subject": null,
"tag_fields": null,
"title_field": null,
"use_template": null,
"version": null
} }

View File

@ -2,7 +2,7 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:title", "autoname": "field:title",
"creation": "2013-01-10 16:34:09.000000", "creation": "2013-01-10 16:34:09",
"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.", "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.",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -12,6 +12,7 @@
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Title", "label": "Title",
"oldfieldname": "title", "oldfieldname": "title",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -22,6 +23,7 @@
{ {
"fieldname": "is_default", "fieldname": "is_default",
"fieldtype": "Check", "fieldtype": "Check",
"in_list_view": 1,
"label": "Default", "label": "Default",
"permlevel": 0 "permlevel": 0
}, },
@ -34,6 +36,7 @@
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Company", "label": "Company",
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -69,7 +72,7 @@
], ],
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"modified": "2014-01-28 12:28:27.000000", "modified": "2014-05-27 03:49:19.023941",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Taxes and Charges Master", "name": "Sales Taxes and Charges Master",
@ -77,7 +80,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -91,7 +94,6 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -105,7 +107,6 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -1,6 +1,6 @@
{ {
"autoname": "Prompt", "autoname": "Prompt",
"creation": "2013-06-25 11:48:03.000000", "creation": "2013-06-25 11:48:03",
"description": "Specify conditions to calculate shipping amount", "description": "Specify conditions to calculate shipping amount",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -102,13 +102,14 @@
], ],
"icon": "icon-truck", "icon": "icon-truck",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:49:27.000000", "modified": "2014-05-27 03:49:19.387875",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Shipping Rule", "name": "Shipping Rule",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,
@ -118,6 +119,7 @@
"role": "Accounts User" "role": "Accounts User"
}, },
{ {
"apply_user_permissions": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,
@ -127,7 +129,6 @@
"role": "Sales User" "role": "Sales User"
}, },
{ {
"cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -139,7 +140,6 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.defaults import get_restrictions from frappe.defaults import get_user_permissions
from frappe.utils import add_days from frappe.utils import add_days
from erpnext.utilities.doctype.address.address import get_address_display from erpnext.utilities.doctype.address.address import get_address_display
from erpnext.utilities.doctype.contact.contact import get_contact_details from erpnext.utilities.doctype.contact.contact import get_contact_details
@ -86,9 +86,9 @@ def set_other_values(out, party, party_type):
def set_price_list(out, party, party_type, given_price_list): def set_price_list(out, party, party_type, given_price_list):
# price list # price list
price_list = get_restrictions().get("Price List") price_list = filter(None, get_user_permissions().get("Price List", []))
if isinstance(price_list, list): if isinstance(price_list, list):
price_list = None price_list = price_list[0] if len(price_list)==1 else None
if not price_list: if not price_list:
price_list = party.default_price_list price_list = party.default_price_list

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-04-22 16:16:03", "creation": "2013-04-22 16:16:03",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:55.961149", "modified": "2014-06-03 07:18:10.985354",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Payable", "name": "Accounts Payable",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-04-16 11:31:13.000000", "apply_user_permissions": 1,
"creation": "2013-04-16 11:31:13",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:16.907658",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Receivable", "name": "Accounts Receivable",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-05-01 12:13:25.000000", "apply_user_permissions": 1,
"creation": "2013-05-01 12:13:25",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:16.921522",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Clearance Summary", "name": "Bank Clearance Summary",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 0, "add_total_row": 0,
"creation": "2013-04-30 18:30:21.000000", "apply_user_permissions": 1,
"creation": "2013-04-30 18:30:21",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:16.926502",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Reconciliation Statement", "name": "Bank Reconciliation Statement",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-18 12:56:36.000000", "apply_user_permissions": 1,
"creation": "2013-06-18 12:56:36",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:16.971175",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Budget Variance Report", "name": "Budget Variance Report",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-03 16:17:34.000000", "apply_user_permissions": 1,
"creation": "2013-06-03 16:17:34",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:16.993419",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Customer Account Head", "name": "Customer Account Head",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-07-30 17:28:49", "creation": "2013-07-30 17:28:49",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.009640", "modified": "2014-06-03 07:18:17.034953",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Delivered Items To Be Billed", "name": "Delivered Items To Be Billed",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-12-06 13:22:23.000000", "apply_user_permissions": 1,
"creation": "2013-12-06 13:22:23",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.072046",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "General Ledger", "name": "General Ledger",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-02-25 17:03:34.000000", "apply_user_permissions": 1,
"creation": "2013-02-25 17:03:34",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.077022",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Gross Profit", "name": "Gross Profit",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-06-05 15:37:30.000000", "apply_user_permissions": 1,
"creation": "2013-06-05 15:37:30",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.113416",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Item-wise Purchase Register", "name": "Item-wise Purchase Register",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-05-13 17:50:55.000000", "apply_user_permissions": 1,
"creation": "2013-05-13 17:50:55",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.123848",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Item-wise Sales Register", "name": "Item-wise Sales Register",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-02-21 14:26:44", "creation": "2013-02-21 14:26:44",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.120371", "modified": "2014-06-03 07:18:17.197631",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Ordered Items To Be Billed", "name": "Ordered Items To Be Billed",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-12-02 17:06:37.000000", "apply_user_permissions": 1,
"creation": "2013-12-02 17:06:37",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.207997",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Payment Period Based On Invoice Date", "name": "Payment Period Based On Invoice Date",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-13 18:46:55.000000", "apply_user_permissions": 1,
"creation": "2013-06-13 18:46:55",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.239496",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Invoice Trends", "name": "Purchase Invoice Trends",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-28 15:54:16", "creation": "2013-05-28 15:54:16",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.166593", "modified": "2014-06-03 07:18:17.244501",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Order Items To Be Billed", "name": "Purchase Order Items To Be Billed",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-04-29 16:13:11.000000", "apply_user_permissions": 1,
"creation": "2013-04-29 16:13:11",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.265444",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Register", "name": "Purchase Register",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-07-30 18:35:10", "creation": "2013-07-30 18:35:10",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.176404", "modified": "2014-06-03 07:18:17.275594",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Received Items To Be Billed", "name": "Received Items To Be Billed",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-13 18:44:21.000000", "apply_user_permissions": 1,
"creation": "2013-06-13 18:44:21",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.291463",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice Trends", "name": "Sales Invoice Trends",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-05-06 12:28:23", "creation": "2013-05-06 12:28:23",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.188121", "modified": "2014-06-03 07:18:17.302063",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Partners Commission", "name": "Sales Partners Commission",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-04-23 18:15:29.000000", "apply_user_permissions": 1,
"creation": "2013-04-23 18:15:29",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.317451",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Register", "name": "Sales Register",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-04 12:56:17.000000", "apply_user_permissions": 1,
"creation": "2013-06-04 12:56:17",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.353489",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Supplier Account Head", "name": "Supplier Account Head",

View File

@ -106,7 +106,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -636,7 +636,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:17:04.992233", "modified": "2014-05-27 03:49:15.948363",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order", "name": "Purchase Order",
@ -644,6 +644,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
@ -672,6 +673,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -685,6 +687,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,

View File

@ -56,8 +56,8 @@
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"in_list_view": 1,
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Item Code", "label": "Item Code",
"oldfieldname": "item_code", "oldfieldname": "item_code",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -169,7 +169,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -206,7 +206,7 @@
"icon": "icon-search", "icon": "icon-search",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-06 08:20:33.015328", "modified": "2014-05-26 03:05:52.140251",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Quality Inspection", "name": "Quality Inspection",

View File

@ -123,7 +123,7 @@
{ {
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Default Currency", "label": "Default Currency",
"no_copy": 1, "no_copy": 1,
"options": "Currency", "options": "Currency",
@ -132,7 +132,7 @@
{ {
"fieldname": "default_price_list", "fieldname": "default_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Price List", "label": "Price List",
"options": "Price List", "options": "Price List",
"permlevel": 0 "permlevel": 0
@ -140,7 +140,7 @@
{ {
"fieldname": "default_taxes_and_charges", "fieldname": "default_taxes_and_charges",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Taxes and Charges", "label": "Taxes and Charges",
"options": "Purchase Taxes and Charges Master", "options": "Purchase Taxes and Charges Master",
"permlevel": 0 "permlevel": 0
@ -186,7 +186,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:08:33.836379", "modified": "2014-05-27 03:49:20.060872",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier", "name": "Supplier",
@ -194,7 +194,6 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -208,7 +207,6 @@
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -221,11 +219,13 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Material User" "role": "Material User"
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Accounts User" "role": "Accounts User"

View File

@ -106,7 +106,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -562,7 +562,7 @@
"icon": "icon-shopping-cart", "icon": "icon-shopping-cart",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:17:10.664189", "modified": "2014-05-27 03:49:20.226683",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Quotation", "name": "Supplier Quotation",
@ -598,6 +598,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
@ -612,6 +613,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
@ -626,6 +628,7 @@
}, },
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-03 14:55:53", "creation": "2013-05-03 14:55:53",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.060149", "modified": "2014-06-03 07:18:17.103261",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Item-wise Purchase History", "name": "Item-wise Purchase History",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-06-13 18:45:01.000000", "apply_user_permissions": 1,
"creation": "2013-06-13 18:45:01",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.255067",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order Trends", "name": "Purchase Order Trends",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-13 16:10:02", "creation": "2013-05-13 16:10:02",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.180305", "modified": "2014-06-03 07:18:17.280960",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Requested Items To Be Ordered", "name": "Requested Items To Be Ordered",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-10-09 10:38:40", "creation": "2013-10-09 10:38:40",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.218629", "modified": "2014-06-03 07:18:17.358554",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Addresses and Contacts", "name": "Supplier Addresses and Contacts",

View File

@ -32,7 +32,7 @@
{ {
"fieldname": "default_price_list", "fieldname": "default_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Default Price List", "label": "Default Price List",
"options": "Price List", "options": "Price List",
"permlevel": 0 "permlevel": 0
@ -64,13 +64,14 @@
"read_only": 1 "read_only": 1
} }
], ],
"modified": "2014-05-07 05:18:29.669293", "modified": "2014-05-27 03:49:14.598212",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Contacts", "module": "Contacts",
"name": "Party Type", "name": "Party Type",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
@ -78,6 +79,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,

View File

@ -48,7 +48,7 @@
], ],
"icon": "icon-rss", "icon": "icon-rss",
"idx": 1, "idx": 1,
"modified": "2014-05-02 08:27:23.936733", "modified": "2014-05-27 03:49:10.882587",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Home", "module": "Home",
"name": "Feed", "name": "Feed",
@ -63,6 +63,7 @@
"role": "System Manager" "role": "System Manager"
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "All" "role": "All"

View File

@ -16,21 +16,23 @@ def on_doctype_update():
frappe.db.sql("""alter table `tabFeed` frappe.db.sql("""alter table `tabFeed`
add index feed_doctype_docname_index(doc_type, doc_name)""") add index feed_doctype_docname_index(doc_type, doc_name)""")
def get_permission_query_conditions(): def get_permission_query_conditions(user):
restrictions = frappe.defaults.get_restrictions() if not user: user = frappe.session.user
can_read = frappe.user.get_can_read()
user_permissions = frappe.defaults.get_user_permissions(user)
can_read = frappe.get_user(user).get_can_read()
can_read_doctypes = ['"{}"'.format(doctype) for doctype in can_read_doctypes = ['"{}"'.format(doctype) for doctype in
list(set(can_read) - set(restrictions.keys()))] list(set(can_read) - set(user_permissions.keys()))]
if not can_read_doctypes: if not can_read_doctypes:
return "" return ""
conditions = ["tabFeed.doc_type in ({})".format(", ".join(can_read_doctypes))] conditions = ["tabFeed.doc_type in ({})".format(", ".join(can_read_doctypes))]
if restrictions: if user_permissions:
can_read_docs = [] can_read_docs = []
for doctype, names in restrictions.items(): for doctype, names in user_permissions.items():
for n in names: for n in names:
can_read_docs.append('"{}|{}"'.format(doctype, n)) can_read_docs.append('"{}|{}"'.format(doctype, n))
@ -40,5 +42,5 @@ def get_permission_query_conditions():
return "(" + " or ".join(conditions) + ")" return "(" + " or ".join(conditions) + ")"
def has_permission(doc): def has_permission(doc, user):
return frappe.has_permission(doc.doc_type, "read", doc.doc_name) return frappe.has_permission(doc.doc_type, "read", doc.doc_name, user=user)

View File

@ -28,10 +28,12 @@ standard_queries = "Customer:erpnext.selling.doctype.customer.customer.get_custo
permission_query_conditions = { permission_query_conditions = {
"Feed": "erpnext.home.doctype.feed.feed.get_permission_query_conditions", "Feed": "erpnext.home.doctype.feed.feed.get_permission_query_conditions",
"Note": "erpnext.utilities.doctype.note.note.get_permission_query_conditions"
} }
has_permission = { has_permission = {
"Feed": "erpnext.home.doctype.feed.feed.has_permission", "Feed": "erpnext.home.doctype.feed.feed.has_permission",
"Note": "erpnext.utilities.doctype.note.note.has_permission"
} }
@ -48,7 +50,8 @@ doc_events = {
"on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_qty" "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_qty"
}, },
"User": { "User": {
"on_update": "erpnext.hr.doctype.employee.employee.update_user_default" "validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
"on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions"
} }
} }

View File

@ -181,7 +181,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -196,13 +196,14 @@
"icon": "icon-thumbs-up", "icon": "icon-thumbs-up",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:37.334857", "modified": "2014-05-27 03:49:07.393120",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Appraisal", "name": "Appraisal",
"owner": "ashwini@webnotestech.com", "owner": "ashwini@webnotestech.com",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
@ -211,7 +212,6 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restricted": 1,
"role": "Employee", "role": "Employee",
"submit": 0, "submit": 0,
"write": 1 "write": 1
@ -232,6 +232,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,

View File

@ -9,12 +9,14 @@ from frappe.utils import flt, getdate
from frappe import _ from frappe import _
from frappe.model.mapper import get_mapped_doc from frappe.model.mapper import get_mapped_doc
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class Appraisal(Document): class Appraisal(Document):
def validate(self): def validate(self):
if not self.status: if not self.status:
self.status = "Draft" self.status = "Draft"
set_employee_name(self)
self.validate_dates() self.validate_dates()
self.validate_existing_appraisal() self.validate_existing_appraisal()
self.calculate_total() self.calculate_total()

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:kra_title", "autoname": "field:kra_title",
"creation": "2012-07-03 13:30:39.000000", "creation": "2012-07-03 13:30:39",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -9,6 +9,7 @@
{ {
"fieldname": "kra_title", "fieldname": "kra_title",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Appraisal Template Title", "label": "Appraisal Template Title",
"oldfieldname": "kra_title", "oldfieldname": "kra_title",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -18,6 +19,7 @@
{ {
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"in_list_view": 1,
"label": "Description", "label": "Description",
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
@ -37,19 +39,21 @@
{ {
"fieldname": "total_points", "fieldname": "total_points",
"fieldtype": "Int", "fieldtype": "Int",
"in_list_view": 1,
"label": "Total Points", "label": "Total Points",
"permlevel": 0 "permlevel": 0
} }
], ],
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"modified": "2013-12-20 19:23:55.000000", "modified": "2014-05-27 03:49:07.533203",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Appraisal Template", "name": "Appraisal Template",
"owner": "ashwini@webnotestech.com", "owner": "ashwini@webnotestech.com",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -117,7 +117,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "Attendance", "options": "Attendance",
@ -129,7 +129,7 @@
"icon": "icon-ok", "icon": "icon-ok",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:37.761770", "modified": "2014-05-27 03:49:07.580876",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Attendance", "name": "Attendance",
@ -149,6 +149,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,

View File

@ -7,6 +7,7 @@ import frappe
from frappe.utils import getdate, nowdate from frappe.utils import getdate, nowdate
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class Attendance(Document): class Attendance(Document):
def validate_duplicate_record(self): def validate_duplicate_record(self):
@ -16,6 +17,8 @@ class Attendance(Document):
if res: if res:
frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee)) frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee))
set_employee_name(self)
def check_leave_record(self): def check_leave_record(self):
if self.status == 'Present': if self.status == 'Present':
leave = frappe.db.sql("""select name from `tabLeave Application` leave = frappe.db.sql("""select name from `tabLeave Application`

View File

@ -20,14 +20,14 @@
], ],
"icon": "icon-code-fork", "icon": "icon-code-fork",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:31.752490", "modified": "2014-05-27 03:49:08.179137",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Branch", "name": "Branch",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -40,7 +40,6 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -30,14 +30,14 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:38.154345", "modified": "2014-05-27 03:49:09.624972",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Deduction Type", "name": "Deduction Type",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -29,14 +29,14 @@
], ],
"icon": "icon-sitemap", "icon": "icon-sitemap",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:39.931091", "modified": "2014-05-27 03:49:10.061057",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Department", "name": "Department",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -20,14 +20,14 @@
], ],
"icon": "icon-bookmark", "icon": "icon-bookmark",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:38.265440", "modified": "2014-05-27 03:49:10.099099",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Designation", "name": "Designation",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -53,14 +53,14 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:38.414922", "modified": "2014-05-27 03:49:10.133416",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Earning Type", "name": "Earning Type",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -87,6 +87,7 @@
"description": "System User (login) ID. If set, it will become default for all HR forms.", "description": "System User (login) ID. If set, it will become default for all HR forms.",
"fieldname": "user_id", "fieldname": "user_id",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "User ID", "label": "User ID",
"options": "User", "options": "User",
"permlevel": 0 "permlevel": 0
@ -346,7 +347,7 @@
{ {
"fieldname": "reports_to", "fieldname": "reports_to",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Reports to", "label": "Reports to",
"oldfieldname": "reports_to", "oldfieldname": "reports_to",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -672,7 +673,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-05-21 07:49:56.180832", "modified": "2014-05-27 07:34:49.337586",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",
@ -680,7 +681,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -688,14 +689,13 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restricted": 1,
"role": "Employee", "role": "Employee",
"submit": 0, "submit": 0,
"write": 0 "write": 0
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -703,14 +703,12 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restrict": 0,
"role": "HR User", "role": "HR User",
"submit": 0, "submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -718,15 +716,15 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restrict": 1,
"role": "HR Manager", "role": "HR Manager",
"set_user_permissions": 1,
"submit": 0, "submit": 0,
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"restricted": 1,
"role": "Leave Approver" "role": "Leave Approver"
} }
], ],

View File

@ -6,12 +6,13 @@ import frappe
from frappe.utils import getdate, validate_email_add, cint from frappe.utils import getdate, validate_email_add, cint
from frappe.model.naming import make_autoname from frappe.model.naming import make_autoname
from frappe import throw, _ from frappe import throw, _, msgprint
import frappe.permissions import frappe.permissions
from frappe.defaults import get_restrictions
from frappe.model.document import Document from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc from frappe.model.mapper import get_mapped_doc
class EmployeeUserDisabledError(frappe.ValidationError): pass
class Employee(Document): class Employee(Document):
def onload(self): def onload(self):
self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure", self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
@ -45,36 +46,24 @@ class Employee(Document):
def on_update(self): def on_update(self):
if self.user_id: if self.user_id:
self.update_user_default()
self.update_user() self.update_user()
self.update_user_permissions()
self.update_dob_event() self.update_dob_event()
self.restrict_leave_approver() self.update_leave_approver_user_permissions()
def restrict_user(self): def update_user_permissions(self):
"""restrict to this employee for user""" frappe.permissions.add_user_permission("Employee", self.name, self.user_id)
self.add_restriction_if_required("Employee", self.user_id) frappe.permissions.set_user_permission_if_allowed("Company", self.company, self.user_id)
def update_user_default(self): def update_leave_approver_user_permissions(self):
self.restrict_user() """add employee user permission for leave approver"""
frappe.db.set_default("employee_name", self.employee_name, self.user_id)
frappe.db.set_default("company", self.company, self.user_id)
def restrict_leave_approver(self):
"""restrict to this employee for leave approver"""
employee_leave_approvers = [d.leave_approver for d in self.get("employee_leave_approvers")] employee_leave_approvers = [d.leave_approver for d in self.get("employee_leave_approvers")]
if self.reports_to and self.reports_to not in employee_leave_approvers: if self.reports_to and self.reports_to not in employee_leave_approvers:
employee_leave_approvers.append(frappe.db.get_value("Employee", self.reports_to, "user_id")) employee_leave_approvers.append(frappe.db.get_value("Employee", self.reports_to, "user_id"))
for user in employee_leave_approvers: for user in employee_leave_approvers:
self.add_restriction_if_required("Employee", user) frappe.permissions.add_user_permission("Employee", self.name, user)
self.add_restriction_if_required("Leave Application", user)
def add_restriction_if_required(self, doctype, user):
if frappe.permissions.has_only_non_restrict_role(doctype, user) \
and self.name not in get_restrictions(user).get("Employee", []):
frappe.defaults.add_default("Employee", self.name, user, "Restriction")
def update_user(self): def update_user(self):
# add employee role if missing # add employee role if missing
@ -85,7 +74,7 @@ class Employee(Document):
user.add_roles("Employee") user.add_roles("Employee")
# copy details like Fullname, DOB and Image to User # copy details like Fullname, DOB and Image to User
if self.employee_name: if self.employee_name and not (user.first_name and user.last_name):
employee_name = self.employee_name.split(" ") employee_name = self.employee_name.split(" ")
if len(employee_name) >= 3: if len(employee_name) >= 3:
user.last_name = " ".join(employee_name[2:]) user.last_name = " ".join(employee_name[2:])
@ -111,7 +100,7 @@ class Employee(Document):
"attached_to_doctype": "User", "attached_to_doctype": "User",
"attached_to_name": self.user_id "attached_to_name": self.user_id
}).insert() }).insert()
except frappe.DuplicateEntryError, e: except frappe.DuplicateEntryError:
# already exists # already exists
pass pass
@ -146,7 +135,7 @@ class Employee(Document):
enabled = frappe.db.sql("""select name from `tabUser` where enabled = frappe.db.sql("""select name from `tabUser` where
name=%s and enabled=1""", self.user_id) name=%s and enabled=1""", self.user_id)
if not enabled: if not enabled:
throw(_("User {0} is disabled").format(self.user_id)) throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
def validate_duplicate_user_id(self): def validate_duplicate_user_id(self):
employee = frappe.db.sql_list("""select name from `tabEmployee` where employee = frappe.db.sql_list("""select name from `tabEmployee` where
@ -155,12 +144,12 @@ class Employee(Document):
throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0])) throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0]))
def validate_employee_leave_approver(self): def validate_employee_leave_approver(self):
from frappe.utils.user import User
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
for l in self.get("employee_leave_approvers"): for l in self.get("employee_leave_approvers")[:]:
if "Leave Approver" not in User(l.leave_approver).get_roles(): if "Leave Approver" not in frappe.get_roles(l.leave_approver):
throw(_("{0} is not a valid Leave Approver").format(l.leave_approver), InvalidLeaveApproverError) self.get("employee_leave_approvers").remove(l)
msgprint(_("{0} is not a valid Leave Approver. Removing row #{1}.").format(l.leave_approver, l.idx))
def update_dob_event(self): def update_dob_event(self):
if self.status == "Active" and self.date_of_birth \ if self.status == "Active" and self.date_of_birth \
@ -217,10 +206,15 @@ def make_salary_structure(source_name, target=None):
target.make_earn_ded_table() target.make_earn_ded_table()
return target return target
def update_user_default(doc, method): def validate_employee_role(doc, method):
# called via User hook # called via User hook
try: if "Employee" in [d.role for d in doc.get("user_roles")]:
if not frappe.db.get_value("Employee", {"user_id": doc.name}):
frappe.msgprint("Please set User ID field in an Employee record to set Employee Role")
doc.get("user_roles").remove(doc.get("user_roles", {"role": "Employee"})[0])
def update_user_permissions(doc, method):
# called via User hook
if "Employee" in [d.role for d in doc.get("user_roles")]:
employee = frappe.get_doc("Employee", {"user_id": doc.name}) employee = frappe.get_doc("Employee", {"user_id": doc.name})
employee.update_user_default() employee.update_user_permissions()
except frappe.DoesNotExistError:
pass

View File

@ -19,14 +19,14 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:38.630562", "modified": "2014-05-27 03:49:10.551828",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employment Type", "name": "Employment Type",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -39,7 +39,6 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -172,7 +172,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -187,13 +187,14 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:38.198490", "modified": "2014-05-27 03:49:10.736177",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Expense Claim", "name": "Expense Claim",
"owner": "harshada@webnotestech.com", "owner": "harshada@webnotestech.com",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -201,12 +202,12 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restricted": 1,
"role": "Employee", "role": "Employee",
"write": 1 "write": 1
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -221,6 +222,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,

View File

@ -5,11 +5,13 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class ExpenseClaim(Document): class ExpenseClaim(Document):
def validate(self): def validate(self):
self.validate_fiscal_year() self.validate_fiscal_year()
self.validate_exp_details() self.validate_exp_details()
set_employee_name(self)
def on_submit(self): def on_submit(self):
if self.approval_status=="Draft": if self.approval_status=="Draft":

View File

@ -1,7 +1,7 @@
{ {
"allow_attach": 1, "allow_attach": 1,
"autoname": "field:applicant_name", "autoname": "field:applicant_name",
"creation": "2013-01-29 19:25:37.000000", "creation": "2013-01-29 19:25:37",
"description": "Applicant for a Job", "description": "Applicant for a Job",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -66,14 +66,14 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:50.000000", "modified": "2014-05-27 03:49:12.168814",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Job Applicant", "name": "Job Applicant",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 1, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -1,6 +1,6 @@
{ {
"autoname": "field:job_title", "autoname": "field:job_title",
"creation": "2013-01-15 16:13:36.000000", "creation": "2013-01-15 16:13:36",
"description": "Description of a Job Opening", "description": "Description of a Job Opening",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -9,6 +9,7 @@
{ {
"fieldname": "job_title", "fieldname": "job_title",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Job Title", "label": "Job Title",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
@ -16,6 +17,7 @@
{ {
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Status", "label": "Status",
"options": "Open\nClosed", "options": "Open\nClosed",
"permlevel": 0 "permlevel": 0
@ -24,20 +26,21 @@
"description": "Job profile, qualifications required etc.", "description": "Job profile, qualifications required etc.",
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"in_list_view": 1,
"label": "Description", "label": "Description",
"permlevel": 0 "permlevel": 0
} }
], ],
"icon": "icon-bookmark", "icon": "icon-bookmark",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:51.000000", "modified": "2014-05-27 03:49:12.248194",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Job Opening", "name": "Job Opening",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 1, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -123,7 +123,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -136,7 +136,7 @@
"icon": "icon-ok", "icon": "icon-ok",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:16:39.508488", "modified": "2014-05-27 03:49:12.744348",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Allocation", "name": "Leave Allocation",
@ -144,6 +144,7 @@
"permissions": [ "permissions": [
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -152,7 +153,6 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restricted": 1,
"role": "HR User", "role": "HR User",
"submit": 1, "submit": 1,
"write": 1 "write": 1

View File

@ -5,8 +5,8 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import cint, flt from frappe.utils import cint, flt
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class LeaveAllocation(Document): class LeaveAllocation(Document):
def validate(self): def validate(self):
@ -15,6 +15,8 @@ class LeaveAllocation(Document):
if not self.total_leaves_allocated: if not self.total_leaves_allocated:
self.total_leaves_allocated = self.new_leaves_allocated self.total_leaves_allocated = self.new_leaves_allocated
set_employee_name(self)
def on_update_after_submit(self): def on_update_after_submit(self):
self.validate_new_leaves_allocated_value() self.validate_new_leaves_allocated_value()

View File

@ -169,7 +169,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "Leave Application", "options": "Leave Application",
@ -182,13 +182,14 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 3, "max_attachments": 3,
"modified": "2014-05-15 19:30:47.331357", "modified": "2014-05-27 03:49:12.957706",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Application", "name": "Leave Application",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -211,6 +212,7 @@
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -219,13 +221,14 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restrict": 1,
"role": "HR User", "role": "HR User",
"set_user_permissions": 1,
"submit": 1, "submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,

View File

@ -8,6 +8,7 @@ from frappe import _
from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_url_to_form, \ from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_url_to_form, \
comma_or, get_fullname comma_or, get_fullname
from frappe import msgprint from frappe import msgprint
from erpnext.hr.utils import set_employee_name
class LeaveDayBlockedError(frappe.ValidationError): pass class LeaveDayBlockedError(frappe.ValidationError): pass
class OverlapError(frappe.ValidationError): pass class OverlapError(frappe.ValidationError): pass
@ -22,6 +23,8 @@ class LeaveApplication(Document):
else: else:
self.previous_doc = None self.previous_doc = None
set_employee_name(self)
self.validate_to_date() self.validate_to_date()
self.validate_balance_leaves() self.validate_balance_leaves()
self.validate_leave_overlap() self.validate_leave_overlap()
@ -206,7 +209,7 @@ class LeaveApplication(Document):
def notify(self, args): def notify(self, args):
args = frappe._dict(args) args = frappe._dict(args)
from frappe.core.page.messages.messages import post from frappe.core.page.messages.messages import post
post({"txt": args.message, "contact": args.message_to, "subject": args.subject, post(**{"txt": args.message, "contact": args.message_to, "subject": args.subject,
"notify": cint(self.follow_via_email)}) "notify": cint(self.follow_via_email)})
@frappe.whitelist() @frappe.whitelist()

View File

@ -5,7 +5,7 @@ import frappe
import unittest import unittest
from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError
from frappe.core.page.user_properties.user_properties import clear_restrictions from frappe.permissions import clear_user_permissions_for_doctype
test_dependencies = ["Leave Allocation", "Leave Block List"] test_dependencies = ["Leave Allocation", "Leave Block List"]
@ -91,7 +91,7 @@ class TestLeaveApplication(unittest.TestCase):
from frappe.utils.user import add_role from frappe.utils.user import add_role
add_role("test1@example.com", "HR User") add_role("test1@example.com", "HR User")
clear_restrictions("Employee") clear_user_permissions_for_doctype("Employee")
frappe.db.set_value("Department", "_Test Department", frappe.db.set_value("Department", "_Test Department",
"leave_block_list", "_Test Leave Block List") "leave_block_list", "_Test Leave Block List")

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:leave_block_list_name", "autoname": "field:leave_block_list_name",
"creation": "2013-02-18 17:43:12.000000", "creation": "2013-02-18 17:43:12",
"description": "Block Holidays on important days.", "description": "Block Holidays on important days.",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -10,6 +10,7 @@
{ {
"fieldname": "leave_block_list_name", "fieldname": "leave_block_list_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Leave Block List Name", "label": "Leave Block List Name",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
@ -17,6 +18,7 @@
{ {
"fieldname": "year", "fieldname": "year",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Year", "label": "Year",
"options": "Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
@ -25,6 +27,7 @@
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Company", "label": "Company",
"options": "Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
@ -34,6 +37,7 @@
"description": "If not checked, the list will have to be added to each Department where it has to be applied.", "description": "If not checked, the list will have to be added to each Department where it has to be applied.",
"fieldname": "applies_to_all_departments", "fieldname": "applies_to_all_departments",
"fieldtype": "Check", "fieldtype": "Check",
"in_list_view": 1,
"label": "Applies to Company", "label": "Applies to Company",
"permlevel": 0 "permlevel": 0
}, },
@ -68,13 +72,14 @@
], ],
"icon": "icon-calendar", "icon": "icon-calendar",
"idx": 1, "idx": 1,
"modified": "2013-12-20 19:24:13.000000", "modified": "2014-05-27 03:49:13.198735",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Block List", "name": "Leave Block List",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"apply_user_permissions": 1,
"create": 1, "create": 1,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -62,14 +62,14 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-05-07 06:39:38.884656", "modified": "2014-05-27 03:49:13.297832",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Type", "name": "Leave Type",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -82,7 +82,6 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@ -95,6 +94,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"role": "Employee" "role": "Employee"

View File

@ -182,7 +182,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -325,7 +325,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-09 02:17:14.634335", "modified": "2014-05-27 03:49:17.213045",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Salary Slip", "name": "Salary Slip",
@ -333,6 +333,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 0, "delete": 0,
"email": 1, "email": 1,
@ -359,9 +360,9 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"restricted": 0,
"role": "Employee" "role": "Employee"
} }
], ],

View File

@ -9,7 +9,7 @@ from frappe.model.naming import make_autoname
from frappe import msgprint, _ from frappe import msgprint, _
from erpnext.setup.utils import get_company_currency from erpnext.setup.utils import get_company_currency
from erpnext.hr.utils import set_employee_name
from erpnext.utilities.transaction_base import TransactionBase from erpnext.utilities.transaction_base import TransactionBase
@ -146,6 +146,8 @@ class SalarySlip(TransactionBase):
company_currency = get_company_currency(self.company) company_currency = get_company_currency(self.company)
self.total_in_words = money_in_words(self.rounded_total, company_currency) self.total_in_words = money_in_words(self.rounded_total, company_currency)
set_employee_name(self)
def calculate_earning_total(self): def calculate_earning_total(self):
self.gross_pay = flt(self.arrear_amount) + flt(self.leave_encashment_amount) self.gross_pay = flt(self.arrear_amount) + flt(self.leave_encashment_amount)
for d in self.get("earning_details"): for d in self.get("earning_details"):

View File

@ -227,7 +227,7 @@
], ],
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"modified": "2014-05-09 02:16:46.711184", "modified": "2014-05-27 03:49:17.438605",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Salary Structure", "name": "Salary Structure",
@ -235,6 +235,7 @@
"permissions": [ "permissions": [
{ {
"amend": 0, "amend": 0,
"apply_user_permissions": 1,
"create": 1, "create": 1,
"email": 1, "email": 1,
"permlevel": 0, "permlevel": 0,

View File

@ -9,6 +9,7 @@ from frappe.model.naming import make_autoname
from frappe import _ from frappe import _
from frappe.model.mapper import get_mapped_doc from frappe.model.mapper import get_mapped_doc
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class SalaryStructure(Document): class SalaryStructure(Document):
def autoname(self): def autoname(self):
@ -63,6 +64,7 @@ class SalaryStructure(Document):
def validate(self): def validate(self):
self.check_existing() self.check_existing()
self.validate_amount() self.validate_amount()
set_employee_name(self)
@frappe.whitelist() @frappe.whitelist()
def make_salary_slip(source_name, target_doc=None): def make_salary_slip(source_name, target_doc=None):

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-05-06 17:56:03.000000", "apply_user_permissions": 1,
"creation": "2013-05-06 17:56:03",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.045541",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Birthday", "name": "Employee Birthday",

View File

@ -1,11 +1,12 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-05-06 18:43:53", "creation": "2013-05-06 18:43:53",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", "json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
"modified": "2014-05-13 16:08:56.013856", "modified": "2014-06-03 07:18:17.059554",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Information", "name": "Employee Information",

View File

@ -1,10 +1,11 @@
{ {
"creation": "2013-02-22 15:29:34.000000", "apply_user_permissions": 1,
"creation": "2013-02-22 15:29:34",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.066168",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Leave Balance", "name": "Employee Leave Balance",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 0, "add_total_row": 0,
"creation": "2013-05-13 14:04:03.000000", "apply_user_permissions": 1,
"creation": "2013-05-13 14:04:03",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.181332",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Monthly Attendance Sheet", "name": "Monthly Attendance Sheet",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-05-07 18:09:42.000000", "apply_user_permissions": 1,
"creation": "2013-05-07 18:09:42",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-06-03 07:18:17.187018",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Monthly Salary Register", "name": "Monthly Salary Register",

View File

@ -22,3 +22,7 @@ def get_expense_approver_list():
if not roles: if not roles:
frappe.msgprint(_("No Expense Approvers. Please assign 'Expense Approver' Role to atleast one user")) frappe.msgprint(_("No Expense Approvers. Please assign 'Expense Approver' Role to atleast one user"))
return roles return roles
def set_employee_name(doc):
if doc.employee and not doc.employee_name:
doc.employee_name = frappe.db.get_value("Employee", doc.employee, "employee_name")

View File

@ -194,7 +194,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "BOM", "options": "BOM",
@ -233,7 +233,7 @@
"is_submittable": 1, "is_submittable": 1,
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"modified": "2014-05-09 02:16:39.975486", "modified": "2014-05-27 03:49:08.024523",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM", "name": "BOM",
@ -253,6 +253,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,

View File

@ -211,7 +211,7 @@
{ {
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"ignore_restrictions": 1, "ignore_user_permissions": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -224,7 +224,7 @@
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-07 05:41:33.127710", "modified": "2014-05-27 03:49:15.008942",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Production Order", "name": "Production Order",
@ -232,6 +232,7 @@
"permissions": [ "permissions": [
{ {
"amend": 1, "amend": 1,
"apply_user_permissions": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
@ -245,6 +246,7 @@
"write": 1 "write": 1
}, },
{ {
"apply_user_permissions": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,

View File

@ -132,14 +132,14 @@
], ],
"icon": "icon-wrench", "icon": "icon-wrench",
"idx": 1, "idx": 1,
"modified": "2014-05-06 12:12:33.424191", "modified": "2014-05-27 03:49:22.635046",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Workstation", "name": "Workstation",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 0, "apply_user_permissions": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-08-12 12:44:27", "creation": "2013-08-12 12:44:27",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:55.966140", "modified": "2014-06-03 07:18:16.977800",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Completed Production Orders", "name": "Completed Production Orders",

View File

@ -1,11 +1,12 @@
{ {
"add_total_row": 0, "add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2013-05-03 17:48:46", "creation": "2013-05-03 17:48:46",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.043867", "modified": "2014-06-03 07:18:17.082436",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Issued Items Against Production Order", "name": "Issued Items Against Production Order",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-08-12 12:32:30", "creation": "2013-08-12 12:32:30",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.114923", "modified": "2014-06-03 07:18:17.192207",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Open Production Orders", "name": "Open Production Orders",

View File

@ -1,10 +1,11 @@
{ {
"apply_user_permissions": 1,
"creation": "2013-08-12 12:43:47", "creation": "2013-08-12 12:43:47",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-05-13 16:08:56.132651", "modified": "2014-06-03 07:18:17.223807",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Production Orders in Progress", "name": "Production Orders in Progress",

View File

@ -1,9 +1,11 @@
execute:import unidecode # new requirement execute:import unidecode # new requirement
erpnext.patches.v4_0.validate_v3_patch erpnext.patches.v4_0.validate_v3_patch
erpnext.patches.v4_0.fix_employee_user_id
erpnext.patches.v4_0.remove_employee_role_if_no_employee
erpnext.patches.v4_0.update_user_properties erpnext.patches.v4_0.update_user_properties
erpnext.patches.v4_0.apply_user_permissions
erpnext.patches.v4_0.move_warehouse_user_to_restrictions erpnext.patches.v4_0.move_warehouse_user_to_restrictions
erpnext.patches.v4_0.new_permissions
erpnext.patches.v4_0.global_defaults_to_system_settings erpnext.patches.v4_0.global_defaults_to_system_settings
erpnext.patches.v4_0.update_incharge_name_to_sales_person_in_maintenance_schedule erpnext.patches.v4_0.update_incharge_name_to_sales_person_in_maintenance_schedule
execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29 execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29
@ -30,7 +32,6 @@ erpnext.patches.v4_0.customer_discount_to_pricing_rule
execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""") execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
erpnext.patches.v4_0.remove_module_home_pages erpnext.patches.v4_0.remove_module_home_pages
erpnext.patches.v4_0.split_email_settings erpnext.patches.v4_0.split_email_settings
erpnext.patches.v4_0.fix_employee_user_id
erpnext.patches.v4_0.import_country_codes erpnext.patches.v4_0.import_country_codes
erpnext.patches.v4_0.countrywise_coa erpnext.patches.v4_0.countrywise_coa
execute:frappe.delete_doc("DocType", "MIS Control") execute:frappe.delete_doc("DocType", "MIS Control")
@ -39,7 +40,6 @@ execute:frappe.delete_doc("DocType", "Stock Ledger")
execute:frappe.db.sql("update `tabJournal Voucher` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''") execute:frappe.db.sql("update `tabJournal Voucher` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
execute:frappe.delete_doc("DocType", "Grade") execute:frappe.delete_doc("DocType", "Grade")
erpnext.patches.v4_0.remove_india_specific_fields erpnext.patches.v4_0.remove_india_specific_fields
execute:frappe.delete_doc_if_exists("DocType", "Warehouse User")
execute:frappe.db.sql("delete from `tabWebsite Item Group` where ifnull(item_group, '')=''") execute:frappe.db.sql("delete from `tabWebsite Item Group` where ifnull(item_group, '')=''")
execute:frappe.delete_doc("Print Format", "SalesInvoice") execute:frappe.delete_doc("Print Format", "SalesInvoice")
execute:import frappe.defaults;frappe.defaults.clear_default("price_list_currency") execute:import frappe.defaults;frappe.defaults.clear_default("price_list_currency")

View File

@ -0,0 +1,49 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.hr.doctype.employee.employee import EmployeeUserDisabledError
def execute():
update_hr_permissions()
update_permissions()
remove_duplicate_user_permissions()
frappe.clear_cache()
def update_hr_permissions():
from frappe.core.page.user_permissions import user_permissions
# add set user permissions rights to HR Manager
frappe.db.sql("""update `tabDocPerm` set `set_user_permissions`=1 where parent in ('Employee', 'Leave Application')
and role='HR Manager' and permlevel=0 and `read`=1""")
# apply user permissions on Employee and Leave Application
frappe.db.sql("""update `tabDocPerm` set `apply_user_permissions`=1 where parent in ('Employee', 'Leave Application')
and role in ('Employee', 'Leave Approver') and permlevel=0 and `read`=1""")
frappe.clear_cache()
# save employees to run on_update events
for employee in frappe.db.sql_list("""select name from `tabEmployee` where docstatus < 2"""):
try:
frappe.get_doc("Employee", employee).save()
except EmployeeUserDisabledError:
pass
def update_permissions():
# clear match conditions other than owner
frappe.db.sql("""update tabDocPerm set `match`=''
where ifnull(`match`,'') not in ('', 'owner')""")
def remove_duplicate_user_permissions():
# remove duplicate user_permissions (if they exist)
for d in frappe.db.sql("""select parent, defkey, defvalue,
count(*) as cnt from tabDefaultValue
where parent not in ('__global', '__default')
group by parent, defkey, defvalue""", as_dict=1):
if d.cnt > 1:
# order by parenttype so that user permission does not get removed!
frappe.db.sql("""delete from tabDefaultValue where `parent`=%s and `defkey`=%s and
`defvalue`=%s order by parenttype limit %s""", (d.parent, d.defkey, d.defvalue, d.cnt-1))

View File

@ -3,24 +3,21 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe.utils.nestedset import get_root_of
def execute(): def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule") frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True frappe.db.auto_commit_on_many_writes = True
for d in frappe.db.sql("""select * from `tabCustomer Discount` default_item_group = get_root_of("Item Group")
where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1):
if not d.item_group:
item_group = frappe.db.sql("""select name from `tabItem Group`
where ifnull(parent_item_group, '') = ''""")[0][0]
else:
item_group = d.item_group
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
frappe.get_doc({ frappe.get_doc({
"doctype": "Pricing Rule", "doctype": "Pricing Rule",
"apply_on": "Item Group", "apply_on": "Item Group",
"item_group": item_group, "item_group": d.item_group or default_item_group,
"applicable_for": "Customer", "applicable_for": "Customer",
"customer": d.parent, "customer": d.parent,
"price_or_discount": "Discount Percentage", "price_or_discount": "Discount Percentage",

View File

@ -1,3 +1,8 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import get_fullname from frappe.utils import get_fullname
@ -8,6 +13,11 @@ def execute():
fullname = get_fullname(user_id) fullname = get_fullname(user_id)
employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id}) employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
if employee: if employee:
frappe.db.sql("""update `tabEmployee` set user_id=null frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s and name!=%s""", (user_id, employee)) where user_id=%s and name!=%s""", (user_id, employee))
else:
count = frappe.db.sql("""select count(*) from `tabEmployee` where user_id=%s""", user_id)[0][0]
frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s limit %s""", (user_id, count - 1))

View File

@ -3,11 +3,11 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
import frappe.permissions
def execute(): def execute():
from frappe.core.page.user_properties import user_properties
for warehouse, user in frappe.db.sql("""select parent, user from `tabWarehouse User`"""): for warehouse, user in frappe.db.sql("""select parent, user from `tabWarehouse User`"""):
user_properties.add(user, "Warehouse", warehouse) frappe.permissions.add_user_permission("Warehouse", warehouse, user)
frappe.delete_doc("DocType", "Warehouse User") frappe.delete_doc_if_exists("DocType", "Warehouse User")
frappe.reload_doc("stock", "doctype", "warehouse") frappe.reload_doc("stock", "doctype", "warehouse")

View File

@ -1,24 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# reset Page perms
from frappe.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 frappe.db.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:
frappe.db.sql("""update `tabDocPerm` set `print`=1
where permlevel=0 and `read`=1 and parent=%s""", doctype)
if not hide_email:
frappe.db.sql("""update `tabDocPerm` set `email`=1
where permlevel=0 and `read`=1 and parent=%s""", doctype)

View File

@ -0,0 +1,18 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.permissions
def execute():
for user in frappe.db.sql_list("select distinct parent from `tabUserRole` where role='Employee'"):
# if employee record does not exists, remove employee role!
if not frappe.db.get_value("Employee", {"user_id": user}):
try:
user = frappe.get_doc("User", user)
for role in user.get("user_roles", {"role": "Employee"}):
user.get("user_roles").remove(role)
user.save()
except frappe.DoesNotExistError:
pass

View File

@ -11,7 +11,8 @@ def execute():
email_settings = get_email_settings() email_settings = get_email_settings()
map_outgoing_email_settings(email_settings) map_outgoing_email_settings(email_settings)
map_support_email_settings(email_settings) map_support_email_settings(email_settings)
frappe.delete_doc("Doctype", "Email Settings")
frappe.delete_doc("DocType", "Email Settings")
def map_outgoing_email_settings(email_settings): def map_outgoing_email_settings(email_settings):
outgoing_email_settings = frappe.get_doc("Outgoing Email Settings") outgoing_email_settings = frappe.get_doc("Outgoing Email Settings")

Some files were not shown because too many files have changed in this diff Show More