Module Import Fix (#21433)

This commit is contained in:
Ahmad 2020-04-27 10:27:02 +05:00 committed by GitHub
parent 131452ca94
commit f34faa9181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ import frappe
from frappe.utils import getdate, nowdate from frappe.utils import getdate, nowdate
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from frappe.utils import cstr, get_datetime, format_date from frappe.utils import cstr, get_datetime, formatdate
class Attendance(Document): class Attendance(Document):
def validate(self): def validate(self):
@ -52,16 +52,16 @@ class Attendance(Document):
if d.half_day_date == getdate(self.attendance_date): if d.half_day_date == getdate(self.attendance_date):
self.status = 'Half Day' self.status = 'Half Day'
frappe.msgprint(_("Employee {0} on Half day on {1}") frappe.msgprint(_("Employee {0} on Half day on {1}")
.format(self.employee, format_date(self.attendance_date))) .format(self.employee, formatdate(self.attendance_date)))
else: else:
self.status = 'On Leave' self.status = 'On Leave'
frappe.msgprint(_("Employee {0} is on Leave on {1}") frappe.msgprint(_("Employee {0} is on Leave on {1}")
.format(self.employee, format_date(self.attendance_date))) .format(self.employee, formatdate(self.attendance_date)))
if self.status in ("On Leave", "Half Day"): if self.status in ("On Leave", "Half Day"):
if not leave_record: if not leave_record:
frappe.msgprint(_("No leave record found for employee {0} on {1}") frappe.msgprint(_("No leave record found for employee {0} on {1}")
.format(self.employee, format_date(self.attendance_date)), alert=1) .format(self.employee, formatdate(self.attendance_date)), alert=1)
elif self.leave_type: elif self.leave_type:
self.leave_type = None self.leave_type = None
self.leave_application = None self.leave_application = None

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe, erpnext import frappe, erpnext
import datetime, math import datetime, math
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, format_date from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, formatdate
from frappe.model.naming import make_autoname from frappe.model.naming import make_autoname
from frappe import msgprint, _ from frappe import msgprint, _
@ -329,7 +329,7 @@ class SalarySlip(TransactionBase):
if d.status in ('Half Day', 'On Leave') and d.leave_type and d.leave_type not in lwp_leave_types: if d.status in ('Half Day', 'On Leave') and d.leave_type and d.leave_type not in lwp_leave_types:
continue continue
if format_date(d.attendance_date, "yyyy-mm-dd") in holidays: if formatdate(d.attendance_date, "yyyy-mm-dd") in holidays:
if d.status == "Absent" or \ if d.status == "Absent" or \
(d.leave_type and d.leave_type in lwp_leave_types and not lwp_leave_types[d.leave_type]): (d.leave_type and d.leave_type in lwp_leave_types and not lwp_leave_types[d.leave_type]):
continue continue