mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
This commit is contained in:
@@ -47,7 +47,7 @@ class Project(Document):
|
||||
for milestone in self.get("project_milestones"):
|
||||
if milestone.milestone_date:
|
||||
description = (milestone.milestone or "Milestone") + " for " + self.name
|
||||
frappe.bean({
|
||||
frappe.get_doc({
|
||||
"doctype": "Event",
|
||||
"owner": self.owner,
|
||||
"subject": description,
|
||||
|
||||
@@ -44,7 +44,7 @@ class Task(Document):
|
||||
def on_update(self):
|
||||
"""update percent complete in project"""
|
||||
if self.project:
|
||||
project = frappe.bean("Project", self.project)
|
||||
project = frappe.get_doc("Project", self.project)
|
||||
project.run_method("update_percent_complete")
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
@@ -8,7 +8,7 @@ from erpnext.projects.doctype.time_log.time_log import OverlapError
|
||||
|
||||
class TestTimeLog(unittest.TestCase):
|
||||
def test_duplication(self):
|
||||
ts = frappe.bean(frappe.copy_doc(test_records[0]))
|
||||
ts = frappe.get_doc(frappe.copy_doc(test_records[0]))
|
||||
self.assertRaises(OverlapError, ts.insert)
|
||||
|
||||
test_records = [[{
|
||||
|
||||
@@ -6,7 +6,7 @@ import frappe, unittest
|
||||
class TimeLogBatchTest(unittest.TestCase):
|
||||
def test_time_log_status(self):
|
||||
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.get_doc(copy=time_log_records[0])
|
||||
time_log.update({
|
||||
"from_time": "2013-01-02 10:00:00.000000",
|
||||
"to_time": "2013-01-02 11:00:00.000000",
|
||||
@@ -16,7 +16,7 @@ class TimeLogBatchTest(unittest.TestCase):
|
||||
time_log.submit()
|
||||
|
||||
self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted")
|
||||
tlb = frappe.bean(copy=test_records[0])
|
||||
tlb = frappe.get_doc(copy=test_records[0])
|
||||
tlb.doclist[1].time_log = time_log.name
|
||||
tlb.insert()
|
||||
tlb.submit()
|
||||
|
||||
@@ -15,7 +15,7 @@ class TimeLogBatch(Document):
|
||||
self.set_status()
|
||||
self.total_hours = 0.0
|
||||
for d in self.doclist.get({"doctype":"Time Log Batch Detail"}):
|
||||
tl = frappe.doc("Time Log", d.time_log)
|
||||
tl = frappe.get_doc("Time Log", d.time_log)
|
||||
self.update_time_log_values(d, tl)
|
||||
self.validate_time_log_is_submitted(tl)
|
||||
self.total_hours += float(tl.hours or 0.0)
|
||||
@@ -54,7 +54,7 @@ class TimeLogBatch(Document):
|
||||
def update_status(self, time_log_batch):
|
||||
self.set_status()
|
||||
for d in self.doclist.get({"doctype":"Time Log Batch Detail"}):
|
||||
tl = frappe.bean("Time Log", d.time_log)
|
||||
tl = frappe.get_doc("Time Log", d.time_log)
|
||||
tl.time_log_batch = time_log_batch
|
||||
tl.sales_invoice = self.sales_invoice
|
||||
tl.update_after_submit()
|
||||
Reference in New Issue
Block a user