From dd66bc03c78b494f95f2d6ecb825f03ecc2f48e9 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 22 Jan 2018 12:14:51 +0530 Subject: [PATCH] fixes --- .travis.yml | 2 - .../leave_application/leave_application.js | 1 + .../leave_application/leave_application.json | 66 +------------------ .../leave_application/leave_application.py | 5 +- .../leave_application_list.js | 1 - .../v10_0/workflow_leave_application.py | 1 - erpnext/public/css/pos.css | 5 +- 7 files changed, 11 insertions(+), 70 deletions(-) diff --git a/.travis.yml b/.travis.yml index e19a1dc046..03e75b6897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,14 +58,12 @@ jobs: - stage: test script: - set -e - - bench execute erpnext.patches.v10_0.workflow_leave_application.execute - bench run-tests env: Server Side Test - # stage script: - bench --verbose run-setup-wizard-ui-test - bench execute erpnext.setup.utils.enable_all_roles_and_domains - - bench execute erpnext.patches.v10_0.workflow_leave_application.execute - bench run-ui-tests --app erpnext env: Client Side Test - # stage diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index a4e0d8d36f..c2d8326320 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -29,6 +29,7 @@ frappe.ui.form.on("Leave Application", { refresh: function(frm) { if (frm.is_new()) { + frm.set_value("workflow_state", "Open"); frm.trigger("calculate_total_days"); } }, diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index f70b1df733..88b5a554fc 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -44,66 +44,6 @@ "set_only_once": 1, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Open", - "fieldname": "status", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Status", - "length": 0, - "no_copy": 1, - "options": "Open\nApproved\nRejected", - "permlevel": 1, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_12", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -796,7 +736,7 @@ "issingle": 0, "istable": 0, "max_attachments": 3, - "modified": "2018-01-16 00:21:59.025871", + "modified": "2018-01-22 12:10:40.757274", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", @@ -887,9 +827,9 @@ { "amend": 1, "apply_user_permissions": 0, - "cancel": 0, + "cancel": 1, "create": 0, - "delete": 0, + "delete": 1, "email": 1, "export": 0, "if_owner": 0, diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 81d8ce374f..5be44af1e3 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -24,6 +24,7 @@ class LeaveApplication(Document): return _("{0}: From {0} of type {1}").format(self.workflow_state, self.employee_name, self.leave_type) def validate(self): + if self.get("__islocal"): self.workflow_state = 'Open' if not getattr(self, "__islocal", None) and frappe.db.exists(self.doctype, self.name): self.previous_doc = frappe.get_value(self.doctype, self.name, "leave_approver", as_dict=True) else: @@ -180,9 +181,9 @@ class LeaveApplication(Document): self.throw_overlap_error(d) def throw_overlap_error(self, d): - msg = _("Employee {0} has already applied for {1} between {2} and {3}").format(self.employee, + msg = _("Employee {0} has already applied for {1} between {2} and {3} : ").format(self.employee, d['leave_type'], formatdate(d['from_date']), formatdate(d['to_date'])) \ - + """
{0}""".format(d["name"]) + + """ {0}""".format(d["name"]) frappe.throw(msg, OverlapError) def get_total_leaves_on_half_day(self): diff --git a/erpnext/hr/doctype/leave_application/leave_application_list.js b/erpnext/hr/doctype/leave_application/leave_application_list.js index fba7297329..7798ae7d3d 100644 --- a/erpnext/hr/doctype/leave_application/leave_application_list.js +++ b/erpnext/hr/doctype/leave_application/leave_application_list.js @@ -1,6 +1,5 @@ frappe.listview_settings['Leave Application'] = { add_fields: ["workflow_state", "leave_type", "employee", "employee_name", "total_leave_days", "from_date", "to_date"], - filters:[["workflow_state","!=", "Rejected"]], get_indicator: function(doc) { return [__(doc.workflow_state), frappe.utils.guess_colour(doc.workflow_state), "workflow_state,=," + doc.workflow_state]; diff --git a/erpnext/patches/v10_0/workflow_leave_application.py b/erpnext/patches/v10_0/workflow_leave_application.py index 4128631cd6..0b13a319ea 100644 --- a/erpnext/patches/v10_0/workflow_leave_application.py +++ b/erpnext/patches/v10_0/workflow_leave_application.py @@ -48,4 +48,3 @@ def execute(): }).insert(ignore_permissions=True) frappe.db.sql("""update `tabLeave Application` set workflow_state = status""") - # frappe.db.sql("""alter table `tabLeave Application` drop column status""") diff --git a/erpnext/public/css/pos.css b/erpnext/public/css/pos.css index bc81182f32..e2d301df0d 100644 --- a/erpnext/public/css/pos.css +++ b/erpnext/public/css/pos.css @@ -169,5 +169,8 @@ input[type=number]::-webkit-outer-spin-button { height: 60px; } .grand-total .grand-total-value { - font-size: 24px; + font-size: 18px; +} +.rounded-total-value { + font-size: 18px; }