Made In Words configurable
This commit is contained in:
parent
a0b21235d7
commit
b5b3d478a2
@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 1,
|
"allow_copy": 1,
|
||||||
|
"allow_email": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
|
"allow_print": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
|
"allow_trash": 0,
|
||||||
"creation": "2013-05-02 17:53:24",
|
"creation": "2013-05-02 17:53:24",
|
||||||
"custom": 0,
|
"custom": 0,
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
@ -15,13 +18,17 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 1,
|
"ignore_user_permissions": 1,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Default Company",
|
"label": "Default Company",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Company",
|
"options": "Company",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
@ -37,13 +44,17 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Current Fiscal Year",
|
"label": "Current Fiscal Year",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Fiscal Year",
|
"options": "Fiscal Year",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
@ -59,13 +70,17 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Country",
|
"label": "Country",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Country",
|
"options": "Country",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
@ -81,12 +96,16 @@
|
|||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
@ -103,13 +122,17 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 1,
|
"ignore_user_permissions": 1,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Default Currency",
|
"label": "Default Currency",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Currency",
|
"options": "Currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
@ -126,13 +149,17 @@
|
|||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Hide Currency Symbol",
|
"label": "Hide Currency Symbol",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "\nNo\nYes",
|
"options": "\nNo\nYes",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
@ -149,12 +176,42 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Disable Rounded Total",
|
"label": "Disable Rounded Total",
|
||||||
|
"length": 0,
|
||||||
|
"no_column": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"description": "If disable, 'In Words' field will not be visible in any transaction",
|
||||||
|
"fieldname": "disable_in_words",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Disable In Words",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
@ -170,9 +227,12 @@
|
|||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"in_dialog": 0,
|
"in_dialog": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
|
"is_transaction_doc": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-06-30 03:00:26.420003",
|
"max_attachments": 0,
|
||||||
|
"menu_index": 0,
|
||||||
|
"modified": "2016-03-03 16:14:41.260467",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Global Defaults",
|
"name": "Global Defaults",
|
||||||
@ -192,6 +252,7 @@
|
|||||||
"print": 0,
|
"print": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"report": 0,
|
||||||
|
"restrict": 0,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
"set_user_permissions": 0,
|
||||||
"share": 1,
|
"share": 1,
|
||||||
@ -200,5 +261,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"read_only_onload": 0
|
"read_only_onload": 0,
|
||||||
|
"show_in_menu": 0,
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"use_template": 0,
|
||||||
|
"version": 0
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ keydict = {
|
|||||||
'hide_currency_symbol':'hide_currency_symbol',
|
'hide_currency_symbol':'hide_currency_symbol',
|
||||||
'account_url':'account_url',
|
'account_url':'account_url',
|
||||||
'disable_rounded_total': 'disable_rounded_total',
|
'disable_rounded_total': 'disable_rounded_total',
|
||||||
|
'disable_in_words': 'disable_in_words',
|
||||||
}
|
}
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
@ -44,6 +45,7 @@ class GlobalDefaults(Document):
|
|||||||
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
|
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
|
||||||
|
|
||||||
self.toggle_rounded_total()
|
self.toggle_rounded_total()
|
||||||
|
self.toggle_in_words()
|
||||||
|
|
||||||
# clear cache
|
# clear cache
|
||||||
frappe.clear_cache()
|
frappe.clear_cache()
|
||||||
@ -61,3 +63,12 @@ class GlobalDefaults(Document):
|
|||||||
|
|
||||||
make_property_setter(doctype, "rounded_total", "hidden", self.disable_rounded_total, "Check")
|
make_property_setter(doctype, "rounded_total", "hidden", self.disable_rounded_total, "Check")
|
||||||
make_property_setter(doctype, "rounded_total", "print_hide", self.disable_rounded_total, "Check")
|
make_property_setter(doctype, "rounded_total", "print_hide", self.disable_rounded_total, "Check")
|
||||||
|
|
||||||
|
def toggle_in_words(self):
|
||||||
|
self.disable_in_words = cint(self.disable_in_words)
|
||||||
|
|
||||||
|
# Make property setters to hide in words fields
|
||||||
|
for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note",
|
||||||
|
"Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"):
|
||||||
|
make_property_setter(doctype, "in_words", "hidden", self.disable_in_words, "Check")
|
||||||
|
make_property_setter(doctype, "in_words", "print_hide", self.disable_in_words, "Check")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user