fix(cleanup): cleaned up forms

This commit is contained in:
Rushabh Mehta 2020-10-26 15:30:52 +05:30
parent ce95bc2ce0
commit ea49e30bfd
24 changed files with 345 additions and 139 deletions

View File

@ -53,7 +53,7 @@ def execute():
# renamed reports from "Minutes to First Response for Issues" to "First Response Time for Issues". Same for Opportunity
for report in ['Minutes to First Response for Issues', 'Minutes to First Response for Opportunity']:
if frappe.db.exists('Report', report):
frappe.delete_doc('Report', report)
frappe.delete_doc('Report', report, ignore_permissions=True)
def convert_to_seconds(value, unit):

View File

@ -18,7 +18,7 @@
{
"hidden": 0,
"label": "Review and Action",
"links": "[\n {\n \"description\": \"Quality Review\",\n \"label\": \"Quality Review\",\n \"name\": \"Quality Review\",\n \"onboard\": 1,\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Quality Action\",\n \"label\": \"Quality Action\",\n \"name\": \"Quality Action\",\n \"type\": \"doctype\"\n }\n]"
"links": "[\n {\n \"description\": \"Non Conformance\",\n \"label\": \"Non Conformance\",\n \"name\": \"Non Conformance\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Quality Review\",\n \"label\": \"Quality Review\",\n \"name\": \"Quality Review\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Quality Action\",\n \"label\": \"Quality Action\",\n \"name\": \"Quality Action\",\n \"type\": \"doctype\"\n }\n]"
}
],
"category": "Modules",
@ -29,11 +29,11 @@
"docstatus": 0,
"doctype": "Desk Page",
"extends_another_page": 0,
"icon": "",
"hide_custom": 0,
"idx": 0,
"is_standard": 1,
"label": "Quality",
"modified": "2020-04-01 11:28:51.095012",
"modified": "2020-10-26 15:24:58.058088",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality",
@ -55,6 +55,27 @@
"label": "Quality Inspection",
"link_to": "Quality Inspection",
"type": "DocType"
},
{
"doc_view": "",
"label": "Quality Review",
"link_to": "Quality Review",
"type": "DocType"
},
{
"color": "#ff8989",
"doc_view": "",
"format": "{} Open",
"label": "Quality Action",
"link_to": "Quality Action",
"stats_filter": "{\"status\": \"Open\"}",
"type": "DocType"
},
{
"doc_view": "",
"label": "Non Conformance",
"link_to": "Non Conformance",
"type": "DocType"
}
]
}

View File

@ -0,0 +1,8 @@
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Non Conformance', {
// refresh: function(frm) {
// }
});

View File

@ -0,0 +1,118 @@
{
"actions": [],
"autoname": "format:QA-NC-{#####}",
"creation": "2020-10-21 14:49:50.350136",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"subject",
"procedure",
"process_owner",
"full_name",
"column_break_4",
"status",
"section_break_4",
"details",
"corrective_action",
"preventive_action"
],
"fields": [
{
"fieldname": "subject",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Subject",
"reqd": 1
},
{
"fieldname": "procedure",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Procedure",
"options": "Quality Procedure",
"reqd": 1
},
{
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Open\nResolved\nCancelled",
"reqd": 1
},
{
"fieldname": "section_break_4",
"fieldtype": "Section Break"
},
{
"fieldname": "details",
"fieldtype": "Text Editor",
"label": "Details"
},
{
"fetch_from": "procedure.process_owner",
"fieldname": "process_owner",
"fieldtype": "Data",
"label": "Process Owner",
"read_only": 1
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fetch_from": "process_owner.full_name",
"fieldname": "full_name",
"fieldtype": "Data",
"hidden": 1,
"label": "Full Name"
},
{
"fieldname": "corrective_action",
"fieldtype": "Text",
"label": "Corrective Action"
},
{
"fieldname": "preventive_action",
"fieldtype": "Text",
"label": "Preventive Action"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2020-10-26 15:27:47.247814",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Non Conformance",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Employee",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class NonConformance(Document):
pass

View File

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestNonConformance(unittest.TestCase):
pass

View File

@ -2,32 +2,5 @@
// For license information, please see license.txt
frappe.ui.form.on('Quality Action', {
onload: function(frm) {
frm.set_value("date", frappe.datetime.get_today());
frm.refresh();
},
document_name: function(frm){
frappe.call({
"method": "frappe.client.get",
args: {
doctype: frm.doc.document_type,
name: frm.doc.document_name
},
callback: function(data){
frm.fields_dict.resolutions.grid.remove_all();
let objectives = [];
if(frm.doc.document_type === "Quality Review"){
for(let i in data.message.reviews) objectives.push(data.message.reviews[i].review);
} else {
for(let j in data.message.parameters) objectives.push(data.message.parameters[j].feedback);
}
for (var objective in objectives){
frm.add_child("resolutions");
frm.fields_dict.resolutions.get_value()[objective].problem = objectives[objective];
}
frm.refresh();
}
});
},
});

View File

@ -1,32 +1,34 @@
{
"autoname": "format:ACTN-{#####}",
"actions": [],
"autoname": "format:QA-ACT-{#####}",
"creation": "2018-10-02 11:40:43.666100",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"corrective_preventive",
"document_type",
"goal",
"review",
"feedback",
"status",
"cb_00",
"date",
"document_name",
"goal",
"procedure",
"status",
"sb_00",
"resolutions"
],
"fields": [
{
"depends_on": "eval:doc.type == 'Quality Review'",
"fetch_from": "review.goal",
"fieldname": "goal",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Goal",
"options": "Quality Goal",
"read_only": 1
"options": "Quality Goal"
},
{
"default": "Today",
"fieldname": "date",
"fieldtype": "Date",
"in_list_view": 1,
@ -34,34 +36,20 @@
"read_only": 1
},
{
"depends_on": "eval:doc.type == 'Quality Review'",
"fieldname": "procedure",
"fieldtype": "Link",
"label": "Procedure",
"options": "Quality Procedure",
"read_only": 1
"options": "Quality Procedure"
},
{
"default": "Open",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
"options": "Open\nClosed"
},
{
"fieldname": "document_name",
"fieldtype": "Dynamic Link",
"label": "Document Name",
"options": "document_type"
},
{
"fieldname": "document_type",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Document Type",
"options": "Quality Review\nQuality Feedback",
"reqd": 1
"options": "Open\nCompleted",
"read_only": 1
},
{
"default": "Corrective",
@ -86,9 +74,25 @@
"fieldtype": "Table",
"label": "Resolutions",
"options": "Quality Action Resolution"
},
{
"fieldname": "review",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Review",
"options": "Quality Review",
"reqd": 1
},
{
"fieldname": "feedback",
"fieldtype": "Link",
"label": "Feedback",
"options": "Quality Feedback"
}
],
"modified": "2019-05-28 13:10:44.092497",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2020-10-21 13:01:31.920215",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Action",

View File

@ -7,4 +7,5 @@ import frappe
from frappe.model.document import Document
class QualityAction(Document):
pass
def validate(self):
self.status = 'Open' if any([d.status=='Open' for d in self.resolutions]) else 'Completed'

View File

@ -1,33 +1,54 @@
{
"actions": [],
"creation": "2019-05-26 20:36:44.337186",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"problem",
"sb_00",
"resolution"
"resolution",
"status",
"responsible",
"completion_by"
],
"fields": [
{
"fieldname": "problem",
"fieldtype": "Long Text",
"in_list_view": 1,
"label": "Review"
},
{
"fieldname": "sb_00",
"fieldtype": "Section Break"
"label": "Problem"
},
{
"fieldname": "resolution",
"fieldtype": "Text Editor",
"in_list_view": 1,
"label": "Resolution"
},
{
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Open\nCompleted"
},
{
"fieldname": "responsible",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Responsible",
"options": "User"
},
{
"fieldname": "completion_by",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Completion By"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"modified": "2019-05-28 13:09:50.435323",
"links": [],
"modified": "2020-10-21 12:59:25.566682",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Action Resolution",

View File

@ -1,6 +1,6 @@
{
"actions": [],
"autoname": "format:FDBK-{#####}",
"autoname": "format:QA-FB-{#####}",
"creation": "2019-05-26 21:23:05.308379",
"doctype": "DocType",
"editable_grid": 1,
@ -60,7 +60,7 @@
}
],
"links": [],
"modified": "2020-07-03 15:50:58.589302",
"modified": "2020-10-21 12:39:20.740854",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Feedback",

View File

@ -1,6 +1,6 @@
{
"actions": [],
"autoname": "format:TMPL-{template}",
"autoname": "field:template",
"creation": "2019-05-26 21:17:24.283061",
"doctype": "DocType",
"editable_grid": 1,
@ -17,7 +17,8 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Template",
"reqd": 1
"reqd": 1,
"unique": 1
},
{
"fieldname": "cb_00",
@ -36,7 +37,7 @@
}
],
"links": [],
"modified": "2020-07-03 16:06:03.749415",
"modified": "2020-10-21 12:39:02.221128",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Feedback Template",

View File

@ -1,5 +1,6 @@
{
"autoname": "format:GOAL-{goal}",
"actions": [],
"autoname": "field:goal",
"creation": "2018-10-02 12:17:41.727541",
"doctype": "DocType",
"editable_grid": 1,
@ -112,7 +113,15 @@
"read_only": 1
}
],
"modified": "2019-05-28 14:49:12.768863",
"index_web_pages_for_search": 1,
"links": [
{
"group": "Review",
"link_doctype": "Quality Review",
"link_fieldname": "goal"
}
],
"modified": "2020-10-21 12:49:38.251228",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Goal",

View File

@ -1,12 +0,0 @@
from frappe import _
def get_data():
return {
'fieldname': 'goal',
'transactions': [
{
'label': _('Review'),
'items': ['Quality Review']
}
]
}

View File

@ -1,12 +1,11 @@
{
"actions": [],
"autoname": "naming_series:",
"autoname": "format:QA-MEET-{YY}-{MM}-{DD}",
"creation": "2018-10-15 16:25:41.548432",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"naming_series",
"date",
"cb_00",
"status",
@ -55,16 +54,11 @@
"fieldname": "sb_01",
"fieldtype": "Section Break",
"label": "Minutes"
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Naming Series",
"options": "MTNG-.YYYY.-.MM.-.DD.-"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2020-05-19 13:18:59.821740",
"modified": "2020-10-21 13:08:50.367577",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Meeting",

View File

@ -1,19 +1,22 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:PRC-{quality_procedure_name}",
"autoname": "field:quality_procedure_name",
"creation": "2018-10-06 00:06:29.756804",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"quality_procedure_name",
"process_owner",
"process_owner_full_name",
"section_break_3",
"processes",
"sb_00",
"parent_quality_procedure",
"is_group",
"sb_00",
"processes",
"lft",
"rgt",
"lft",
"old_parent"
],
"fields": [
@ -34,14 +37,14 @@
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
"label": "Lft",
"label": "Left Index",
"read_only": 1
},
{
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
"label": "Rgt",
"label": "Right Index",
"read_only": 1
},
{
@ -54,7 +57,7 @@
{
"fieldname": "sb_00",
"fieldtype": "Section Break",
"label": "Processes"
"label": "Parent"
},
{
"fieldname": "processes",
@ -67,12 +70,52 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Quality Procedure",
"reqd": 1
"reqd": 1,
"unique": 1
},
{
"fieldname": "process_owner",
"fieldtype": "Link",
"label": "Process Owner",
"options": "User"
},
{
"fieldname": "section_break_3",
"fieldtype": "Section Break"
},
{
"fetch_from": "process_owner.full_name",
"fieldname": "process_owner_full_name",
"fieldtype": "Data",
"hidden": 1,
"label": "Process Owner Full Name",
"print_hide": 1
}
],
"is_tree": 1,
"links": [],
"modified": "2020-10-13 11:46:07.744194",
"links": [
{
"group": "Reviews",
"link_doctype": "Quality Review",
"link_fieldname": "procedure"
},
{
"group": "Goals",
"link_doctype": "Quality Goal",
"link_fieldname": "procedure"
},
{
"group": "Actions",
"link_doctype": "Quality Action",
"link_fieldname": "procedure"
},
{
"group": "Actions",
"link_doctype": "Non Conformance",
"link_fieldname": "procedure"
}
],
"modified": "2020-10-26 15:25:39.316088",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Procedure",

View File

@ -1,20 +0,0 @@
from frappe import _
def get_data():
return {
'fieldname': 'procedure',
'transactions': [
{
'label': _('Goal'),
'items': ['Quality Goal']
},
{
'label': _('Review'),
'items': ['Quality Review']
},
{
'label': _('Action'),
'items': ['Quality Action']
}
],
}

View File

@ -10,6 +10,7 @@
],
"fields": [
{
"columns": 8,
"fieldname": "process_description",
"fieldtype": "Text Editor",
"in_list_view": 1,
@ -20,13 +21,14 @@
"fieldname": "procedure",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Child Procedure",
"label": "Sub Produre",
"options": "Quality Procedure"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-06-17 15:44:38.937915",
"modified": "2020-10-21 12:10:23.790655",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Procedure Process",

View File

@ -2,9 +2,6 @@
// For license information, please see license.txt
frappe.ui.form.on('Quality Review', {
onload: function(frm){
frm.set_value("date", frappe.datetime.get_today());
},
goal: function(frm) {
frappe.call({
"method": "frappe.client.get",

View File

@ -1,6 +1,6 @@
{
"actions": [],
"autoname": "format:REV-{#####}",
"autoname": "format:QA-REV-{#####}",
"creation": "2018-10-02 11:45:16.301955",
"doctype": "DocType",
"editable_grid": 1,
@ -18,6 +18,7 @@
],
"fields": [
{
"default": "Today",
"fieldname": "date",
"fieldtype": "Date",
"in_list_view": 1,
@ -50,7 +51,7 @@
"collapsible": 1,
"fieldname": "sb_01",
"fieldtype": "Section Break",
"label": "Additional Information"
"label": "Notes"
},
{
"fieldname": "reviews",
@ -63,7 +64,8 @@
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "Open\nClosed"
"options": "Open\nPassed\nFailed",
"read_only": 1
},
{
"fieldname": "goal",
@ -74,8 +76,15 @@
"reqd": 1
}
],
"links": [],
"modified": "2020-02-01 10:59:38.933115",
"index_web_pages_for_search": 1,
"links": [
{
"group": "Review",
"link_doctype": "Quality Action",
"link_fieldname": "review"
}
],
"modified": "2020-10-21 12:56:47.046172",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Review",
@ -120,5 +129,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "goal",
"track_changes": 1
}

View File

@ -7,7 +7,9 @@ import frappe
from frappe.model.document import Document
class QualityReview(Document):
pass
def validate(self):
# if any child item is failed, fail the parent
self.status = 'Failed' if any([d.status=='Failed' for d in self.reviews]) else 'Passed'
def review():
day = frappe.utils.getdate().day

View File

@ -1,4 +1,5 @@
{
"actions": [],
"creation": "2019-05-26 15:17:44.796958",
"doctype": "DocType",
"editable_grid": 1,
@ -9,10 +10,12 @@
"target",
"uom",
"sb_00",
"status",
"review"
],
"fields": [
{
"columns": 3,
"fieldname": "objective",
"fieldtype": "Text",
"in_list_view": 1,
@ -20,6 +23,7 @@
"read_only": 1
},
{
"columns": 2,
"fieldname": "target",
"fieldtype": "Data",
"in_list_view": 1,
@ -27,6 +31,7 @@
"read_only": 1
},
{
"columns": 1,
"fetch_from": "target_unit",
"fieldname": "uom",
"fieldtype": "Link",
@ -49,10 +54,20 @@
{
"fieldname": "cb_00",
"fieldtype": "Column Break"
},
{
"columns": 2,
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Passed\nFailed"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"modified": "2019-05-26 16:14:12.586128",
"links": [],
"modified": "2020-10-21 12:21:18.460863",
"modified_by": "Administrator",
"module": "Quality Management",
"name": "Quality Review Objective",

View File

@ -236,7 +236,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-12 16:11:31.910508",
"modified": "2020-10-21 13:03:11.938072",
"modified_by": "Administrator",
"module": "Stock",
"name": "Quality Inspection",
@ -257,7 +257,6 @@
"write": 1
}
],
"quick_entry": 1,
"search_fields": "item_code, report_date, reference_name",
"show_name_in_global_search": 1,
"sort_field": "modified",