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

@ -1,332 +1,331 @@
{
"allow_copy": 1,
"allow_import": 1,
"allow_rename": 1,
"creation": "2013-01-30 12:49:46",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"allow_copy": 1,
"allow_import": 1,
"allow_rename": 1,
"creation": "2013-01-30 12:49:46",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"fields": [
{
"fieldname": "properties",
"fieldtype": "Section Break",
"in_list_view": 0,
"label": "Account Details",
"oldfieldtype": "Section Break",
"fieldname": "properties",
"fieldtype": "Section Break",
"in_list_view": 0,
"label": "Account Details",
"oldfieldtype": "Section Break",
"permlevel": 0
},
},
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"in_list_view": 0,
"permlevel": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"in_list_view": 0,
"permlevel": 0,
"width": "50%"
},
},
{
"fieldname": "account_name",
"fieldtype": "Data",
"in_filter": 1,
"in_list_view": 1,
"label": "Account Name",
"no_copy": 1,
"oldfieldname": "account_name",
"oldfieldtype": "Data",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"fieldname": "account_name",
"fieldtype": "Data",
"in_filter": 1,
"in_list_view": 1,
"label": "Account Name",
"no_copy": 1,
"oldfieldname": "account_name",
"oldfieldtype": "Data",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"search_index": 1
},
},
{
"default": "Ledger",
"fieldname": "group_or_ledger",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Group or Ledger",
"oldfieldname": "group_or_ledger",
"oldfieldtype": "Select",
"options": "\nLedger\nGroup",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"default": "Ledger",
"fieldname": "group_or_ledger",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Group or Ledger",
"oldfieldname": "group_or_ledger",
"oldfieldtype": "Select",
"options": "\nLedger\nGroup",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"search_index": 1
},
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"read_only": 1,
"reqd": 1,
"search_index": 1
},
},
{
"fieldname": "column_break1",
"fieldtype": "Column Break",
"permlevel": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"permlevel": 0,
"width": "50%"
},
},
{
"fieldname": "parent_account",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Parent Account",
"oldfieldname": "parent_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"reqd": 1,
"fieldname": "parent_account",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Parent Account",
"oldfieldname": "parent_account",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"reqd": 1,
"search_index": 1
},
},
{
"description": "Setting Account Type helps in selecting this Account in transactions.",
"fieldname": "account_type",
"fieldtype": "Select",
"in_filter": 1,
"label": "Account Type",
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment",
"permlevel": 0,
"description": "Setting Account Type helps in selecting this Account in transactions.",
"fieldname": "account_type",
"fieldtype": "Select",
"in_filter": 1,
"label": "Account Type",
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment",
"permlevel": 0,
"search_index": 0
},
},
{
"description": "Rate at which this tax is applied",
"fieldname": "tax_rate",
"fieldtype": "Float",
"hidden": 0,
"label": "Rate",
"oldfieldname": "tax_rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"description": "Rate at which this tax is applied",
"fieldname": "tax_rate",
"fieldtype": "Float",
"hidden": 0,
"label": "Rate",
"oldfieldname": "tax_rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"reqd": 0
},
},
{
"description": "If the account is frozen, entries are allowed to restricted users.",
"fieldname": "freeze_account",
"fieldtype": "Select",
"label": "Frozen",
"oldfieldname": "freeze_account",
"oldfieldtype": "Select",
"options": "No\nYes",
"description": "If the account is frozen, entries are allowed to restricted users.",
"fieldname": "freeze_account",
"fieldtype": "Select",
"label": "Frozen",
"oldfieldname": "freeze_account",
"oldfieldtype": "Select",
"options": "No\nYes",
"permlevel": 0
},
},
{
"fieldname": "credit_days",
"fieldtype": "Int",
"hidden": 1,
"label": "Credit Days",
"oldfieldname": "credit_days",
"oldfieldtype": "Int",
"permlevel": 0,
"fieldname": "credit_days",
"fieldtype": "Int",
"hidden": 1,
"label": "Credit Days",
"oldfieldname": "credit_days",
"oldfieldtype": "Int",
"permlevel": 0,
"print_hide": 1
},
},
{
"fieldname": "credit_limit",
"fieldtype": "Currency",
"hidden": 1,
"label": "Credit Limit",
"oldfieldname": "credit_limit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"fieldname": "credit_limit",
"fieldtype": "Currency",
"hidden": 1,
"label": "Credit Limit",
"oldfieldname": "credit_limit",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 1
},
},
{
"description": "If this Account represents a Customer, Supplier or Employee, set it here.",
"fieldname": "master_type",
"fieldtype": "Select",
"label": "Master Type",
"oldfieldname": "master_type",
"oldfieldtype": "Select",
"options": "\nSupplier\nCustomer\nEmployee",
"description": "If this Account represents a Customer, Supplier or Employee, set it here.",
"fieldname": "master_type",
"fieldtype": "Select",
"label": "Master Type",
"oldfieldname": "master_type",
"oldfieldtype": "Select",
"options": "\nSupplier\nCustomer\nEmployee",
"permlevel": 0
},
},
{
"fieldname": "master_name",
"fieldtype": "Link",
"label": "Master Name",
"oldfieldname": "master_name",
"oldfieldtype": "Link",
"options": "[Select]",
"fieldname": "master_name",
"fieldtype": "Link",
"label": "Master Name",
"oldfieldname": "master_name",
"oldfieldtype": "Link",
"options": "[Select]",
"permlevel": 0
},
},
{
"fieldname": "balance_must_be",
"fieldtype": "Select",
"label": "Balance must be",
"options": "\nDebit\nCredit",
"fieldname": "balance_must_be",
"fieldtype": "Select",
"label": "Balance must be",
"options": "\nDebit\nCredit",
"permlevel": 0
},
},
{
"fieldname": "root_type",
"fieldtype": "Select",
"label": "Root Type",
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
"permlevel": 0,
"fieldname": "root_type",
"fieldtype": "Select",
"label": "Root Type",
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
"permlevel": 0,
"read_only": 1
},
},
{
"fieldname": "report_type",
"fieldtype": "Select",
"label": "Report Type",
"options": "\nBalance Sheet\nProfit and Loss",
"permlevel": 0,
"fieldname": "report_type",
"fieldtype": "Select",
"label": "Report Type",
"options": "\nBalance Sheet\nProfit and Loss",
"permlevel": 0,
"read_only": 1
},
},
{
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
"label": "Lft",
"permlevel": 0,
"print_hide": 1,
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
"label": "Lft",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
},
},
{
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
"label": "Rgt",
"permlevel": 0,
"print_hide": 1,
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
"label": "Rgt",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
},
},
{
"fieldname": "old_parent",
"fieldtype": "Data",
"hidden": 1,
"label": "Old Parent",
"permlevel": 0,
"print_hide": 1,
"fieldname": "old_parent",
"fieldtype": "Data",
"hidden": 1,
"label": "Old Parent",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
}
],
"icon": "icon-money",
"idx": 1,
"in_create": 1,
"modified": "2014-06-03 18:27:58.109303",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
"owner": "Administrator",
],
"icon": "icon-money",
"idx": 1,
"in_create": 1,
"modified": "2014-06-03 18:27:58.109303",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0,
"amend": 0,
"apply_user_permissions": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Auditor",
"submit": 0,
"amend": 0,
"apply_user_permissions": 1,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Auditor",
"submit": 0,
"write": 0
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales User",
"submit": 0,
"amend": 0,
"apply_user_permissions": 1,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales User",
"submit": 0,
"write": 0
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase User",
"submit": 0,
"amend": 0,
"apply_user_permissions": 1,
"create": 0,
"delete": 0,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase User",
"submit": 0,
"write": 0
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Auditor",
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Auditor",
"submit": 0,
"write": 0
},
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"restrict": 1,
"role": "Accounts Manager",
"submit": 0,
"amend": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 1,
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0,
"write": 0
}
],
],
"search_fields": "group_or_ledger"
}
}

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
{
"allow_import": 1,
"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**.",
"docstatus": 0,
"doctype": "DocType",
@ -11,6 +11,7 @@
"description": "For e.g. 2012, 2012-13",
"fieldname": "year",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Year Name",
"oldfieldname": "year",
"oldfieldtype": "Data",
@ -20,6 +21,7 @@
{
"fieldname": "year_start_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Year Start Date",
"no_copy": 1,
"oldfieldname": "year_start_date",
@ -30,6 +32,7 @@
{
"fieldname": "year_end_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Year End Date",
"no_copy": 1,
"permlevel": 0,
@ -40,6 +43,7 @@
"description": "Entries are not allowed against this Fiscal Year if the year is closed.",
"fieldname": "is_fiscal_year_closed",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Year Closed",
"no_copy": 1,
"oldfieldname": "is_fiscal_year_closed",
@ -51,14 +55,13 @@
],
"icon": "icon-calendar",
"idx": 1,
"modified": "2014-01-20 17:48:46.000000",
"modified": "2014-05-27 03:49:10.942338",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
"owner": "Administrator",
"permissions": [
{
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@ -71,6 +74,7 @@
"write": 1
},
{
"apply_user_permissions": 1,
"delete": 0,
"email": 1,
"permlevel": 0,

View File

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

View File

@ -426,7 +426,7 @@
{
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@ -440,7 +440,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-09 02:16:47.686703",
"modified": "2014-05-27 03:49:12.326026",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Voucher",
@ -448,6 +448,7 @@
"permissions": [
{
"amend": 1,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,
@ -476,6 +477,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 0,
"create": 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.",
"fieldname": "default_account",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"in_list_view": 1,
"label": "Default Account",
"options": "Account",
@ -41,7 +41,7 @@
],
"icon": "icon-credit-card",
"idx": 1,
"modified": "2014-05-07 05:06:13.702313",
"modified": "2014-05-27 03:49:13.846602",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Mode of Payment",
@ -59,6 +59,7 @@
"write": 1
},
{
"apply_user_permissions": 1,
"permlevel": 0,
"read": 1,
"report": 1,

View File

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

View File

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

View File

@ -1,288 +1,288 @@
{
"allow_import": 1,
"autoname": "PRULE.#####",
"creation": "2014-02-21 15:02:51",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"allow_import": 1,
"autoname": "PRULE.#####",
"creation": "2014-02-21 15:02:51",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Master",
"fields": [
{
"fieldname": "applicability_section",
"fieldtype": "Section Break",
"in_list_view": 0,
"label": "Applicability",
"fieldname": "applicability_section",
"fieldtype": "Section Break",
"in_list_view": 0,
"label": "Applicability",
"permlevel": 0
},
},
{
"default": "Item Code",
"fieldname": "apply_on",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Apply On",
"options": "\nItem Code\nItem Group\nBrand",
"permlevel": 0,
"default": "Item Code",
"fieldname": "apply_on",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Apply On",
"options": "\nItem Code\nItem Group\nBrand",
"permlevel": 0,
"reqd": 1
},
},
{
"depends_on": "eval:doc.apply_on==\"Item Code\"",
"fieldname": "item_code",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Code",
"options": "Item",
"permlevel": 0,
"depends_on": "eval:doc.apply_on==\"Item Code\"",
"fieldname": "item_code",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Code",
"options": "Item",
"permlevel": 0,
"reqd": 0
},
},
{
"depends_on": "eval:doc.apply_on==\"Item Group\"",
"fieldname": "item_group",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Group",
"options": "Item Group",
"depends_on": "eval:doc.apply_on==\"Item Group\"",
"fieldname": "item_group",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Group",
"options": "Item Group",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.apply_on==\"Brand\"",
"fieldname": "brand",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Brand",
"options": "Brand",
"depends_on": "eval:doc.apply_on==\"Brand\"",
"fieldname": "brand",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Brand",
"options": "Brand",
"permlevel": 0
},
},
{
"fieldname": "applicable_for",
"fieldtype": "Select",
"label": "Applicable For",
"options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type",
"fieldname": "applicable_for",
"fieldtype": "Select",
"label": "Applicable For",
"options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Customer\"",
"fieldname": "customer",
"fieldtype": "Link",
"label": "Customer",
"options": "Customer",
"depends_on": "eval:doc.applicable_for==\"Customer\"",
"fieldname": "customer",
"fieldtype": "Link",
"label": "Customer",
"options": "Customer",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Customer Group\"",
"fieldname": "customer_group",
"fieldtype": "Link",
"label": "Customer Group",
"options": "Customer Group",
"depends_on": "eval:doc.applicable_for==\"Customer Group\"",
"fieldname": "customer_group",
"fieldtype": "Link",
"label": "Customer Group",
"options": "Customer Group",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Territory\"",
"fieldname": "territory",
"fieldtype": "Link",
"label": "Territory",
"options": "Territory",
"depends_on": "eval:doc.applicable_for==\"Territory\"",
"fieldname": "territory",
"fieldtype": "Link",
"label": "Territory",
"options": "Territory",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
"fieldname": "sales_partner",
"fieldtype": "Link",
"label": "Sales Partner",
"options": "Sales Partner",
"depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
"fieldname": "sales_partner",
"fieldtype": "Link",
"label": "Sales Partner",
"options": "Sales Partner",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Campaign\"",
"fieldname": "campaign",
"fieldtype": "Link",
"label": "Campaign",
"options": "Campaign",
"depends_on": "eval:doc.applicable_for==\"Campaign\"",
"fieldname": "campaign",
"fieldtype": "Link",
"label": "Campaign",
"options": "Campaign",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Supplier\"",
"fieldname": "supplier",
"fieldtype": "Link",
"label": "Supplier",
"options": "Supplier",
"depends_on": "eval:doc.applicable_for==\"Supplier\"",
"fieldname": "supplier",
"fieldtype": "Link",
"label": "Supplier",
"options": "Supplier",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
"label": "Supplier Type",
"options": "Supplier Type",
"depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
"label": "Supplier Type",
"options": "Supplier Type",
"permlevel": 0
},
},
{
"fieldname": "min_qty",
"fieldtype": "Float",
"label": "Min Qty",
"fieldname": "min_qty",
"fieldtype": "Float",
"label": "Min Qty",
"permlevel": 0
},
},
{
"fieldname": "max_qty",
"fieldtype": "Float",
"label": "Max Qty",
"fieldname": "max_qty",
"fieldtype": "Float",
"label": "Max Qty",
"permlevel": 0
},
},
{
"fieldname": "col_break1",
"fieldtype": "Column Break",
"fieldname": "col_break1",
"fieldtype": "Column Break",
"permlevel": 0
},
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"permlevel": 0
},
},
{
"default": "Today",
"fieldname": "valid_from",
"fieldtype": "Date",
"label": "Valid From",
"default": "Today",
"fieldname": "valid_from",
"fieldtype": "Date",
"label": "Valid From",
"permlevel": 0
},
},
{
"fieldname": "valid_upto",
"fieldtype": "Date",
"label": "Valid Upto",
"fieldname": "valid_upto",
"fieldtype": "Date",
"label": "Valid Upto",
"permlevel": 0
},
},
{
"fieldname": "priority",
"fieldtype": "Select",
"label": "Priority",
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
"fieldname": "priority",
"fieldtype": "Select",
"label": "Priority",
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
"permlevel": 0
},
},
{
"fieldname": "disable",
"fieldtype": "Check",
"label": "Disable",
"fieldname": "disable",
"fieldtype": "Check",
"label": "Disable",
"permlevel": 0
},
},
{
"fieldname": "price_discount_section",
"fieldtype": "Section Break",
"label": "Price / Discount",
"fieldname": "price_discount_section",
"fieldtype": "Section Break",
"label": "Price / Discount",
"permlevel": 0
},
},
{
"default": "Discount Percentage",
"fieldname": "price_or_discount",
"fieldtype": "Select",
"label": "Price or Discount",
"options": "\nPrice\nDiscount Percentage",
"permlevel": 0,
"default": "Discount Percentage",
"fieldname": "price_or_discount",
"fieldtype": "Select",
"label": "Price or Discount",
"options": "\nPrice\nDiscount Percentage",
"permlevel": 0,
"reqd": 1
},
},
{
"fieldname": "col_break2",
"fieldtype": "Column Break",
"fieldname": "col_break2",
"fieldtype": "Column Break",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.price_or_discount==\"Price\"",
"fieldname": "price",
"fieldtype": "Float",
"label": "Price",
"depends_on": "eval:doc.price_or_discount==\"Price\"",
"fieldname": "price",
"fieldtype": "Float",
"label": "Price",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "discount_percentage",
"fieldtype": "Float",
"label": "Discount Percentage",
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "discount_percentage",
"fieldtype": "Float",
"label": "Discount Percentage",
"permlevel": 0
},
},
{
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "for_price_list",
"fieldtype": "Link",
"label": "For Price List",
"options": "Price List",
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "for_price_list",
"fieldtype": "Link",
"label": "For Price List",
"options": "Price List",
"permlevel": 0
},
},
{
"fieldname": "help_section",
"fieldtype": "Section Break",
"label": "",
"options": "Simple",
"fieldname": "help_section",
"fieldtype": "Section Break",
"label": "",
"options": "Simple",
"permlevel": 0
},
},
{
"fieldname": "pricing_rule_help",
"fieldtype": "HTML",
"label": "Pricing Rule Help",
"fieldname": "pricing_rule_help",
"fieldtype": "HTML",
"label": "Pricing Rule Help",
"permlevel": 0
}
],
"icon": "icon-gift",
"idx": 1,
"istable": 0,
"modified": "2014-05-28 15:36:29.403659",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
"owner": "Administrator",
],
"icon": "icon-gift",
"idx": 1,
"istable": 0,
"modified": "2014-05-28 15:36:29.403659",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"export": 0,
"import": 0,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"create": 1,
"delete": 1,
"export": 0,
"import": 0,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"write": 1
},
},
{
"create": 1,
"delete": 1,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Sales Manager",
"create": 1,
"delete": 1,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Sales Manager",
"write": 1
},
},
{
"create": 1,
"delete": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Purchase Manager",
"create": 1,
"delete": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Purchase Manager",
"write": 1
},
},
{
"create": 1,
"delete": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Website Manager",
"create": 1,
"delete": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Website Manager",
"write": 1
},
},
{
"create": 1,
"delete": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"restrict": 1,
"role": "System Manager",
"create": 1,
"delete": 1,
"export": 1,
"import": 1,
"permlevel": 0,
"read": 1,
"report": 1,
"set_user_permissions": 1,
"role": "System Manager",
"write": 1
}
],
"sort_field": "modified",
],
"sort_field": "modified",
"sort_order": "DESC"
}
}

View File

@ -146,7 +146,7 @@
{
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@ -744,16 +744,17 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-09 02:16:52.618986",
"modified": "2014-06-04 08:45:25.582170",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 0,
"amend": 1,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 0,
"email": 1,
"permlevel": 0,
@ -761,11 +762,12 @@
"read": 1,
"report": 1,
"role": "Accounts User",
"submit": 0,
"write": 0
"submit": 1,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
@ -780,6 +782,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
@ -808,6 +811,7 @@
},
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 0,
"create": 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.######",
"change_log": null,
"client_script": null,
"client_script_core": null,
"client_string": null,
"colour": null,
"creation": "2013-05-21 16:16:04",
"custom": null,
"default_print_format": null,
"description": null,
"docstatus": 0,
"doctype": "DocType",
"document_type": null,
"dt_template": null,
"fields": [
{
"allow_on_submit": null,
"default": "Valuation and Total",
"depends_on": null,
"description": null,
"fieldname": "category",
"fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0,
"label": "Consider Tax or Charge for",
"no_column": null,
"no_copy": null,
"oldfieldname": "category",
"oldfieldtype": "Select",
"options": "Valuation and Total\nValuation\nTotal",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": "Add",
"depends_on": null,
"description": null,
"fieldname": "add_deduct_tax",
"fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Add or Deduct",
"no_column": null,
"no_copy": null,
"oldfieldname": "add_deduct_tax",
"oldfieldtype": "Select",
"options": "Add\nDeduct",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "charge_type",
"fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Type",
"no_column": null,
"no_copy": null,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"description": null,
"fieldname": "row_id",
"fieldtype": "Data",
"hidden": 0,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Reference Row #",
"no_column": null,
"no_copy": null,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "description",
"fieldtype": "Small Text",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Description",
"no_column": null,
"no_copy": null,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": "300px",
"read_only": 0,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "300px"
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "col_break1",
"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,
"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
"permlevel": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "account_head",
"fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0,
"label": "Account Head",
"no_column": null,
"no_copy": null,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": ":Company",
"depends_on": null,
"description": null,
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0,
"label": "Cost Center",
"no_column": null,
"no_copy": null,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "rate",
"fieldtype": "Float",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Rate",
"no_column": null,
"no_copy": null,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount",
"fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Total",
"no_column": null,
"no_copy": null,
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "item_wise_tax_detail",
"fieldtype": "Small Text",
"hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Item Wise Tax Detail ",
"no_column": null,
"no_copy": null,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"options": null,
"permlevel": 0,
"print_hide": 1,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "parenttype",
"fieldtype": "Data",
"hidden": 1,
"ignore_restrictions": null,
"in_filter": 1,
"in_list_view": null,
"label": "Parenttype",
"no_column": null,
"no_copy": null,
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
"options": null,
"permlevel": 0,
"print_hide": 1,
"print_width": null,
"read_only": 0,
"report_hide": null,
"reqd": null,
"search_index": 0,
"set_only_once": null,
"trigger": null,
"width": null
"search_index": 0
}
],
"hide_heading": 1,
"hide_toolbar": null,
"icon": null,
"idx": 1,
"in_create": null,
"in_dialog": null,
"is_submittable": null,
"is_transaction_doc": null,
"issingle": null,
"istable": 1,
"max_attachments": null,
"menu_index": null,
"modified": "2014-04-15 09:48:45.892548",
"modified": "2014-05-30 03:43:32.494112",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",
"name_case": null,
"owner": "Administrator",
"parent": null,
"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
"permissions": []
}

View File

@ -106,7 +106,7 @@
{
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@ -1180,7 +1180,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-09 02:17:00.217556",
"modified": "2014-05-27 03:49:17.806077",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@ -1202,6 +1202,7 @@
},
{
"amend": 1,
"apply_user_permissions": 1,
"cancel": 0,
"create": 1,
"delete": 0,
@ -1215,6 +1216,7 @@
"write": 1
},
{
"apply_user_permissions": 1,
"cancel": 0,
"delete": 0,
"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.######",
"change_log": null,
"client_script": null,
"client_script_core": null,
"client_string": null,
"colour": null,
"creation": "2013-04-24 11:39:32",
"custom": null,
"default_print_format": null,
"description": null,
"docstatus": 0,
"doctype": "DocType",
"document_type": null,
"dt_template": null,
"fields": [
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "charge_type",
"fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Type",
"no_column": null,
"no_copy": null,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"description": null,
"fieldname": "row_id",
"fieldtype": "Data",
"hidden": 0,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Reference Row #",
"no_column": null,
"no_copy": null,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
"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
"permlevel": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "description",
"fieldtype": "Small Text",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Description",
"no_column": null,
"no_copy": null,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": "300px",
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "300px"
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "col_break_1",
"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,
"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%"
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "account_head",
"fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0,
"label": "Account Head",
"no_column": null,
"no_copy": null,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": 1,
"set_only_once": null,
"trigger": null,
"width": null
"search_index": 1
},
{
"allow_on_submit": null,
"default": ":Company",
"depends_on": null,
"description": null,
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 0,
"label": "Cost Center",
"no_column": null,
"no_copy": null,
"oldfieldname": "cost_center_other_charges",
"oldfieldtype": "Link",
"options": "Cost Center",
"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
"permlevel": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "rate",
"fieldtype": "Float",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Rate",
"no_column": null,
"no_copy": null,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount",
"fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1,
"label": "Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": 0,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"reqd": 0
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Total",
"no_column": null,
"no_copy": null,
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 1
},
{
"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",
"fieldname": "included_in_print_rate",
"fieldtype": "Check",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Is this Tax included in Basic Rate?",
"no_column": null,
"no_copy": 0,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0,
"print_hide": 1,
"print_width": "150px",
"read_only": null,
"report_hide": 1,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": "150px"
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "tax_amount_after_discount_amount",
"fieldtype": "Currency",
"hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Tax Amount After Discount Amount",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "item_wise_tax_detail",
"fieldtype": "Small Text",
"hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Item Wise Tax Detail",
"no_column": null,
"no_copy": null,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"options": null,
"permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
"read_only": 1
},
{
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "parenttype",
"fieldtype": "Data",
"hidden": 1,
"ignore_restrictions": null,
"in_filter": 1,
"in_list_view": null,
"label": "Parenttype",
"no_column": null,
"no_copy": null,
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
"options": null,
"permlevel": 0,
"print_hide": 1,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": 1,
"set_only_once": null,
"trigger": null,
"width": null
"search_index": 1
}
],
"hide_heading": 1,
"hide_toolbar": null,
"icon": null,
"idx": 1,
"in_create": null,
"in_dialog": null,
"is_submittable": null,
"is_transaction_doc": null,
"issingle": null,
"istable": 1,
"max_attachments": null,
"menu_index": null,
"modified": "2014-04-14 18:40:48.450796",
"modified": "2014-05-30 03:43:39.740638",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",
"name_case": null,
"owner": "Administrator",
"parent": null,
"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
"permissions": []
}

View File

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

View File

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

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.defaults import get_restrictions
from frappe.defaults import get_user_permissions
from frappe.utils import add_days
from erpnext.utilities.doctype.address.address import get_address_display
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):
# price list
price_list = get_restrictions().get("Price List")
price_list = filter(None, get_user_permissions().get("Price 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:
price_list = party.default_price_list

View File

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

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:16.907658",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:16.921522",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Clearance Summary",

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:16.926502",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:16.971175",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:16.993419",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Customer Account Head",

View File

@ -1,10 +1,11 @@
{
"apply_user_permissions": 1,
"creation": "2013-07-30 17:28:49",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-05-13 16:08:56.009640",
"modified": "2014-06-03 07:18:17.034953",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.072046",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.077022",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Gross Profit",

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.113416",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Item-wise Purchase Register",

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.123848",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Item-wise Sales Register",

View File

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

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.207997",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.239496",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Trends",

View File

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

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.265444",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Register",

View File

@ -1,10 +1,11 @@
{
"apply_user_permissions": 1,
"creation": "2013-07-30 18:35:10",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-05-13 16:08:56.176404",
"modified": "2014-06-03 07:18:17.275594",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.291463",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Trends",

View File

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

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.317451",
"modified_by": "Administrator",
"module": "Accounts",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.353489",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Supplier Account Head",

View File

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

View File

@ -1,231 +1,231 @@
{
"autoname": "naming_series:",
"creation": "2013-04-30 13:13:03",
"docstatus": 0,
"doctype": "DocType",
"autoname": "naming_series:",
"creation": "2013-04-30 13:13:03",
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"fieldname": "qa_inspection",
"fieldtype": "Section Break",
"label": "QA Inspection",
"no_copy": 0,
"oldfieldtype": "Section Break",
"fieldname": "qa_inspection",
"fieldtype": "Section Break",
"label": "QA Inspection",
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0
},
},
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"width": "50%"
},
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"no_copy": 1,
"options": "QI-",
"permlevel": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"no_copy": 1,
"options": "QI-",
"permlevel": 0,
"reqd": 1
},
},
{
"fieldname": "inspection_type",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Inspection Type",
"oldfieldname": "inspection_type",
"oldfieldtype": "Select",
"options": "\nIncoming\nOutgoing\nIn Process",
"permlevel": 0,
"fieldname": "inspection_type",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Inspection Type",
"oldfieldname": "inspection_type",
"oldfieldtype": "Select",
"options": "\nIncoming\nOutgoing\nIn Process",
"permlevel": 0,
"reqd": 1
},
},
{
"fieldname": "report_date",
"fieldtype": "Date",
"in_filter": 1,
"in_list_view": 1,
"label": "Report Date",
"oldfieldname": "report_date",
"oldfieldtype": "Date",
"permlevel": 0,
"reqd": 1,
"fieldname": "report_date",
"fieldtype": "Date",
"in_filter": 1,
"in_list_view": 1,
"label": "Report Date",
"oldfieldname": "report_date",
"oldfieldtype": "Date",
"permlevel": 0,
"reqd": 1,
"search_index": 1
},
},
{
"fieldname": "item_code",
"fieldtype": "Link",
"hidden": 0,
"in_list_view": 1,
"in_filter": 1,
"label": "Item Code",
"oldfieldname": "item_code",
"oldfieldtype": "Link",
"options": "Item",
"permlevel": 0,
"reqd": 1,
"fieldname": "item_code",
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Item Code",
"oldfieldname": "item_code",
"oldfieldtype": "Link",
"options": "Item",
"permlevel": 0,
"reqd": 1,
"search_index": 1
},
},
{
"fieldname": "sample_size",
"fieldtype": "Float",
"in_filter": 0,
"label": "Sample Size",
"oldfieldname": "sample_size",
"oldfieldtype": "Currency",
"permlevel": 0,
"reqd": 1,
"fieldname": "sample_size",
"fieldtype": "Float",
"in_filter": 0,
"label": "Sample Size",
"oldfieldname": "sample_size",
"oldfieldtype": "Currency",
"permlevel": 0,
"reqd": 1,
"search_index": 0
},
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"in_filter": 1,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"search_index": 0,
"fieldname": "description",
"fieldtype": "Small Text",
"in_filter": 1,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"search_index": 0,
"width": "300px"
},
},
{
"fieldname": "column_break1",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
"permlevel": 0,
"width": "50%"
},
},
{
"fieldname": "item_serial_no",
"fieldtype": "Link",
"hidden": 0,
"label": "Item Serial No",
"oldfieldname": "item_serial_no",
"oldfieldtype": "Link",
"options": "Serial No",
"permlevel": 0,
"fieldname": "item_serial_no",
"fieldtype": "Link",
"hidden": 0,
"label": "Item Serial No",
"oldfieldname": "item_serial_no",
"oldfieldtype": "Link",
"options": "Serial No",
"permlevel": 0,
"print_hide": 0
},
},
{
"fieldname": "batch_no",
"fieldtype": "Link",
"label": "Batch No",
"oldfieldname": "batch_no",
"oldfieldtype": "Link",
"options": "Batch",
"fieldname": "batch_no",
"fieldtype": "Link",
"label": "Batch No",
"oldfieldname": "batch_no",
"oldfieldtype": "Link",
"options": "Batch",
"permlevel": 0
},
},
{
"fieldname": "purchase_receipt_no",
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"label": "Purchase Receipt No",
"oldfieldname": "purchase_receipt_no",
"oldfieldtype": "Link",
"options": "Purchase Receipt",
"permlevel": 0,
"fieldname": "purchase_receipt_no",
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"label": "Purchase Receipt No",
"oldfieldname": "purchase_receipt_no",
"oldfieldtype": "Link",
"options": "Purchase Receipt",
"permlevel": 0,
"search_index": 1
},
},
{
"fieldname": "delivery_note_no",
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"label": "Delivery Note No",
"oldfieldname": "delivery_note_no",
"oldfieldtype": "Link",
"options": "Delivery Note",
"permlevel": 0,
"print_hide": 0,
"fieldname": "delivery_note_no",
"fieldtype": "Link",
"hidden": 0,
"in_filter": 1,
"label": "Delivery Note No",
"oldfieldname": "delivery_note_no",
"oldfieldtype": "Link",
"options": "Delivery Note",
"permlevel": 0,
"print_hide": 0,
"search_index": 1
},
},
{
"fieldname": "inspected_by",
"fieldtype": "Data",
"label": "Inspected By",
"oldfieldname": "inspected_by",
"oldfieldtype": "Data",
"permlevel": 0,
"fieldname": "inspected_by",
"fieldtype": "Data",
"label": "Inspected By",
"oldfieldname": "inspected_by",
"oldfieldtype": "Data",
"permlevel": 0,
"reqd": 1
},
},
{
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks",
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Text",
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks",
"no_copy": 1,
"oldfieldname": "remarks",
"oldfieldtype": "Text",
"permlevel": 0
},
},
{
"fieldname": "verified_by",
"fieldtype": "Data",
"label": "Verified By",
"oldfieldname": "verified_by",
"oldfieldtype": "Data",
"fieldname": "verified_by",
"fieldtype": "Data",
"label": "Verified By",
"oldfieldname": "verified_by",
"oldfieldtype": "Data",
"permlevel": 0
},
},
{
"fieldname": "amended_from",
"fieldtype": "Data",
"ignore_restrictions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"fieldname": "amended_from",
"fieldtype": "Data",
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
},
},
{
"fieldname": "specification_details",
"fieldtype": "Section Break",
"label": "Specification Details",
"oldfieldtype": "Section Break",
"options": "Simple",
"fieldname": "specification_details",
"fieldtype": "Section Break",
"label": "Specification Details",
"oldfieldtype": "Section Break",
"options": "Simple",
"permlevel": 0
},
},
{
"fieldname": "get_specification_details",
"fieldtype": "Button",
"label": "Get Specification Details",
"options": "get_item_specification_details",
"fieldname": "get_specification_details",
"fieldtype": "Button",
"label": "Get Specification Details",
"options": "get_item_specification_details",
"permlevel": 0
},
},
{
"fieldname": "qa_specification_details",
"fieldtype": "Table",
"label": "Quality Inspection Readings",
"oldfieldname": "qa_specification_details",
"oldfieldtype": "Table",
"options": "Quality Inspection Reading",
"fieldname": "qa_specification_details",
"fieldtype": "Table",
"label": "Quality Inspection Readings",
"oldfieldname": "qa_specification_details",
"oldfieldtype": "Table",
"options": "Quality Inspection Reading",
"permlevel": 0
}
],
"icon": "icon-search",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-06 08:20:33.015328",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection",
"owner": "Administrator",
],
"icon": "icon-search",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-26 03:05:52.140251",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Quality Manager",
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Quality Manager",
"submit": 1,
"write": 1
}
],
],
"search_fields": "item_code, report_date, purchase_receipt_no, delivery_note_no"
}
}

View File

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

View File

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

View File

@ -1,11 +1,12 @@
{
"add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-03 14:55:53",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-05-13 16:08:56.060149",
"modified": "2014-06-03 07:18:17.103261",
"modified_by": "Administrator",
"module": "Buying",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.255067",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Trends",

View File

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

View File

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

View File

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

View File

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

View File

@ -16,21 +16,23 @@ def on_doctype_update():
frappe.db.sql("""alter table `tabFeed`
add index feed_doctype_docname_index(doc_type, doc_name)""")
def get_permission_query_conditions():
restrictions = frappe.defaults.get_restrictions()
can_read = frappe.user.get_can_read()
def get_permission_query_conditions(user):
if not user: user = frappe.session.user
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
list(set(can_read) - set(restrictions.keys()))]
list(set(can_read) - set(user_permissions.keys()))]
if not can_read_doctypes:
return ""
conditions = ["tabFeed.doc_type in ({})".format(", ".join(can_read_doctypes))]
if restrictions:
if user_permissions:
can_read_docs = []
for doctype, names in restrictions.items():
for doctype, names in user_permissions.items():
for n in names:
can_read_docs.append('"{}|{}"'.format(doctype, n))
@ -40,5 +42,5 @@ def get_permission_query_conditions():
return "(" + " or ".join(conditions) + ")"
def has_permission(doc):
return frappe.has_permission(doc.doc_type, "read", doc.doc_name)
def has_permission(doc, user):
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 = {
"Feed": "erpnext.home.doctype.feed.feed.get_permission_query_conditions",
"Note": "erpnext.utilities.doctype.note.note.get_permission_query_conditions"
}
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"
},
"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",
"fieldtype": "Data",
"hidden": 1,
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
@ -196,13 +196,14 @@
"icon": "icon-thumbs-up",
"idx": 1,
"is_submittable": 1,
"modified": "2014-05-09 02:16:37.334857",
"modified": "2014-05-27 03:49:07.393120",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",
"owner": "ashwini@webnotestech.com",
"permissions": [
{
"apply_user_permissions": 1,
"cancel": 0,
"create": 1,
"delete": 0,
@ -211,7 +212,6 @@
"print": 1,
"read": 1,
"report": 1,
"restricted": 1,
"role": "Employee",
"submit": 0,
"write": 1
@ -232,6 +232,7 @@
},
{
"amend": 1,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,12 +6,13 @@ import frappe
from frappe.utils import getdate, validate_email_add, cint
from frappe.model.naming import make_autoname
from frappe import throw, _
from frappe import throw, _, msgprint
import frappe.permissions
from frappe.defaults import get_restrictions
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
class EmployeeUserDisabledError(frappe.ValidationError): pass
class Employee(Document):
def onload(self):
self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
@ -45,36 +46,24 @@ class Employee(Document):
def on_update(self):
if self.user_id:
self.update_user_default()
self.update_user()
self.update_user_permissions()
self.update_dob_event()
self.restrict_leave_approver()
self.update_leave_approver_user_permissions()
def restrict_user(self):
"""restrict to this employee for user"""
self.add_restriction_if_required("Employee", self.user_id)
def update_user_permissions(self):
frappe.permissions.add_user_permission("Employee", self.name, self.user_id)
frappe.permissions.set_user_permission_if_allowed("Company", self.company, self.user_id)
def update_user_default(self):
self.restrict_user()
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"""
def update_leave_approver_user_permissions(self):
"""add employee user permission for leave approver"""
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:
employee_leave_approvers.append(frappe.db.get_value("Employee", self.reports_to, "user_id"))
for user in employee_leave_approvers:
self.add_restriction_if_required("Employee", user)
self.add_restriction_if_required("Leave Application", user)
def add_restriction_if_required(self, doctype, user):
if 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")
frappe.permissions.add_user_permission("Employee", self.name, user)
def update_user(self):
# add employee role if missing
@ -85,7 +74,7 @@ class Employee(Document):
user.add_roles("Employee")
# 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(" ")
if len(employee_name) >= 3:
user.last_name = " ".join(employee_name[2:])
@ -111,7 +100,7 @@ class Employee(Document):
"attached_to_doctype": "User",
"attached_to_name": self.user_id
}).insert()
except frappe.DuplicateEntryError, e:
except frappe.DuplicateEntryError:
# already exists
pass
@ -146,7 +135,7 @@ class Employee(Document):
enabled = frappe.db.sql("""select name from `tabUser` where
name=%s and enabled=1""", self.user_id)
if not enabled:
throw(_("User {0} is disabled").format(self.user_id))
throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
def validate_duplicate_user_id(self):
employee = frappe.db.sql_list("""select name from `tabEmployee` where
@ -155,12 +144,12 @@ class Employee(Document):
throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0]))
def validate_employee_leave_approver(self):
from frappe.utils.user import User
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
for l in self.get("employee_leave_approvers"):
if "Leave Approver" not in User(l.leave_approver).get_roles():
throw(_("{0} is not a valid Leave Approver").format(l.leave_approver), InvalidLeaveApproverError)
for l in self.get("employee_leave_approvers")[:]:
if "Leave Approver" not in frappe.get_roles(l.leave_approver):
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):
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()
return target
def update_user_default(doc, method):
def validate_employee_role(doc, method):
# 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.update_user_default()
except frappe.DoesNotExistError:
pass
employee.update_user_permissions()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -169,7 +169,7 @@
{
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "Leave Application",
@ -182,13 +182,14 @@
"idx": 1,
"is_submittable": 1,
"max_attachments": 3,
"modified": "2014-05-15 19:30:47.331357",
"modified": "2014-05-27 03:49:12.957706",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application",
"owner": "Administrator",
"permissions": [
{
"apply_user_permissions": 1,
"create": 1,
"delete": 0,
"email": 1,
@ -211,6 +212,7 @@
},
{
"amend": 1,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,
@ -219,13 +221,14 @@
"print": 1,
"read": 1,
"report": 1,
"restrict": 1,
"role": "HR User",
"set_user_permissions": 1,
"submit": 1,
"write": 1
},
{
"amend": 1,
"apply_user_permissions": 1,
"cancel": 0,
"create": 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, \
comma_or, get_fullname
from frappe import msgprint
from erpnext.hr.utils import set_employee_name
class LeaveDayBlockedError(frappe.ValidationError): pass
class OverlapError(frappe.ValidationError): pass
@ -22,6 +23,8 @@ class LeaveApplication(Document):
else:
self.previous_doc = None
set_employee_name(self)
self.validate_to_date()
self.validate_balance_leaves()
self.validate_leave_overlap()
@ -206,7 +209,7 @@ class LeaveApplication(Document):
def notify(self, args):
args = frappe._dict(args)
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)})
@frappe.whitelist()

View File

@ -5,7 +5,7 @@ import frappe
import unittest
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"]
@ -91,7 +91,7 @@ class TestLeaveApplication(unittest.TestCase):
from frappe.utils.user import add_role
add_role("test1@example.com", "HR User")
clear_restrictions("Employee")
clear_user_permissions_for_doctype("Employee")
frappe.db.set_value("Department", "_Test Department",
"leave_block_list", "_Test Leave Block List")

View File

@ -1,7 +1,7 @@
{
"allow_import": 1,
"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.",
"docstatus": 0,
"doctype": "DocType",
@ -10,6 +10,7 @@
{
"fieldname": "leave_block_list_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Leave Block List Name",
"permlevel": 0,
"reqd": 1
@ -17,6 +18,7 @@
{
"fieldname": "year",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Year",
"options": "Fiscal Year",
"permlevel": 0,
@ -25,6 +27,7 @@
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"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.",
"fieldname": "applies_to_all_departments",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Applies to Company",
"permlevel": 0
},
@ -68,13 +72,14 @@
],
"icon": "icon-calendar",
"idx": 1,
"modified": "2013-12-20 19:24:13.000000",
"modified": "2014-05-27 03:49:13.198735",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Block List",
"owner": "Administrator",
"permissions": [
{
"apply_user_permissions": 1,
"create": 1,
"email": 1,
"permlevel": 0,

View File

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

View File

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

View File

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

View File

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

View File

@ -9,6 +9,7 @@ from frappe.model.naming import make_autoname
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
class SalaryStructure(Document):
def autoname(self):
@ -63,6 +64,7 @@ class SalaryStructure(Document):
def validate(self):
self.check_existing()
self.validate_amount()
set_employee_name(self)
@frappe.whitelist()
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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.045541",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Birthday",

View File

@ -1,11 +1,12 @@
{
"apply_user_permissions": 1,
"creation": "2013-05-06 18:43:53",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"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\"}",
"modified": "2014-05-13 16:08:56.013856",
"modified": "2014-06-03 07:18:17.059554",
"modified_by": "Administrator",
"module": "HR",
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.066168",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Leave Balance",

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.181332",
"modified_by": "Administrator",
"module": "HR",
"name": "Monthly Attendance Sheet",

View File

@ -1,11 +1,12 @@
{
"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,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000",
"modified": "2014-06-03 07:18:17.187018",
"modified_by": "Administrator",
"module": "HR",
"name": "Monthly Salary Register",

View File

@ -22,3 +22,7 @@ def get_expense_approver_list():
if not roles:
frappe.msgprint(_("No Expense Approvers. Please assign 'Expense Approver' Role to atleast one user"))
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",
"fieldtype": "Link",
"ignore_restrictions": 1,
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"options": "BOM",
@ -233,7 +233,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2014-05-09 02:16:39.975486",
"modified": "2014-05-27 03:49:08.024523",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
@ -253,6 +253,7 @@
"write": 1
},
{
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,11 @@
execute:import unidecode # new requirement
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.apply_user_permissions
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.update_incharge_name_to_sales_person_in_maintenance_schedule
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, '')=''""")
erpnext.patches.v4_0.remove_module_home_pages
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.countrywise_coa
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.delete_doc("DocType", "Grade")
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.delete_doc("Print Format", "SalesInvoice")
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,30 +3,27 @@
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1):
if not d.item_group:
item_group = frappe.db.sql("""select name from `tabItem Group`
where ifnull(parent_item_group, '') = ''""")[0][0]
else:
item_group = d.item_group
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": item_group,
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")

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
from frappe.utils import get_fullname
@ -5,9 +10,14 @@ def execute():
for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
where ifnull(user_id, '')!=''
group by user_id having count(name) > 1"""):
fullname = get_fullname(user_id)
employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
if employee:
frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s and name!=%s""", (user_id, employee))
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
import frappe
import frappe.permissions
def execute():
from frappe.core.page.user_properties import user_properties
for warehouse, user in frappe.db.sql("""select parent, user from `tabWarehouse User`"""):
user_properties.add(user, "Warehouse", warehouse)
frappe.delete_doc("DocType", "Warehouse User")
frappe.reload_doc("stock", "doctype", "warehouse")
frappe.permissions.add_user_permission("Warehouse", warehouse, user)
frappe.delete_doc_if_exists("DocType", "Warehouse User")
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

@ -7,15 +7,16 @@ import frappe
def execute():
frappe.reload_doc("core", "doctype", "outgoing_email_settings")
frappe.reload_doc("support", "doctype", "support_email_settings")
email_settings = get_email_settings()
map_outgoing_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):
outgoing_email_settings = frappe.get_doc("Outgoing Email Settings")
for fieldname in (("outgoing_mail_server", "mail_server"),
for fieldname in (("outgoing_mail_server", "mail_server"),
"use_ssl", "mail_port", "mail_login", "mail_password",
"always_use_login_id_as_sender",
"auto_email_id", "send_print_in_body_and_attachment"):
@ -28,26 +29,26 @@ def map_outgoing_email_settings(email_settings):
outgoing_email_settings.set(to_fieldname, email_settings.get(from_fieldname))
outgoing_email_settings.save()
def map_support_email_settings(email_settings):
support_email_settings = frappe.get_doc("Support Email Settings")
for fieldname in ("sync_support_mails", "support_email",
("support_host", "mail_server"),
("support_use_ssl", "use_ssl"),
("support_username", "mail_login"),
("support_password", "mail_password"),
for fieldname in ("sync_support_mails", "support_email",
("support_host", "mail_server"),
("support_use_ssl", "use_ssl"),
("support_username", "mail_login"),
("support_password", "mail_password"),
"support_signature", "send_autoreply", "support_autoreply"):
if isinstance(fieldname, tuple):
from_fieldname, to_fieldname = fieldname
else:
from_fieldname = to_fieldname = fieldname
support_email_settings.set(to_fieldname, email_settings.get(from_fieldname))
support_email_settings.save()
def get_email_settings():
ret = {}
for field, value in frappe.db.sql("select field, value from tabSingles where doctype='Email Settings'"):

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