against_manufacturing renamed to for_manufacturing
This commit is contained in:
parent
bccec29415
commit
3fcd89f63e
@ -373,7 +373,7 @@ def get_events(start, end, filters=None):
|
||||
@frappe.whitelist()
|
||||
def make_time_log(name, operation, from_time, to_time, qty=None, project=None, workstation=None, operation_id=None):
|
||||
time_log = frappe.new_doc("Time Log")
|
||||
time_log.against_manufacturing = 1
|
||||
time_log.for_manufacturing = 1
|
||||
time_log.from_time = from_time
|
||||
time_log.to_time = to_time
|
||||
time_log.production_order = name
|
||||
|
@ -36,7 +36,7 @@ class TestTimeLog(unittest.TestCase):
|
||||
|
||||
time_log = frappe.get_doc({
|
||||
"doctype": "Time Log",
|
||||
"against_manufacturing": 1,
|
||||
"for_manufacturing": 1,
|
||||
"production_order": prod_order.name,
|
||||
"qty": 1,
|
||||
"from_time": "2014-12-26 00:00:00",
|
||||
@ -54,7 +54,7 @@ class TestTimeLog(unittest.TestCase):
|
||||
|
||||
time_log = frappe.get_doc({
|
||||
"doctype": "Time Log",
|
||||
"against_manufacturing": 1,
|
||||
"for_manufacturing": 1,
|
||||
"production_order": prod_order.name,
|
||||
"operation": prod_order.operations[0].operation,
|
||||
"operation_id": prod_order.operations[0].name,
|
||||
|
@ -5,7 +5,7 @@ frappe.provide("erpnext.projects");
|
||||
|
||||
frappe.ui.form.on("Time Log", "onload", function(frm) {
|
||||
frm.set_query("task", erpnext.queries.task);
|
||||
if (frm.doc.against_manufacturing) {
|
||||
if (frm.doc.for_manufacturing) {
|
||||
frappe.ui.form.trigger("Time Log", "production_order");
|
||||
}
|
||||
});
|
||||
|
@ -75,15 +75,15 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "against_manufacturing",
|
||||
"fieldname": "for_manufacturing",
|
||||
"fieldtype": "Check",
|
||||
"label": "Against Manufacturing",
|
||||
"label": "For Manufacturing",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.against_manufacturing",
|
||||
"depends_on": "eval:!doc.for_manufacturing",
|
||||
"fieldname": "activity_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 0,
|
||||
@ -94,7 +94,7 @@
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.against_manufacturing",
|
||||
"depends_on": "eval:!doc.for_manufacturing",
|
||||
"fieldname": "task",
|
||||
"fieldtype": "Link",
|
||||
"label": "Task",
|
||||
@ -103,7 +103,7 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.against_manufacturing",
|
||||
"depends_on": "eval:doc.for_manufacturing",
|
||||
"fieldname": "section_break_11",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0,
|
||||
@ -242,7 +242,7 @@
|
||||
"icon": "icon-time",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-03-24 07:10:31.412669",
|
||||
"modified": "2015-03-24 08:10:31.412670",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Time Log",
|
||||
|
@ -103,9 +103,11 @@ class TimeLog(Document):
|
||||
self.hours = flt(time_diff_in_seconds(self.to_time, self.from_time)) / 3600
|
||||
|
||||
def validate_time_log_for(self):
|
||||
if not self.against_manufacturing:
|
||||
if not self.for_manufacturing:
|
||||
for fld in ["production_order", "operation", "workstation", "completed_qty"]:
|
||||
self.set(fld, None)
|
||||
else:
|
||||
self.activity_type=None
|
||||
|
||||
def check_workstation_timings(self):
|
||||
"""Checks if **Time Log** is between operating hours of the **Workstation**."""
|
||||
@ -122,7 +124,7 @@ class TimeLog(Document):
|
||||
def update_production_order(self):
|
||||
"""Updates `start_date`, `end_date`, `status` for operation in Production Order."""
|
||||
|
||||
if self.against_manufacturing and self.production_order:
|
||||
if self.for_manufacturing and self.production_order:
|
||||
if not self.operation_id:
|
||||
frappe.throw(_("Operation ID not set"))
|
||||
|
||||
@ -185,7 +187,7 @@ class TimeLog(Document):
|
||||
(self.production_order, self.operation_id), as_dict=1)[0]
|
||||
|
||||
def validate_manufacturing(self):
|
||||
if self.against_manufacturing:
|
||||
if self.for_manufacturing:
|
||||
if not self.production_order:
|
||||
frappe.throw(_("Production Order is Mandatory"))
|
||||
if not self.operation:
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// render
|
||||
frappe.listview_settings['Time Log'] = {
|
||||
add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "against_manufacturing"],
|
||||
add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "for_manufacturing"],
|
||||
selectable: true,
|
||||
onload: function(me) {
|
||||
me.page.add_menu_item(__("Make Time Log Batch"), function() {
|
||||
|
@ -35,7 +35,7 @@ def create_time_log():
|
||||
"from_time": "2013-01-02 10:00:00.000000",
|
||||
"to_time": "2013-01-02 11:00:00.000000",
|
||||
"docstatus": 0,
|
||||
"against_manufacturing": 0
|
||||
"for_manufacturing": 0
|
||||
})
|
||||
time_log.insert()
|
||||
time_log.submit()
|
||||
|
Loading…
Reference in New Issue
Block a user