mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
Merge github.com:frappe/erpnext into develop
This commit is contained in:
@@ -66,7 +66,7 @@ class DocType(DocListController):
|
|||||||
self.add_restriction_if_required("Leave Application", user)
|
self.add_restriction_if_required("Leave Application", user)
|
||||||
|
|
||||||
def add_restriction_if_required(self, doctype, user):
|
def add_restriction_if_required(self, doctype, user):
|
||||||
if frappe.permissions.has_only_non_restrict_role(frappe.get_doctype(doctype), user) \
|
if frappe.permissions.has_only_non_restrict_role(doctype, user) \
|
||||||
and self.doc.name not in get_restrictions(user).get("Employee", []):
|
and self.doc.name not in get_restrictions(user).get("Employee", []):
|
||||||
|
|
||||||
frappe.defaults.add_default("Employee", self.doc.name, user, "Restriction")
|
frappe.defaults.add_default("Employee", self.doc.name, user, "Restriction")
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ class TestTimeLog(unittest.TestCase):
|
|||||||
|
|
||||||
test_records = [[{
|
test_records = [[{
|
||||||
"doctype": "Time Log",
|
"doctype": "Time Log",
|
||||||
"from_time": "2013-01-01 10:00:00",
|
"from_time": "2013-01-01 10:00:00.000000",
|
||||||
"to_time": "2013-01-01 11:00:00",
|
"to_time": "2013-01-01 11:00:00.000000",
|
||||||
"activity_type": "_Test Activity Type",
|
"activity_type": "_Test Activity Type",
|
||||||
"note": "_Test Note",
|
"note": "_Test Note",
|
||||||
"docstatus": 1
|
"docstatus": 1
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ class TimeLogBatchTest(unittest.TestCase):
|
|||||||
from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records
|
from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records
|
||||||
time_log = frappe.bean(copy=time_log_records[0])
|
time_log = frappe.bean(copy=time_log_records[0])
|
||||||
time_log.doc.fields.update({
|
time_log.doc.fields.update({
|
||||||
"from_time": "2013-01-02 10:00:00",
|
"from_time": "2013-01-02 10:00:00.000000",
|
||||||
"to_time": "2013-01-02 11:00:00",
|
"to_time": "2013-01-02 11:00:00.000000",
|
||||||
"docstatus": 0
|
"docstatus": 0
|
||||||
})
|
})
|
||||||
time_log.insert()
|
time_log.insert()
|
||||||
|
|||||||
Reference in New Issue
Block a user