mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 05:58:27 +00:00
chore: whitespace cleanup from codebase
This commit is contained in:
@@ -1 +1 @@
|
||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||
|
||||
@@ -13,7 +13,7 @@ class ActivityCost(Document):
|
||||
def validate(self):
|
||||
self.set_title()
|
||||
self.check_unique()
|
||||
|
||||
|
||||
def set_title(self):
|
||||
if self.employee:
|
||||
if not self.employee_name:
|
||||
|
||||
@@ -22,4 +22,4 @@ class TestActivityCost(unittest.TestCase):
|
||||
activity_cost1.insert()
|
||||
activity_cost2 = frappe.copy_doc(activity_cost1)
|
||||
self.assertRaises(DuplicationError, activity_cost2.insert )
|
||||
frappe.db.sql("delete from `tabActivity Cost`")
|
||||
frappe.db.sql("delete from `tabActivity Cost`")
|
||||
|
||||
@@ -5,4 +5,4 @@ from __future__ import unicode_literals
|
||||
from frappe.model.document import Document
|
||||
|
||||
class ActivityType(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -4,4 +4,4 @@ from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Activity Type')
|
||||
test_records = frappe.get_test_records('Activity Type')
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -22,7 +22,7 @@ class ProjectTemplate(Document):
|
||||
task_details_format = get_link_to_form("Task",task_details.name)
|
||||
dependency_task_format = get_link_to_form("Task", dependency_task.task)
|
||||
frappe.throw(_("Task {0} depends on Task {1}. Please add Task {1} to the Tasks list.").format(frappe.bold(task_details_format), frappe.bold(dependency_task_format)))
|
||||
|
||||
|
||||
def check_dependent_task_presence(self, task):
|
||||
for task_details in self.tasks:
|
||||
if task_details.task == task:
|
||||
|
||||
@@ -26,4 +26,4 @@ def make_project_template(project_template_name, project_tasks=[]):
|
||||
})
|
||||
doc.insert()
|
||||
|
||||
return frappe.get_doc('Project Template', project_template_name)
|
||||
return frappe.get_doc('Project Template', project_template_name)
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
frappe.ui.form.on('Project Type', {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,4 +10,4 @@ from frappe import _
|
||||
class ProjectType(Document):
|
||||
def on_trash(self):
|
||||
if self.name == "External":
|
||||
frappe.throw(_("You cannot delete Project Type 'External'"))
|
||||
frappe.throw(_("You cannot delete Project Type 'External'"))
|
||||
|
||||
@@ -39,4 +39,4 @@ def email_sending(project_name,frequency,date_start,date_end,progress,number_of_
|
||||
for emails in email:
|
||||
frappe.sendmail(recipients=emails,subject=frappe._(project_name + ' ' + 'Summary'),message = msg)
|
||||
else:
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -10,4 +10,4 @@ class TestProjectUpdate(unittest.TestCase):
|
||||
pass
|
||||
|
||||
test_records = frappe.get_test_records('Project Update')
|
||||
test_ignore = ["Sales Order"]
|
||||
test_ignore = ["Sales Order"]
|
||||
|
||||
@@ -81,4 +81,4 @@ frappe.treeview_settings['Task'] = {
|
||||
}
|
||||
],
|
||||
extend_toolbar: true
|
||||
};
|
||||
};
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
.playpause {
|
||||
border-right: 1px dashed #fff;
|
||||
border-bottom: 1px dashed #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,4 +399,4 @@ function set_project_in_timelog(frm) {
|
||||
frappe.model.set_value(item.doctype, item.name, "project", frm.doc.parent_project);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,9 +238,9 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_timesheet_detail_rate(timelog, currency):
|
||||
timelog_detail = frappe.db.sql("""SELECT tsd.billing_amount as billing_amount,
|
||||
ts.currency as currency FROM `tabTimesheet Detail` tsd
|
||||
INNER JOIN `tabTimesheet` ts ON ts.name=tsd.parent
|
||||
timelog_detail = frappe.db.sql("""SELECT tsd.billing_amount as billing_amount,
|
||||
ts.currency as currency FROM `tabTimesheet Detail` tsd
|
||||
INNER JOIN `tabTimesheet` ts ON ts.name=tsd.parent
|
||||
WHERE tsd.name = '{0}'""".format(timelog), as_dict = 1)[0]
|
||||
|
||||
if timelog_detail.currency:
|
||||
|
||||
@@ -9,8 +9,8 @@ frappe.views.calendar["Timesheet"] = {
|
||||
"title": "title"
|
||||
},
|
||||
style_map: {
|
||||
"0": "info",
|
||||
"1": "standard",
|
||||
"0": "info",
|
||||
"1": "standard",
|
||||
"2": "danger"
|
||||
},
|
||||
gantt: true,
|
||||
|
||||
@@ -10,4 +10,4 @@ def get_data():
|
||||
'items': ['Sales Invoice', 'Salary Slip']
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ frappe.listview_settings['Timesheet'] = {
|
||||
if (doc.status== "Billed") {
|
||||
return [__("Billed"), "green", "status,=," + "Billed"]
|
||||
}
|
||||
|
||||
|
||||
if (doc.status== "Payslip") {
|
||||
return [__("Payslip"), "green", "status,=," + "Payslip"]
|
||||
}
|
||||
|
||||
|
||||
if (doc.status== "Completed") {
|
||||
return [__("Completed"), "green", "status,=," + "Completed"]
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -144,4 +144,4 @@ def get_billable_and_total_duration(activity, start_time, end_time):
|
||||
if activity_duration != activity.billing_hours:
|
||||
billing_duration = activity_duration * activity.billing_hours / activity.hours
|
||||
|
||||
return flt(activity_duration, precision), flt(billing_duration, precision)
|
||||
return flt(activity_duration, precision), flt(billing_duration, precision)
|
||||
|
||||
@@ -20,8 +20,8 @@ def execute(filters=None):
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150",
|
||||
_("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70",
|
||||
return [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150",
|
||||
_("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70",
|
||||
_("Activity Type") + "::120", _("Task") + ":Link/Task:150",
|
||||
_("Project") + ":Link/Project:120", _("Status") + "::70"]
|
||||
|
||||
@@ -45,4 +45,4 @@ def get_conditions(filters):
|
||||
if match_conditions:
|
||||
conditions += " and %s" % match_conditions
|
||||
|
||||
return conditions
|
||||
return conditions
|
||||
|
||||
@@ -10,7 +10,7 @@ class TestDelayedTasksSummary(unittest.TestCase):
|
||||
def setUp(self):
|
||||
task1 = create_task("_Test Task 98", add_days(nowdate(), -10), nowdate())
|
||||
create_task("_Test Task 99", add_days(nowdate(), -10), add_days(nowdate(), -1))
|
||||
|
||||
|
||||
task1.status = "Completed"
|
||||
task1.completed_on = add_days(nowdate(), -1)
|
||||
task1.save()
|
||||
@@ -38,7 +38,7 @@ class TestDelayedTasksSummary(unittest.TestCase):
|
||||
]
|
||||
report = execute(filters)
|
||||
data = list(filter(lambda x: x.subject == "_Test Task 99", report[1]))[0]
|
||||
|
||||
|
||||
for key in ["subject", "status", "priority", "delay"]:
|
||||
self.assertEqual(expected_data[0].get(key), data.get(key))
|
||||
|
||||
@@ -51,4 +51,4 @@ class TestDelayedTasksSummary(unittest.TestCase):
|
||||
|
||||
def tearDown(self):
|
||||
for task in ["_Test Task 98", "_Test Task 99"]:
|
||||
frappe.get_doc("Task", {"subject": task}).delete()
|
||||
frappe.get_doc("Task", {"subject": task}).delete()
|
||||
|
||||
@@ -11,4 +11,4 @@ def execute(filters=None):
|
||||
columns = get_columns()
|
||||
|
||||
data = get_data(filters)
|
||||
return columns, data
|
||||
return columns, data
|
||||
|
||||
@@ -195,4 +195,4 @@ class TestEmployeeUtilization(unittest.TestCase):
|
||||
'per_util': 27.78,
|
||||
'per_util_billed_only': 27.78
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -11,4 +11,4 @@ def execute(filters=None):
|
||||
columns = get_columns()
|
||||
|
||||
data = get_data(filters)
|
||||
return columns, data
|
||||
return columns, data
|
||||
|
||||
@@ -208,4 +208,4 @@ def get_columns():
|
||||
"options": "Currency",
|
||||
"width": 80
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ def get_context(context):
|
||||
if frappe.form_dict.project:
|
||||
context.parents = [{'title': frappe.form_dict.project, 'route': '/projects?project='+ frappe.form_dict.project}]
|
||||
context.success_url = "/projects?project=" + frappe.form_dict.project
|
||||
|
||||
|
||||
elif context.doc and context.doc.get('project'):
|
||||
context.parents = [{'title': context.doc.project, 'route': '/projects?project='+ context.doc.project}]
|
||||
context.success_url = "/projects?project=" + context.doc.project
|
||||
|
||||
Reference in New Issue
Block a user