Fixes in user permissions patches
This commit is contained in:
parent
37993dd713
commit
cdc1b640d9
@ -1,417 +1,164 @@
|
|||||||
{
|
{
|
||||||
"_last_update": null,
|
|
||||||
"_user_tags": null,
|
|
||||||
"allow_attach": null,
|
|
||||||
"allow_copy": null,
|
|
||||||
"allow_email": null,
|
|
||||||
"allow_import": null,
|
|
||||||
"allow_print": null,
|
|
||||||
"allow_rename": null,
|
|
||||||
"allow_trash": null,
|
|
||||||
"autoname": "PVTD.######",
|
"autoname": "PVTD.######",
|
||||||
"change_log": null,
|
|
||||||
"client_script": null,
|
|
||||||
"client_script_core": null,
|
|
||||||
"client_string": null,
|
|
||||||
"colour": null,
|
|
||||||
"creation": "2013-05-21 16:16:04",
|
"creation": "2013-05-21 16:16:04",
|
||||||
"custom": null,
|
|
||||||
"default_print_format": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": null,
|
|
||||||
"dt_template": null,
|
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": "Valuation and Total",
|
"default": "Valuation and Total",
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "category",
|
"fieldname": "category",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Consider Tax or Charge for",
|
"label": "Consider Tax or Charge for",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "category",
|
"oldfieldname": "category",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "Valuation and Total\nValuation\nTotal",
|
"options": "Valuation and Total\nValuation\nTotal",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"reqd": 1
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": "Add",
|
"default": "Add",
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "add_deduct_tax",
|
"fieldname": "add_deduct_tax",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Add or Deduct",
|
"label": "Add or Deduct",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "add_deduct_tax",
|
"oldfieldname": "add_deduct_tax",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "Add\nDeduct",
|
"options": "Add\nDeduct",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"reqd": 1
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "charge_type",
|
"fieldname": "charge_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Type",
|
"label": "Type",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "charge_type",
|
"oldfieldname": "charge_type",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
|
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"reqd": 1
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
|
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
|
||||||
"description": null,
|
|
||||||
"fieldname": "row_id",
|
"fieldname": "row_id",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Reference Row #",
|
"label": "Reference Row #",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "row_id",
|
"oldfieldname": "row_id",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 0
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Description",
|
"label": "Description",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "description",
|
"oldfieldname": "description",
|
||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": "300px",
|
"print_width": "300px",
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": "300px"
|
"width": "300px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "col_break1",
|
"fieldname": "col_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": null,
|
"permlevel": 0
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": null,
|
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": null,
|
|
||||||
"oldfieldtype": null,
|
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "account_head",
|
"fieldname": "account_head",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Account Head",
|
"label": "Account Head",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "account_head",
|
"oldfieldname": "account_head",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"reqd": 1
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": ":Company",
|
"default": ":Company",
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "cost_center",
|
"fieldname": "cost_center",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Cost Center",
|
"label": "Cost Center",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "cost_center",
|
"oldfieldname": "cost_center",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Cost Center",
|
"options": "Cost Center",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 0
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "rate",
|
"fieldname": "rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Rate",
|
"label": "Rate",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "rate",
|
"oldfieldname": "rate",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"reqd": 0
|
||||||
"reqd": 0,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "tax_amount",
|
"fieldname": "tax_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Amount",
|
"label": "Amount",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "tax_amount",
|
"oldfieldname": "tax_amount",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"report_hide": null,
|
"reqd": 0
|
||||||
"reqd": 0,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "total",
|
"fieldname": "total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Total",
|
"label": "Total",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "total",
|
"oldfieldname": "total",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "item_wise_tax_detail",
|
"fieldname": "item_wise_tax_detail",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Item Wise Tax Detail ",
|
"label": "Item Wise Tax Detail ",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "item_wise_tax_detail",
|
"oldfieldname": "item_wise_tax_detail",
|
||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_width": null,
|
"read_only": 1
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "parenttype",
|
"fieldname": "parenttype",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Parenttype",
|
"label": "Parenttype",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "parenttype",
|
"oldfieldname": "parenttype",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": null,
|
"search_index": 0
|
||||||
"reqd": null,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 1,
|
"hide_heading": 1,
|
||||||
"hide_toolbar": null,
|
|
||||||
"icon": null,
|
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": null,
|
|
||||||
"in_dialog": null,
|
|
||||||
"is_submittable": null,
|
|
||||||
"is_transaction_doc": null,
|
|
||||||
"issingle": null,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": null,
|
"modified": "2014-05-30 03:43:32.494112",
|
||||||
"menu_index": null,
|
|
||||||
"modified": "2014-04-15 09:48:45.892548",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Taxes and Charges",
|
"name": "Purchase Taxes and Charges",
|
||||||
"name_case": null,
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"parent": null,
|
"permissions": []
|
||||||
"parent_node": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permissions": [],
|
|
||||||
"plugin": null,
|
|
||||||
"print_outline": null,
|
|
||||||
"read_only": null,
|
|
||||||
"read_only_onload": null,
|
|
||||||
"search_fields": null,
|
|
||||||
"server_code": null,
|
|
||||||
"server_code_compiled": null,
|
|
||||||
"server_code_core": null,
|
|
||||||
"server_code_error": null,
|
|
||||||
"show_in_menu": null,
|
|
||||||
"smallicon": null,
|
|
||||||
"subject": null,
|
|
||||||
"tag_fields": null,
|
|
||||||
"title_field": null,
|
|
||||||
"use_template": null,
|
|
||||||
"version": null
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,417 +1,155 @@
|
|||||||
{
|
{
|
||||||
"_last_update": null,
|
|
||||||
"_user_tags": null,
|
|
||||||
"allow_attach": null,
|
|
||||||
"allow_copy": null,
|
|
||||||
"allow_email": null,
|
|
||||||
"allow_import": null,
|
|
||||||
"allow_print": null,
|
|
||||||
"allow_rename": null,
|
|
||||||
"allow_trash": null,
|
|
||||||
"autoname": "INVTD.######",
|
"autoname": "INVTD.######",
|
||||||
"change_log": null,
|
|
||||||
"client_script": null,
|
|
||||||
"client_script_core": null,
|
|
||||||
"client_string": null,
|
|
||||||
"colour": null,
|
|
||||||
"creation": "2013-04-24 11:39:32",
|
"creation": "2013-04-24 11:39:32",
|
||||||
"custom": null,
|
|
||||||
"default_print_format": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": null,
|
|
||||||
"dt_template": null,
|
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "charge_type",
|
"fieldname": "charge_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Type",
|
"label": "Type",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "charge_type",
|
"oldfieldname": "charge_type",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
|
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"reqd": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
|
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
|
||||||
"description": null,
|
|
||||||
"fieldname": "row_id",
|
"fieldname": "row_id",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Reference Row #",
|
"label": "Reference Row #",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "row_id",
|
"oldfieldname": "row_id",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": null,
|
"permlevel": 0
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Description",
|
"label": "Description",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "description",
|
"oldfieldname": "description",
|
||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": "300px",
|
"print_width": "300px",
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": "300px"
|
"width": "300px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "col_break_1",
|
"fieldname": "col_break_1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": null,
|
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": null,
|
|
||||||
"oldfieldtype": null,
|
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "account_head",
|
"fieldname": "account_head",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Account Head",
|
"label": "Account Head",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "account_head",
|
"oldfieldname": "account_head",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1,
|
"search_index": 1
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": ":Company",
|
"default": ":Company",
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "cost_center",
|
"fieldname": "cost_center",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Cost Center",
|
"label": "Cost Center",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "cost_center_other_charges",
|
"oldfieldname": "cost_center_other_charges",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Cost Center",
|
"options": "Cost Center",
|
||||||
"permlevel": 0,
|
"permlevel": 0
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "rate",
|
"fieldname": "rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Rate",
|
"label": "Rate",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "rate",
|
"oldfieldname": "rate",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"reqd": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "tax_amount",
|
"fieldname": "tax_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Amount",
|
"label": "Amount",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "tax_amount",
|
"oldfieldname": "tax_amount",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"report_hide": null,
|
"reqd": 0
|
||||||
"reqd": 0,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "total",
|
"fieldname": "total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Total",
|
"label": "Total",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "total",
|
"oldfieldname": "total",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
|
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
|
||||||
"fieldname": "included_in_print_rate",
|
"fieldname": "included_in_print_rate",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": null,
|
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Is this Tax included in Basic Rate?",
|
"label": "Is this Tax included in Basic Rate?",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"oldfieldname": null,
|
|
||||||
"oldfieldtype": null,
|
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_width": "150px",
|
"print_width": "150px",
|
||||||
"read_only": null,
|
|
||||||
"report_hide": 1,
|
"report_hide": 1,
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": "150px"
|
"width": "150px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "tax_amount_after_discount_amount",
|
"fieldname": "tax_amount_after_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Tax Amount After Discount Amount",
|
"label": "Tax Amount After Discount Amount",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": null,
|
|
||||||
"oldfieldtype": null,
|
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "item_wise_tax_detail",
|
"fieldname": "item_wise_tax_detail",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_filter": null,
|
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Item Wise Tax Detail",
|
"label": "Item Wise Tax Detail",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "item_wise_tax_detail",
|
"oldfieldname": "item_wise_tax_detail",
|
||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": null,
|
"read_only": 1
|
||||||
"print_width": null,
|
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": null,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": null,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"fieldname": "parenttype",
|
"fieldname": "parenttype",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_list_view": null,
|
|
||||||
"label": "Parenttype",
|
"label": "Parenttype",
|
||||||
"no_column": null,
|
|
||||||
"no_copy": null,
|
|
||||||
"oldfieldname": "parenttype",
|
"oldfieldname": "parenttype",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": null,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_width": null,
|
"search_index": 1
|
||||||
"read_only": null,
|
|
||||||
"report_hide": null,
|
|
||||||
"reqd": null,
|
|
||||||
"search_index": 1,
|
|
||||||
"set_only_once": null,
|
|
||||||
"trigger": null,
|
|
||||||
"width": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 1,
|
"hide_heading": 1,
|
||||||
"hide_toolbar": null,
|
|
||||||
"icon": null,
|
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": null,
|
|
||||||
"in_dialog": null,
|
|
||||||
"is_submittable": null,
|
|
||||||
"is_transaction_doc": null,
|
|
||||||
"issingle": null,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": null,
|
"modified": "2014-05-30 03:43:39.740638",
|
||||||
"menu_index": null,
|
|
||||||
"modified": "2014-04-14 18:40:48.450796",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Taxes and Charges",
|
"name": "Sales Taxes and Charges",
|
||||||
"name_case": null,
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"parent": null,
|
"permissions": []
|
||||||
"parent_node": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permissions": [],
|
|
||||||
"plugin": null,
|
|
||||||
"print_outline": null,
|
|
||||||
"read_only": null,
|
|
||||||
"read_only_onload": null,
|
|
||||||
"search_fields": null,
|
|
||||||
"server_code": null,
|
|
||||||
"server_code_compiled": null,
|
|
||||||
"server_code_core": null,
|
|
||||||
"server_code_error": null,
|
|
||||||
"show_in_menu": null,
|
|
||||||
"smallicon": null,
|
|
||||||
"subject": null,
|
|
||||||
"tag_fields": null,
|
|
||||||
"title_field": null,
|
|
||||||
"use_template": null,
|
|
||||||
"version": null
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,8 @@ import frappe.permissions
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
|
||||||
|
class EmployeeUserDisabledError(frappe.ValidationError): pass
|
||||||
|
|
||||||
class Employee(Document):
|
class Employee(Document):
|
||||||
def onload(self):
|
def onload(self):
|
||||||
self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
|
self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
|
||||||
@ -133,7 +135,7 @@ class Employee(Document):
|
|||||||
enabled = frappe.db.sql("""select name from `tabUser` where
|
enabled = frappe.db.sql("""select name from `tabUser` where
|
||||||
name=%s and enabled=1""", self.user_id)
|
name=%s and enabled=1""", self.user_id)
|
||||||
if not enabled:
|
if not enabled:
|
||||||
throw(_("User {0} is disabled").format(self.user_id))
|
throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
|
||||||
|
|
||||||
def validate_duplicate_user_id(self):
|
def validate_duplicate_user_id(self):
|
||||||
employee = frappe.db.sql_list("""select name from `tabEmployee` where
|
employee = frappe.db.sql_list("""select name from `tabEmployee` where
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from erpnext.hr.doctype.employee.employee import EmployeeUserDisabledError
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
update_hr_permissions()
|
update_hr_permissions()
|
||||||
@ -25,7 +26,10 @@ def update_hr_permissions():
|
|||||||
|
|
||||||
# save employees to run on_update events
|
# save employees to run on_update events
|
||||||
for employee in frappe.db.sql_list("""select name from `tabEmployee`"""):
|
for employee in frappe.db.sql_list("""select name from `tabEmployee`"""):
|
||||||
frappe.get_doc("Employee", employee).save()
|
try:
|
||||||
|
frappe.get_doc("Employee", employee).save()
|
||||||
|
except EmployeeUserDisabledError:
|
||||||
|
pass
|
||||||
|
|
||||||
def update_permissions():
|
def update_permissions():
|
||||||
# clear match conditions other than owner
|
# clear match conditions other than owner
|
||||||
|
|||||||
@ -3,30 +3,27 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc("accounts", "doctype", "pricing_rule")
|
frappe.reload_doc("accounts", "doctype", "pricing_rule")
|
||||||
|
|
||||||
frappe.db.auto_commit_on_many_writes = True
|
frappe.db.auto_commit_on_many_writes = True
|
||||||
|
|
||||||
for d in frappe.db.sql("""select * from `tabCustomer Discount`
|
default_item_group = get_root_of("Item Group")
|
||||||
where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1):
|
|
||||||
if not d.item_group:
|
for d in frappe.db.sql("""select * from `tabCustomer Discount`
|
||||||
item_group = frappe.db.sql("""select name from `tabItem Group`
|
where ifnull(parent, '') != ''""", as_dict=1):
|
||||||
where ifnull(parent_item_group, '') = ''""")[0][0]
|
|
||||||
else:
|
|
||||||
item_group = d.item_group
|
|
||||||
|
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"doctype": "Pricing Rule",
|
"doctype": "Pricing Rule",
|
||||||
"apply_on": "Item Group",
|
"apply_on": "Item Group",
|
||||||
"item_group": item_group,
|
"item_group": d.item_group or default_item_group,
|
||||||
"applicable_for": "Customer",
|
"applicable_for": "Customer",
|
||||||
"customer": d.parent,
|
"customer": d.parent,
|
||||||
"price_or_discount": "Discount Percentage",
|
"price_or_discount": "Discount Percentage",
|
||||||
"discount_percentage": d.discount
|
"discount_percentage": d.discount
|
||||||
}).insert()
|
}).insert()
|
||||||
|
|
||||||
frappe.db.auto_commit_on_many_writes = False
|
frappe.db.auto_commit_on_many_writes = False
|
||||||
|
|
||||||
frappe.delete_doc("DocType", "Customer Discount")
|
frappe.delete_doc("DocType", "Customer Discount")
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.utils import get_fullname
|
from frappe.utils import get_fullname
|
||||||
|
|
||||||
@ -5,9 +10,14 @@ def execute():
|
|||||||
for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
|
for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
|
||||||
where ifnull(user_id, '')!=''
|
where ifnull(user_id, '')!=''
|
||||||
group by user_id having count(name) > 1"""):
|
group by user_id having count(name) > 1"""):
|
||||||
|
|
||||||
fullname = get_fullname(user_id)
|
fullname = get_fullname(user_id)
|
||||||
employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
|
employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
|
||||||
|
|
||||||
if employee:
|
if employee:
|
||||||
frappe.db.sql("""update `tabEmployee` set user_id=null
|
frappe.db.sql("""update `tabEmployee` set user_id=null
|
||||||
where user_id=%s and name!=%s""", (user_id, employee))
|
where user_id=%s and name!=%s""", (user_id, employee))
|
||||||
|
else:
|
||||||
|
count = frappe.db.sql("""select count(*) from `tabEmployee` where user_id=%s""", user_id)[0][0]
|
||||||
|
frappe.db.sql("""update `tabEmployee` set user_id=null
|
||||||
|
where user_id=%s limit %s""", (user_id, count - 1))
|
||||||
|
|||||||
@ -7,15 +7,16 @@ import frappe
|
|||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc("core", "doctype", "outgoing_email_settings")
|
frappe.reload_doc("core", "doctype", "outgoing_email_settings")
|
||||||
frappe.reload_doc("support", "doctype", "support_email_settings")
|
frappe.reload_doc("support", "doctype", "support_email_settings")
|
||||||
|
|
||||||
email_settings = get_email_settings()
|
email_settings = get_email_settings()
|
||||||
map_outgoing_email_settings(email_settings)
|
map_outgoing_email_settings(email_settings)
|
||||||
map_support_email_settings(email_settings)
|
map_support_email_settings(email_settings)
|
||||||
frappe.delete_doc("Doctype", "Email Settings")
|
|
||||||
|
frappe.delete_doc("DocType", "Email Settings")
|
||||||
|
|
||||||
def map_outgoing_email_settings(email_settings):
|
def map_outgoing_email_settings(email_settings):
|
||||||
outgoing_email_settings = frappe.get_doc("Outgoing Email Settings")
|
outgoing_email_settings = frappe.get_doc("Outgoing Email Settings")
|
||||||
for fieldname in (("outgoing_mail_server", "mail_server"),
|
for fieldname in (("outgoing_mail_server", "mail_server"),
|
||||||
"use_ssl", "mail_port", "mail_login", "mail_password",
|
"use_ssl", "mail_port", "mail_login", "mail_password",
|
||||||
"always_use_login_id_as_sender",
|
"always_use_login_id_as_sender",
|
||||||
"auto_email_id", "send_print_in_body_and_attachment"):
|
"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.set(to_fieldname, email_settings.get(from_fieldname))
|
||||||
|
|
||||||
outgoing_email_settings.save()
|
outgoing_email_settings.save()
|
||||||
|
|
||||||
def map_support_email_settings(email_settings):
|
def map_support_email_settings(email_settings):
|
||||||
support_email_settings = frappe.get_doc("Support Email Settings")
|
support_email_settings = frappe.get_doc("Support Email Settings")
|
||||||
|
|
||||||
for fieldname in ("sync_support_mails", "support_email",
|
for fieldname in ("sync_support_mails", "support_email",
|
||||||
("support_host", "mail_server"),
|
("support_host", "mail_server"),
|
||||||
("support_use_ssl", "use_ssl"),
|
("support_use_ssl", "use_ssl"),
|
||||||
("support_username", "mail_login"),
|
("support_username", "mail_login"),
|
||||||
("support_password", "mail_password"),
|
("support_password", "mail_password"),
|
||||||
"support_signature", "send_autoreply", "support_autoreply"):
|
"support_signature", "send_autoreply", "support_autoreply"):
|
||||||
|
|
||||||
if isinstance(fieldname, tuple):
|
if isinstance(fieldname, tuple):
|
||||||
from_fieldname, to_fieldname = fieldname
|
from_fieldname, to_fieldname = fieldname
|
||||||
else:
|
else:
|
||||||
from_fieldname = to_fieldname = fieldname
|
from_fieldname = to_fieldname = fieldname
|
||||||
|
|
||||||
support_email_settings.set(to_fieldname, email_settings.get(from_fieldname))
|
support_email_settings.set(to_fieldname, email_settings.get(from_fieldname))
|
||||||
|
|
||||||
support_email_settings.save()
|
support_email_settings.save()
|
||||||
|
|
||||||
def get_email_settings():
|
def get_email_settings():
|
||||||
ret = {}
|
ret = {}
|
||||||
for field, value in frappe.db.sql("select field, value from tabSingles where doctype='Email Settings'"):
|
for field, value in frappe.db.sql("select field, value from tabSingles where doctype='Email Settings'"):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user