mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
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:
@@ -76,7 +76,7 @@
|
|||||||
"options": "Activity Type",
|
"options": "Activity Type",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 1
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.time_log_for != 'Manufacturing'",
|
"depends_on": "eval:doc.time_log_for != 'Manufacturing'",
|
||||||
@@ -116,6 +116,7 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:doc.time_log_for == 'Manufacturing'",
|
||||||
"description": "Operation completed for how many finished goods?",
|
"description": "Operation completed for how many finished goods?",
|
||||||
"fieldname": "completed_qty",
|
"fieldname": "completed_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class TimeLog(Document):
|
|||||||
self.validate_time_log_for()
|
self.validate_time_log_for()
|
||||||
self.check_workstation_timings()
|
self.check_workstation_timings()
|
||||||
self.validate_production_order()
|
self.validate_production_order()
|
||||||
|
self.validate_project()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.update_production_order()
|
self.update_production_order()
|
||||||
@@ -127,6 +128,11 @@ class TimeLog(Document):
|
|||||||
from `tabTime Log`
|
from `tabTime Log`
|
||||||
where production_order = %s and operation = %s and docstatus=1""",
|
where production_order = %s and operation = %s and docstatus=1""",
|
||||||
(self.production_order, self.operation), as_dict=1)[0]
|
(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()
|
@frappe.whitelist()
|
||||||
def get_workstation(production_order, operation):
|
def get_workstation(production_order, operation):
|
||||||
|
|||||||
Reference in New Issue
Block a user