Time Log -

Project made compulsory for time logs with time_log_for selected as 'Project'
Activity Type Madetory criteria removed
Compleated Quantity hidden if time_log_for is not set as Manufacturing
This commit is contained in:
Neil Trini Lasrado 2015-01-30 19:55:26 +05:30
parent e7cf961eaa
commit 93638bd179
2 changed files with 8 additions and 1 deletions

View File

@ -76,7 +76,7 @@
"options": "Activity Type",
"permlevel": 0,
"read_only": 0,
"reqd": 1
"reqd": 0
},
{
"depends_on": "eval:doc.time_log_for != 'Manufacturing'",
@ -116,6 +116,7 @@
"read_only": 1
},
{
"depends_on": "eval:doc.time_log_for == 'Manufacturing'",
"description": "Operation completed for how many finished goods?",
"fieldname": "completed_qty",
"fieldtype": "Float",

View File

@ -23,6 +23,7 @@ class TimeLog(Document):
self.validate_time_log_for()
self.check_workstation_timings()
self.validate_production_order()
self.validate_project()
def on_submit(self):
self.update_production_order()
@ -127,6 +128,11 @@ class TimeLog(Document):
from `tabTime Log`
where production_order = %s and operation = %s and docstatus=1""",
(self.production_order, self.operation), as_dict=1)[0]
def validate_project(self):
if self.time_log_for == 'Project':
if not self.project:
frappe.throw(_("Project is Mandatory."))
@frappe.whitelist()
def get_workstation(production_order, operation):