From 35cc320e213cc58cdca10bac640918155138db01 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 30 Jul 2014 17:00:05 +0530 Subject: [PATCH] [fixes] Leave Application and Toggle Rounded Totals --- erpnext/hr/doctype/leave_application/leave_application.py | 6 +++--- erpnext/patches.txt | 2 +- erpnext/setup/doctype/global_defaults/global_defaults.py | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 27833913e8..124e309c4c 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -252,7 +252,7 @@ def get_events(start, end): if "Employee" in frappe.get_roles(): add_department_leaves(events, start, end, employee, company) - add_leaves(events, start, end, employee, company, match_conditions) + add_leaves(events, start, end, match_conditions) add_block_dates(events, start, end, employee, company) add_holidays(events, start, end, employee, company) @@ -270,9 +270,9 @@ def add_department_leaves(events, start, end, employee, company): and company=%s""", (department, company)) match_conditions = "employee in (\"%s\")" % '", "'.join(department_employees) - add_leaves(events, start, end, employee, company, match_conditions=match_conditions) + add_leaves(events, start, end, match_conditions=match_conditions) -def add_leaves(events, start, end, employee, company, match_conditions=None): +def add_leaves(events, start, end, match_conditions=None): query = """select name, from_date, to_date, employee_name, half_day, status, employee, docstatus from `tabLeave Application` where diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 44d5b3a4c0..275e600d70 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -73,4 +73,4 @@ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") # 29-07 execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") # 29-07-2014 execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22 erpnext.patches.v4_2.delete_old_print_formats #2014-07-29 -erpnext.patches.v4_2.toggle_rounded_total +erpnext.patches.v4_2.toggle_rounded_total #2014-07-30 diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index 4764484166..a8905f1262 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -57,6 +57,8 @@ class GlobalDefaults(Document): # Make property setters to hide rounded total fields for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note"): - for fieldname in ("rounded_total", "rounded_total_export"): - make_property_setter(doctype, fieldname, "hidden", self.disable_rounded_total, "Check") - make_property_setter(doctype, fieldname, "print_hide", 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", 1, "Check") + + make_property_setter(doctype, "rounded_total_export", "hidden", self.disable_rounded_total, "Check") + make_property_setter(doctype, "rounded_total_export", "print_hide", self.disable_rounded_total, "Check")