This commit is contained in:
parent
81ba0b29da
commit
43405203b2
@ -9,7 +9,6 @@ from frappe import msgprint, _
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Attendance(Document):
|
class Attendance(Document):
|
||||||
|
|
||||||
def validate_duplicate_record(self):
|
def validate_duplicate_record(self):
|
||||||
res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s
|
res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s
|
||||||
and name != %s and docstatus = 1""",
|
and name != %s and docstatus = 1""",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
test_records = [[{"doctype":"Branch", "branch":"_Test Branch"}]]
|
test_records = [{"doctype":"Branch", "branch":"_Test Branch"}]
|
@ -2,12 +2,12 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
test_records = [
|
test_records = [
|
||||||
[{
|
{
|
||||||
"doctype": "Deduction Type",
|
"doctype": "Deduction Type",
|
||||||
"deduction_name": "_Test Professional Tax"
|
"deduction_name": "_Test Professional Tax"
|
||||||
}],
|
},
|
||||||
[{
|
{
|
||||||
"doctype": "Deduction Type",
|
"doctype": "Deduction Type",
|
||||||
"deduction_name": "_Test TDS"
|
"deduction_name": "_Test TDS"
|
||||||
}]
|
}
|
||||||
]
|
]
|
@ -4,6 +4,6 @@
|
|||||||
test_ignore = ["Leave Block List"]
|
test_ignore = ["Leave Block List"]
|
||||||
|
|
||||||
test_records = [
|
test_records = [
|
||||||
[{"doctype":"Department", "department_name":"_Test Department"}],
|
{"doctype":"Department", "department_name":"_Test Department"},
|
||||||
[{"doctype":"Department", "department_name":"_Test Department 1"}]
|
{"doctype":"Department", "department_name":"_Test Department 1"}
|
||||||
]
|
]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]]
|
test_records = [{"doctype":"Designation", "designation_name":"_Test Designation"}]
|
@ -2,14 +2,14 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
test_records = [
|
test_records = [
|
||||||
[{
|
{
|
||||||
"doctype": "Earning Type",
|
"doctype": "Earning Type",
|
||||||
"earning_name": "_Test Basic Salary",
|
"earning_name": "_Test Basic Salary",
|
||||||
"taxable": "Yes"
|
"taxable": "Yes"
|
||||||
}],
|
},
|
||||||
[{
|
{
|
||||||
"doctype": "Earning Type",
|
"doctype": "Earning Type",
|
||||||
"earning_name": "_Test Allowance",
|
"earning_name": "_Test Allowance",
|
||||||
"taxable": "Yes"
|
"taxable": "Yes"
|
||||||
}]
|
}
|
||||||
]
|
]
|
@ -78,7 +78,7 @@ class Employee(DocListController):
|
|||||||
from frappe.utils.user import add_role
|
from frappe.utils.user import add_role
|
||||||
add_role(self.user_id, "Employee")
|
add_role(self.user_id, "Employee")
|
||||||
|
|
||||||
user_wrapper = frappe.bean("User", self.user_id)
|
user_wrapper = frappe.get_doc("User", self.user_id)
|
||||||
|
|
||||||
# copy details like Fullname, DOB and Image to User
|
# copy details like Fullname, DOB and Image to User
|
||||||
if self.employee_name:
|
if self.employee_name:
|
||||||
@ -182,12 +182,12 @@ class Employee(DocListController):
|
|||||||
ends_on = self.date_of_birth + " 00:15:00"
|
ends_on = self.date_of_birth + " 00:15:00"
|
||||||
|
|
||||||
if birthday_event:
|
if birthday_event:
|
||||||
event = frappe.bean("Event", birthday_event[0][0])
|
event = frappe.get_doc("Event", birthday_event[0][0])
|
||||||
event.starts_on = starts_on
|
event.starts_on = starts_on
|
||||||
event.ends_on = ends_on
|
event.ends_on = ends_on
|
||||||
event.save()
|
event.save()
|
||||||
else:
|
else:
|
||||||
frappe.bean({
|
frappe.get_doc({
|
||||||
"doctype": "Event",
|
"doctype": "Event",
|
||||||
"subject": _("Birthday") + ": " + self.employee_name,
|
"subject": _("Birthday") + ": " + self.employee_name,
|
||||||
"description": _("Happy Birthday!") + " " + self.employee_name,
|
"description": _("Happy Birthday!") + " " + self.employee_name,
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe.model.bean import getlist
|
from frappe.model.bean import getlist
|
||||||
from frappe import msgprint
|
from frappe import _
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
@ -26,5 +26,4 @@ class ExpenseClaim(Document):
|
|||||||
|
|
||||||
def validate_exp_details(self):
|
def validate_exp_details(self):
|
||||||
if not self.get('expense_voucher_details'):
|
if not self.get('expense_voucher_details'):
|
||||||
msgprint("Please add expense voucher details")
|
frappe.throw(_("Please add expense voucher details"))
|
||||||
raise Exception
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
test_records = [[{"doctype":"Grade", "grade_name":"_Test Grade"}]]
|
test_records = [{"doctype":"Grade", "grade_name":"_Test Grade"}]
|
@ -31,8 +31,8 @@ class TestLeaveApplication(unittest.TestCase):
|
|||||||
employee.save()
|
employee.save()
|
||||||
frappe.set_user(temp_session_user)
|
frappe.set_user(temp_session_user)
|
||||||
|
|
||||||
def get_application(self, doclist):
|
def get_application(self, doc):
|
||||||
application = frappe.bean(copy=doclist)
|
application = frappe.copy_doc(doc)
|
||||||
application.from_date = "2013-01-01"
|
application.from_date = "2013-01-01"
|
||||||
application.to_date = "2013-01-05"
|
application.to_date = "2013-01-05"
|
||||||
return application
|
return application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user