[git fixes] salary manager, time log title, notificaitons

This commit is contained in:
Rushabh Mehta
2015-02-26 15:01:23 +05:30
parent e693f794f5
commit 2cc585f180
15 changed files with 97 additions and 70 deletions

View File

@@ -229,12 +229,20 @@
"permlevel": 1,
"print_hide": 1,
"read_only": 0
},
{
"fieldname": "title",
"fieldtype": "Data",
"hidden": 1,
"label": "Title",
"permlevel": 0,
"precision": ""
}
],
"icon": "icon-time",
"idx": 1,
"is_submittable": 1,
"modified": "2015-02-24 03:57:27.652685",
"modified": "2015-02-26 02:22:10.312376",
"modified_by": "Administrator",
"module": "Projects",
"name": "Time Log",
@@ -271,5 +279,5 @@
"write": 1
}
],
"title_field": "activity_type"
"title_field": "title"
}

View File

@@ -1,8 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
@@ -19,6 +17,7 @@ from frappe.model.document import Document
class TimeLog(Document):
def validate(self):
self.set_status()
self.set_title()
self.validate_overlap()
self.validate_timings()
self.calculate_total_hours()
@@ -53,6 +52,16 @@ class TimeLog(Document):
if self.sales_invoice:
self.status="Billed"
def set_title(self):
if self.production_order:
self.title = _("{0} for {1}").format(self.operation, self.production_order)
elif self.task:
self.title = _("{0} for {1}").format(self.activity_type, self.task)
elif self.project:
self.title = _("{0} for {1}").format(self.activity_type, self.project)
else:
self.title = self.activity_type
def validate_overlap(self):
"""Checks if 'Time Log' entries overlap for a user, workstation. """
self.validate_overlap_for("user")