Browse Source
* Added QMS to ERPNext * changes * fixed * code refracted * refracted * some bugs fixed * changes * changes * test case * bug fix unit test * bug fix * refracted code * test warning fix * test case bug fix * removed whitespace * indentation bug fix * unit test bug fix * fixed Tree * bug fix * bug fix * code refactor * fixed procedure tree * removed unnecessary fields * hide fields * removed depricated unit test method * sql injection bug fix * code refactor and added mandatory fields * Removed Add Child from TreeView * Unit Test crashes Fix * code refactor * Fixed Status of Action * removed add button from Chart of Procedure * Fixed Unit Test for Quality Action * Chamged Measurement Unit to UOM * Changed Measurement Unit to UOM * Quality Action Unit Test Fix * Renamed Chart of Procedures to Tree of Procedures * Changes Objective input type to Text * Code Refactor * Quality Action Status option changed to "Close" for consistency * fixed action status indicator * Removed vscode folder * unit tests optimization * unit test fixes * code refactor * gitignore * bug fixes and code refactor * code refactor * unit test changes * changed quality action unit test * code refactor * code refactor * code refactor * indentation * code refactor * corrected typo * Removed jQuery hide() * code refracted * remove grid elements * Removed unnecessary conditions * onload fixed in feedback * code refracted * Removed add row button from Review and Customer Feedback * made autofill feild read only * automated scheduling of reviewdevelop
Himanshu
6 years ago
committed by
Rushabh Mehta
81 changed files with 5229 additions and 1 deletions
@ -0,0 +1,69 @@ |
|||
from __future__ import unicode_literals |
|||
from frappe import _ |
|||
|
|||
def get_data(): |
|||
return [ |
|||
{ |
|||
"label": _("Goal and Procedure"), |
|||
"items": [ |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Goal", |
|||
"description":_("Quality Goal."), |
|||
}, |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Procedure", |
|||
"description":_("Quality Procedure."), |
|||
}, |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Procedure", |
|||
"icon": "fa fa-sitemap", |
|||
"label": _("Tree of Procedures"), |
|||
"route": "Tree/Quality Procedure", |
|||
"description": _("Tree of Quality Procedures."), |
|||
}, |
|||
] |
|||
}, |
|||
{ |
|||
"label": _("Review and Action"), |
|||
"items": [ |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Review", |
|||
"description":_("Quality Review"), |
|||
}, |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Action", |
|||
"description":_("Quality Action"), |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"label": _("Meeting"), |
|||
"items": [ |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Quality Meeting", |
|||
"description":_("Quality Meeting"), |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"label": _("Feedback"), |
|||
"items": [ |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Customer Feedback", |
|||
"description":_("Customer Feedback"), |
|||
}, |
|||
{ |
|||
"type": "doctype", |
|||
"name": "Customer Feedback Template", |
|||
"description":_("Customer Feedback Template"), |
|||
} |
|||
] |
|||
}, |
|||
] |
@ -0,0 +1,29 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Customer Feedback', { |
|||
onload: function(frm){ |
|||
frm.set_value("date", frappe.datetime.get_today()); |
|||
$(".grid-add-row").hide(); |
|||
frm.refresh(); |
|||
}, |
|||
template: function(frm){ // Used to fetch the parameters of the selected feedback template
|
|||
frm.fields_dict.feedback.grid.remove_all(); |
|||
if(frm.doc.template){ |
|||
frappe.call({ |
|||
"method": "frappe.client.get", |
|||
args: { |
|||
doctype: "Customer Feedback Template", |
|||
name: frm.doc.template |
|||
}, |
|||
callback: function (data) { |
|||
for (var i = 0; i < data.message.feedback_parameter.length; i++ ){ |
|||
frm.add_child("feedback"); |
|||
frm.fields_dict.feedback.get_value()[i].parameter = data.message.feedback_parameter[i].parameter; |
|||
} |
|||
frm.refresh(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
@ -0,0 +1,259 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "QMS-FDBK-.#####", |
|||
"beta": 0, |
|||
"creation": "2018-10-02 12:23:38.437696", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "customer", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Customer", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Customer", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "date", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_2", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "template", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Template", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Customer Feedback Template", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "feedback_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "template.feedback_values", |
|||
"fieldname": "feedback", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Customer Feedback Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:39:18.044191", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Customer Feedback", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class CustomerFeedback(Document): |
|||
pass |
@ -0,0 +1,12 @@ |
|||
from frappe import _ |
|||
|
|||
def get_data(): |
|||
return { |
|||
'fieldname': 'feedback', |
|||
'transactions': [ |
|||
{ |
|||
'label': _('Action'), |
|||
'items': ['Quality Action'] |
|||
} |
|||
], |
|||
} |
@ -0,0 +1,11 @@ |
|||
frappe.listview_settings['Customer Feedback'] = { |
|||
add_fields: ["action"], |
|||
get_indicator: function(doc) { |
|||
if(doc.action == "No Action") { |
|||
return [__("No Action"), "green", "action,=,No Action"]; |
|||
} |
|||
else if(doc.action == "Action Initialised") { |
|||
return [__("Action Initialised"), "red", "action,=,Action Initialised"]; |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Customer Feedback", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Customer Survey
|
|||
() => frappe.tests.make('Customer Feedback', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,46 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
from erpnext.quality_management.doctype.customer_feedback_template.test_customer_feedback_template import create_template |
|||
class TestCustomerFeedback(unittest.TestCase): |
|||
def test_customer_feedback(self): |
|||
create_template() |
|||
test_create_feedback = create_feedback() |
|||
test_get_feedback = get_feedback() |
|||
self.assertEquals(test_create_feedback.name, test_get_feedback.name) |
|||
|
|||
def create_feedback(): |
|||
feedback = frappe.get_doc({ |
|||
"doctype": "Customer Feedback", |
|||
"template": "FDBK-TMPL-_Test Customer Feedback Template", |
|||
"date": ""+ frappe.utils.nowdate() +"" |
|||
}) |
|||
feedback_exist = frappe.get_list("Customer Feedback", filters={"date": ""+ feedback.date +""}, limit=1) |
|||
if len(feedback_exist) == 0: |
|||
feedback.insert() |
|||
return feedback |
|||
else: |
|||
return feedback_exist[0] |
|||
|
|||
def get_feedback(): |
|||
feedback = frappe.get_list("Customer Feedback", limit=1) |
|||
return feedback[0] |
|||
|
|||
#def create_feedback_template(): |
|||
# template = frappe.get_doc({ |
|||
# "doctype": "Customer Feedback Template", |
|||
# "template": "_Test Customer Feedback Template", |
|||
# "scope": "Company", |
|||
# "feedback_parameter": [ |
|||
# { |
|||
# "parameter": "_Test Customer Feedback Template Parameter", |
|||
# } |
|||
# ] |
|||
# }) |
|||
# template_exist = frappe.get_list("Customer Feedback Template", filters={"template": ""+ template.template +""}, fields=["name"]) |
|||
# if len(template_exist) == 0: |
|||
# template.insert() |
@ -0,0 +1,142 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-15 15:36:27.193355", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "parameter", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Parameter", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "1", |
|||
"fieldname": "rating", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Rating", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "1\n2\n3\n4\n5", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "", |
|||
"fieldname": "qualitative_feedback", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Qualitative Feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-01 14:29:03.273927", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Customer Feedback Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class CustomerFeedbackTable(Document): |
|||
pass |
@ -0,0 +1,5 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Customer Feedback Template', { |
|||
}); |
@ -0,0 +1,259 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:FDBK-TMPL-{template}", |
|||
"beta": 0, |
|||
"creation": "2018-10-18 15:11:26.215480", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "template", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Template", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_3", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "scope", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Scope", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Company\nDepartment", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.scope == 'Department'", |
|||
"fieldname": "department", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Department", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Department", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "feedback_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "feedback_parameter", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Customer Feedback Template Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-01 14:27:07.935761", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Customer Feedback Template", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class CustomerFeedbackTemplate(Document): |
|||
pass |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Customer Feedback Template", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Customer Feedback Template
|
|||
() => frappe.tests.make('Customer Feedback Template', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
|
|||
class TestCustomerFeedbackTemplate(unittest.TestCase): |
|||
def test_customer_feedback_template(self): |
|||
test_create_template = create_template() |
|||
test_get_template = get_template() |
|||
self.assertEquals(test_get_template.name, test_create_template.name) |
|||
|
|||
def create_template(): |
|||
template = frappe.get_doc({ |
|||
"doctype": "Customer Feedback Template", |
|||
"template": "_Test Customer Feedback Template", |
|||
"scope": "Company", |
|||
"feedback_parameter": [ |
|||
{ |
|||
"parameter": "_Test Customer Feedback Template Parameter", |
|||
} |
|||
] |
|||
}) |
|||
template_exist = frappe.get_list("Customer Feedback Template", filters={"template": ""+ template.template +""}, fields=["name"], limit=1) |
|||
if len(template_exist) == 0: |
|||
template.insert() |
|||
return template |
|||
else: |
|||
return template_exist[0] |
|||
|
|||
def get_template(): |
|||
template = frappe.get_list("Customer Feedback Template", filters={"template": "_Test Customer Feedback Template"}, limit=1) |
|||
return template[0] |
@ -0,0 +1,75 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-18 15:23:03.854925", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "parameter", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Parameter", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-01 14:28:50.626709", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Customer Feedback Template Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class CustomerFeedbackTemplateTable(Document): |
|||
pass |
@ -0,0 +1,87 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// 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(); |
|||
$(".grid-add-row").hide(); |
|||
if (frm.doc.review){ |
|||
frm.set_value("type", "Quality Review"); |
|||
} |
|||
else{ |
|||
frm.set_value("type", "Customer Feedback"); |
|||
} |
|||
}, |
|||
review: function(frm){ |
|||
frm.fields_dict.description.grid.remove_all(); |
|||
if(frm.doc.review){ |
|||
var problems = ""; |
|||
frappe.call({ |
|||
"method": "frappe.client.get", |
|||
args: { |
|||
doctype: "Quality Review", |
|||
name: frm.doc.review |
|||
}, |
|||
callback: function (data) { |
|||
for (var i = 0; i < data.message.values.length; i++){ |
|||
if (data.message.values[i].achieved < data.message.values[i].target){ |
|||
problems += data.message.values[i].objective +"-"+ data.message.values[i].achieved + " " + data.message.values[i].unit + "\n"; |
|||
} |
|||
} |
|||
problems= problems.replace(/\n$/, "").split("\n"); |
|||
for (i = 0; i < problems.length; i++){ |
|||
frm.add_child("description"); |
|||
frm.fields_dict.description.get_value()[i].problem = problems[i]; |
|||
} |
|||
frm.refresh(); |
|||
} |
|||
}); |
|||
frappe.call({ |
|||
"method": "frappe.client.get", |
|||
args: { |
|||
doctype: "Quality Goal", |
|||
name: frm.doc.goal |
|||
}, |
|||
callback: function (data) { |
|||
frm.doc.procedure = data.message.procedure; |
|||
frm.refresh(); |
|||
} |
|||
}); |
|||
} |
|||
else{ |
|||
frm.doc.goal = ''; |
|||
frm.doc.procedure = ''; |
|||
frm.refresh(); |
|||
} |
|||
}, |
|||
feedback: function(frm) { |
|||
frm.fields_dict.description.grid.remove_all(); |
|||
if(frm.doc.feedback){ |
|||
frappe.call({ |
|||
"method": "frappe.client.get", |
|||
args: { |
|||
doctype: "Customer Feedback", |
|||
name: frm.doc.feedback |
|||
}, |
|||
callback: function(data){ |
|||
for (var i = 0; i < data.message.feedback.length; i++ ){ |
|||
frm.add_child("description"); |
|||
frm.fields_dict.description.get_value()[i].problem = data.message.feedback[i].parameter +"-"+ data.message.feedback[i].qualitative_feedback; |
|||
} |
|||
frm.refresh(); |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
type: function(frm){ |
|||
if(frm.doc.description){ |
|||
frm.fields_dict.description.grid.remove_all(); |
|||
frm.doc.review = ''; |
|||
frm.doc.feedback = ''; |
|||
frm.doc.goal = ''; |
|||
frm.doc.procedure = ''; |
|||
frm.refresh(); |
|||
} |
|||
} |
|||
}); |
@ -0,0 +1,493 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:QMS-ACTN-{#####}", |
|||
"beta": 0, |
|||
"creation": "2018-10-02 11:40:43.666100", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "action", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Corrective/Preventive", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Corrective\nPreventive", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.type == 'Quality Review'", |
|||
"fieldname": "review", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Review", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Review", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.type == 'Customer Feedback'", |
|||
"fieldname": "feedback", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Feedback", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Customer Feedback", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.type == 'Quality Review'", |
|||
"fetch_from": "review.goal", |
|||
"fieldname": "goal", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Quality Goal", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Goal", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_3", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "type", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Type", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Review\nCustomer Feedback", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "date", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.type == 'Quality Review'", |
|||
"fetch_from": "", |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "status_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Status", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "Under Review", |
|||
"fieldname": "status", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Status", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Under Review\nClose", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_10", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "problem_resolution", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Description", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "description", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Action Description", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Action Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:27:07.724362", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Action", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityAction(Document): |
|||
def validate(self): |
|||
status_flag = '' |
|||
for value in self.description: |
|||
if value.resolution == None: |
|||
value.status = 'Open' |
|||
status_flag = 'Under Review' |
|||
else: |
|||
value.status = 'Close' |
|||
if status_flag == 'Under Review': |
|||
self.status = 'Under Review' |
|||
else: |
|||
self.status = 'Close' |
@ -0,0 +1,11 @@ |
|||
frappe.listview_settings['Quality Action'] = { |
|||
add_fields: ["status"], |
|||
get_indicator: function(doc) { |
|||
if(doc.status == "Planned") { |
|||
return [__("Planned"), "green", "status,=,Planned"]; |
|||
} |
|||
else{ |
|||
return [__("Under Review"), "red", "status,=,Under Review"]; |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Quality Action", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Quality Actions
|
|||
() => frappe.tests.make('Quality Actions', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,46 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import create_procedure |
|||
from erpnext.quality_management.doctype.quality_goal.test_quality_goal import create_unit |
|||
from erpnext.quality_management.doctype.quality_goal.test_quality_goal import create_goal |
|||
from erpnext.quality_management.doctype.quality_review.test_quality_review import create_review |
|||
|
|||
class TestQualityAction(unittest.TestCase): |
|||
|
|||
def test_quality_action(self): |
|||
create_procedure() |
|||
create_unit() |
|||
create_goal() |
|||
create_review() |
|||
test_create_action = create_action() |
|||
test_get_action = get_action() |
|||
self.assertEquals(test_create_action.name, test_get_action.name) |
|||
self.assertEquals(test_create_action.goal, test_get_action.goal) |
|||
|
|||
def create_action(): |
|||
review = frappe.get_list("Quality Review", limit=1) |
|||
action = frappe.get_doc({ |
|||
'doctype': 'Quality Action', |
|||
'action': 'Corrective', |
|||
'type': 'Quality Review', |
|||
'review': ''+ review[0].name +'', |
|||
'date': ''+ frappe.utils.nowdate() +'', |
|||
'goal': '_Test Quality Goal', |
|||
'procedure': '_Test Quality Procedure' |
|||
}) |
|||
action_exist = frappe.get_list("Quality Action", filters={"review": ""+ review[0].name +""}, fields=["name", "goal"], limit=1) |
|||
if len(action_exist) == 0: |
|||
action.insert() |
|||
return action |
|||
else: |
|||
return action_exist[0] |
|||
|
|||
def get_action(): |
|||
review = frappe.get_list("Quality Review", limit=1) |
|||
action = frappe.get_list("Quality Action", filters={"review": ""+ review[0].name +""}, fields=["name", "goal"], limit=1) |
|||
return action[0] |
@ -0,0 +1,205 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-15 15:36:53.624990", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "problem", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Problem", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "resolution", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Resolution", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "status", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Status", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Open\nClose", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "responsible", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Responsible", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Role", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "completion_date", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Completion Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:33:46.260600", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Action Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityActionTable(Document): |
|||
pass |
@ -0,0 +1,41 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Quality Goal', { |
|||
onload: function(frm){ |
|||
if(frm.doc.measurable == "No"){ |
|||
hide_target_unit(frm); |
|||
} |
|||
else{ |
|||
show_target_unit(frm); |
|||
} |
|||
}, |
|||
revision: function(frm) { |
|||
if(!frm.doc.revised_on){ |
|||
frm.set_value("revised_on", frappe.datetime.get_today()); |
|||
} |
|||
}, |
|||
measurable: function(frm) { |
|||
frm.fields_dict.objective.grid.remove_all(); |
|||
if(frm.doc.measurable == "No"){ |
|||
hide_target_unit(frm); |
|||
} |
|||
else{ |
|||
show_target_unit(frm); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
function hide_target_unit(frm){ |
|||
// hides target and unit columns as the goal cannot be measured in numeric values
|
|||
frm.fields_dict.objective.grid.docfields[1].hidden = 1; |
|||
frm.fields_dict.objective.grid.docfields[2].hidden = 1; |
|||
frm.refresh(); |
|||
} |
|||
|
|||
function show_target_unit(frm){ |
|||
// shows target and unit columns as the goal can be measured in numeric values
|
|||
frm.fields_dict.objective.grid.docfields[1].hidden = 0; |
|||
frm.fields_dict.objective.grid.docfields[2].hidden = 0; |
|||
frm.refresh(); |
|||
} |
@ -0,0 +1,824 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:{goal}", |
|||
"beta": 0, |
|||
"creation": "2018-10-02 12:17:41.727541", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "goal", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Name", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 1 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "created_by", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Created By", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "User", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "None", |
|||
"fieldname": "frequency", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Monitoring Frequency", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "None\nDaily\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "January-April-July-October", |
|||
"depends_on": "eval:doc.frequency == 'Quarterly'", |
|||
"fieldname": "quarterly", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Day", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "January-July", |
|||
"depends_on": "eval:doc.frequency == 'Half Yearly'", |
|||
"fieldname": "half", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Day", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "January", |
|||
"depends_on": "eval:doc.frequency == 'Yearly'", |
|||
"fieldname": "yearly", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Day", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_2", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "scope", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Scope", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Company\nDepartment", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.frequency == 'Daily'", |
|||
"fieldname": "daily", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Day", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Everyday", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.frequency == 'Weekly'", |
|||
"fieldname": "weekly", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Day", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.frequency == 'Quarterly' || doc.frequency == 'Half Yearly' || doc.frequency == 'Yearly' || doc.frequency == 'Monthly'", |
|||
"fieldname": "date", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.scope == 'Department'", |
|||
"fieldname": "department", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Department", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Department", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "section_break_8", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Revision and Revised On", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "revision", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Revision", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_10", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "revised_on", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Revised On", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "measurable_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Measurable Goal", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "Yes", |
|||
"fieldname": "measurable", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Measurable Goal", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Yes\nNo", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_20", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "Target and Unit are disabled", |
|||
"depends_on": "eval:doc.measurable == 'No'", |
|||
"fieldname": "measurable_display", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Measurable", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "section_break_11", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Goal Objectives", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "objective", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Objective", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Objective", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:35:18.498549", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Goal", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,10 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityGoal(Document): |
|||
pass |
|||
|
@ -0,0 +1,16 @@ |
|||
from frappe import _ |
|||
|
|||
def get_data(): |
|||
return { |
|||
'fieldname': 'goal', |
|||
'transactions': [ |
|||
{ |
|||
'label': _('Review'), |
|||
'items': ['Quality Review'] |
|||
}, |
|||
{ |
|||
'label': _('Action'), |
|||
'items': ['Quality Action'] |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Quality Goal", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Quality Goal
|
|||
() => frappe.tests.make('Quality Goal', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,53 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import create_procedure |
|||
|
|||
class TestQualityGoal(unittest.TestCase): |
|||
|
|||
def test_quality_goal(self): |
|||
create_procedure() |
|||
create_unit() |
|||
test_create_goal = create_goal() |
|||
test_get_goal = get_goal() |
|||
self.assertEquals(test_create_goal, test_get_goal) |
|||
|
|||
def create_goal(): |
|||
goal = frappe.get_doc({ |
|||
"doctype": "Quality Goal", |
|||
"goal": "_Test Quality Goal", |
|||
"revision": "1", |
|||
"procedure": "_Test Quality Procedure", |
|||
"frequency": "Daily", |
|||
"measureable": "Yes", |
|||
"objective": [ |
|||
{ |
|||
"objective": "_Test Quality Objective", |
|||
"target": "4", |
|||
"unit": "_Test UOM" |
|||
} |
|||
] |
|||
}) |
|||
goal_exist = frappe.db.exists("Quality Goal", ""+ goal.goal +"") |
|||
if not goal_exist: |
|||
goal.insert() |
|||
return goal.goal |
|||
else: |
|||
return goal_exist |
|||
|
|||
def get_goal(): |
|||
goal = frappe.db.exists("Quality Goal", "_Test Quality Goal") |
|||
return goal |
|||
|
|||
def create_unit(): |
|||
unit = frappe.get_doc({ |
|||
"doctype": "UOM", |
|||
"uom_name": "_Test UOM", |
|||
}) |
|||
unit_exist = frappe.db.exists("UOM", ""+ unit.uom_name +"") |
|||
if not unit_exist: |
|||
unit.insert() |
@ -0,0 +1,9 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Quality Meeting', { |
|||
onload: function(frm){ |
|||
frm.set_value("date", frappe.datetime.get_today()); |
|||
frm.refresh(); |
|||
} |
|||
}); |
@ -0,0 +1,225 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:QMS-MTN-{date}", |
|||
"beta": 0, |
|||
"creation": "2018-10-15 16:25:41.548432", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "date", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Meeting Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_2", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "Open", |
|||
"fieldname": "status", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Status", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Open\nClose", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "minutes_break", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Minutes", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "minutes", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Minutes", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Meeting Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-10-18 14:44:04.494395", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Meeting", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,18 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityMeeting(Document): |
|||
def validate(self): |
|||
problem = '' |
|||
for data in self.minutes: |
|||
if data.status == 'Open': |
|||
problem = 'set' |
|||
|
|||
if problem == 'set': |
|||
self.status = 'Open' |
|||
else: |
|||
self.status = 'Close' |
@ -0,0 +1,11 @@ |
|||
frappe.listview_settings['Quality Meeting'] = { |
|||
add_fields: ["status"], |
|||
get_indicator: function(doc) { |
|||
if(doc.status == "Open") { |
|||
return [__("Open"), "red", "status=,Open"]; |
|||
} |
|||
else if(doc.status == "Close") { |
|||
return [__("Close"), "green", ",status=,Close"]; |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Quality Meeting", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Quality Meeting
|
|||
() => frappe.tests.make('Quality Meeting', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
|
|||
class TestQualityMeeting(unittest.TestCase): |
|||
def test_quality_meeting(self): |
|||
test_create_meeting = create_meeting() |
|||
test_get_meeting = get_meeting() |
|||
self.assertEquals(test_create_meeting.name, test_get_meeting.name) |
|||
|
|||
def create_meeting(): |
|||
meeting = frappe.get_doc({ |
|||
"doctype": "Quality Meeting", |
|||
"scope": "Company", |
|||
"status": "Close", |
|||
"date": ""+ frappe.as_unicode(frappe.utils.nowdate()) +"" |
|||
}) |
|||
meeting_exist = frappe.get_list("Quality Meeting", filters={"date": ""+ meeting.date +""}, fields=["name"], limit=1) |
|||
if len(meeting_exist) == 0: |
|||
meeting.insert() |
|||
return meeting |
|||
else: |
|||
return meeting_exist[0] |
|||
|
|||
def get_meeting(): |
|||
meeting = frappe.get_list("Quality Meeting", limit=1) |
|||
return meeting[0] |
@ -0,0 +1,175 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-15 16:28:59.840039", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "review", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Review", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Review", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "action", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Action", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Under Review\nPlanned", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "responsible", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Responsible", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Role", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "status", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Status", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Open\nClose", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-01 14:34:53.964306", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Meeting Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityMeetingTable(Document): |
|||
pass |
@ -0,0 +1,144 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:{####}", |
|||
"beta": 0, |
|||
"creation": "2018-10-02 16:47:59.600155", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "goal.objective", |
|||
"fieldname": "objective", |
|||
"fieldtype": "Text", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Objective", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "", |
|||
"fieldname": "target", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Target", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "", |
|||
"fieldname": "unit", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Unit", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "UOM", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-11 13:31:16.044780", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Objective", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityObjective(Document): |
|||
pass |
@ -0,0 +1,5 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Quality Procedure', { |
|||
}); |
@ -0,0 +1,386 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "format:{procedure}", |
|||
"beta": 0, |
|||
"creation": "2018-10-06 00:06:29.756804", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "parent_quality_procedure", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Parent Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "is_group", |
|||
"fieldtype": "Check", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Is Group", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_2", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "department", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Department", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Department", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "procedure_steps_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure Steps", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "procedure_step", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "lft", |
|||
"fieldtype": "Int", |
|||
"hidden": 1, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Lft", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "rgt", |
|||
"fieldtype": "Int", |
|||
"hidden": 1, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Rgt", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "old_parent", |
|||
"fieldtype": "Data", |
|||
"hidden": 1, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "old_parent", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:30:19.803693", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Procedure", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,64 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils.nestedset import NestedSet |
|||
from frappe import _ |
|||
|
|||
class QualityProcedure(NestedSet): |
|||
nsm_parent_field = 'parent_quality_procedure' |
|||
|
|||
def before_save(self): |
|||
for data in self.procedure_step: |
|||
if data.procedure == 'Procedure' and data.procedure_name: |
|||
data.step = data.procedure_name |
|||
doc = frappe.get_doc("Quality Procedure", data.procedure_name) |
|||
if(doc.parent_quality_procedure): |
|||
frappe.throw(_("'"+ data.procedure_name +"' already has a Parent Procedure '"+ doc.parent_quality_procedure +"'")) |
|||
self.is_group = 1 |
|||
|
|||
def on_update(self): |
|||
self.set_parent() |
|||
|
|||
def after_insert(self): |
|||
self.set_parent() |
|||
|
|||
def on_trash(self): |
|||
if self.parent_quality_procedure: |
|||
doc = frappe.get_doc("Quality Procedure", self.parent_quality_procedure) |
|||
for data in doc.procedure_step: |
|||
if data.procedure_name == self.name: |
|||
doc.procedure_step.remove(data) |
|||
doc.save() |
|||
flag_is_group = 0 |
|||
doc.load_from_db() |
|||
for data in doc.procedure_step: |
|||
if data.procedure == "Procedure": |
|||
flag_is_group = 1 |
|||
if flag_is_group == 0: |
|||
doc.is_group = 0 |
|||
doc.save() |
|||
|
|||
def set_parent(self): |
|||
for data in self.procedure_step: |
|||
if data.procedure == 'Procedure' and data.procedure_name: |
|||
doc = frappe.get_doc("Quality Procedure", data.procedure_name) |
|||
doc.parent_quality_procedure = self.name |
|||
doc.save() |
|||
|
|||
@frappe.whitelist() |
|||
def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=False): |
|||
if parent is None or parent == "All Quality Procedures": |
|||
parent = "" |
|||
return frappe.get_all(doctype, fields=["name as value", "is_group as expandable"], filters={"parent_quality_procedure": parent}) |
|||
|
|||
@frappe.whitelist() |
|||
def add_node(): |
|||
from frappe.desk.treeview import make_tree_args |
|||
args = frappe.form_dict |
|||
args = make_tree_args(**args) |
|||
if args.parent_quality_procedure == 'All Quality Procedures': |
|||
args.parent_quality_procedure = None |
|||
frappe.get_doc(args).insert() |
@ -0,0 +1,20 @@ |
|||
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'] |
|||
} |
|||
], |
|||
} |
@ -0,0 +1,39 @@ |
|||
frappe.provide("frappe.treeview_settings"); |
|||
|
|||
frappe.treeview_settings["Quality Procedure"] = { |
|||
ignore_fields:["parent_quality_procedure"], |
|||
get_tree_nodes: 'erpnext.quality_management.doctype.quality_procedure.quality_procedure.get_children', |
|||
add_tree_node: 'erpnext.quality_management.doctype.quality_procedure.quality_procedure.add_node', |
|||
filters: [ |
|||
{ |
|||
fieldname: "Quality Procedure", |
|||
fieldtype:"Link", |
|||
options: "Quality Procedure", |
|||
label: __("Quality Procedure"), |
|||
get_query: function() { |
|||
return { |
|||
filters: [["Quality Procedure", 'is_group', '=', 1]] |
|||
}; |
|||
} |
|||
}, |
|||
], |
|||
breadcrumb: "Setup", |
|||
root_label: "All Quality Procedures", |
|||
get_tree_root: false, |
|||
menu_items: [ |
|||
{ |
|||
label: __("New Quality Procedure"), |
|||
action: function() { |
|||
frappe.new_doc("Quality Procedure", true); |
|||
}, |
|||
condition: 'frappe.boot.user.can_create.indexOf("Quality Procedure") !== -1' |
|||
} |
|||
], |
|||
onload: function(treeview) { |
|||
treeview.make_tree(); |
|||
}, |
|||
onrender: function() { |
|||
$("button:contains('Add Child')").remove(); |
|||
$("button:contains('New')").remove(); |
|||
} |
|||
}; |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Quality Procedure", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Quality Procedure
|
|||
() => frappe.tests.make('Quality Procedure', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,57 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
|
|||
class TestQualityProcedure(unittest.TestCase): |
|||
def test_quality_procedure(self): |
|||
test_create_procedure = create_procedure() |
|||
test_create_nested_procedure = create_nested_procedure() |
|||
test_get_procedure, test_get_nested_procedure = get_procedure() |
|||
self.assertEquals(test_create_procedure, test_get_procedure.name) |
|||
self.assertEquals(test_create_nested_procedure, test_get_nested_procedure.name) |
|||
self.assertEquals(test_get_nested_procedure.name, test_get_procedure.parent_quality_procedure) |
|||
|
|||
def create_procedure(): |
|||
procedure = frappe.get_doc({ |
|||
"doctype": "Quality Procedure", |
|||
"procedure": "_Test Quality Procedure", |
|||
"procedure_step": [ |
|||
{ |
|||
"procedure": "Step", |
|||
"step": "_Test Quality Procedure Table", |
|||
} |
|||
] |
|||
}) |
|||
procedure_exist = frappe.db.exists("Quality Procedure",""+ procedure.procedure +"") |
|||
if not procedure_exist: |
|||
procedure.insert() |
|||
return procedure.procedure |
|||
else: |
|||
return procedure_exist |
|||
|
|||
def create_nested_procedure(): |
|||
nested_procedure = frappe.get_doc({ |
|||
"doctype": "Quality Procedure", |
|||
"procedure": "_Test Nested Quality Procedure", |
|||
"procedure_step": [ |
|||
{ |
|||
"procedure": "Procedure", |
|||
"procedure_name": "_Test Quality Procedure", |
|||
} |
|||
] |
|||
}) |
|||
nested_procedure_exist = frappe.db.exists("Quality Procedure",""+ nested_procedure.procedure +"") |
|||
if not nested_procedure_exist: |
|||
nested_procedure.insert() |
|||
return nested_procedure.procedure |
|||
else: |
|||
return nested_procedure_exist |
|||
|
|||
def get_procedure(): |
|||
procedure = frappe.get_all("Quality Procedure", filters={"procedure": "_Test Quality Procedure"}, fields=["name", "parent_quality_procedure"], limit=1) |
|||
nested_procedure = frappe.get_all("Quality Procedure", filters={"procedure": "_Test Nested Quality Procedure"}, fields=["name", "parent_quality_procedure"], limit=1) |
|||
return procedure[0], nested_procedure[0] |
@ -0,0 +1,176 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-17 15:48:57.617831", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 0, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Step\nProcedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.procedure == \"Procedure\"", |
|||
"fieldname": "procedure_name", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.procedure == \"Step\"", |
|||
"fieldname": "step", |
|||
"fieldtype": "Text", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Step", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "responsible_individual", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Responsible Individual", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Role", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-01 14:26:33.558345", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Procedure Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 1, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityProcedureTable(Document): |
|||
pass |
@ -0,0 +1,72 @@ |
|||
// Copyright (c) 2018, Frappe and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Quality Review', { |
|||
onload: function(frm){ |
|||
frm.set_value("date", frappe.datetime.get_today()); |
|||
$(".grid-add-row").hide(); |
|||
if(frm.doc.measurable == "Yes"){ |
|||
show_target_achieved_unit(frm); |
|||
} |
|||
else{ |
|||
hide_target_achieved_unit(frm); |
|||
} |
|||
frm.refresh(); |
|||
}, |
|||
goal: function(frm) { |
|||
frm.fields_dict.values.grid.remove_all(); |
|||
if (frm.doc.goal){ |
|||
frappe.call({ |
|||
"method": "frappe.client.get", |
|||
args: { |
|||
doctype: "Quality Goal", |
|||
name: frm.doc.goal |
|||
}, |
|||
callback: function (data) { |
|||
for (var i = 0; i < data.message.objective.length; i++ ){ |
|||
frm.add_child("values"); |
|||
frm.fields_dict.values.get_value()[i].objective = data.message.objective[i].objective; |
|||
if(frm.doc.measurable == "Yes"){ |
|||
if(i < 1){ |
|||
show_target_achieved_unit(frm); |
|||
} |
|||
frm.fields_dict.values.get_value()[i].target = data.message.objective[i].target; |
|||
frm.fields_dict.values.get_value()[i].achieved = 0; |
|||
frm.fields_dict.values.get_value()[i].unit = data.message.objective[i].unit; |
|||
} |
|||
if(frm.doc.measurable == "No"){ |
|||
if(i < 1){ |
|||
hide_target_achieved_unit(frm); |
|||
} |
|||
frm.fields_dict.values.get_value()[i].yes_no = "No"; |
|||
} |
|||
} |
|||
frm.refresh(); |
|||
} |
|||
}); |
|||
} |
|||
else{ |
|||
frm.doc.procedure = ''; |
|||
frm.doc.scope = ''; |
|||
frm.doc.action = ''; |
|||
frm.doc.measurable = ''; |
|||
frm.refresh(); |
|||
} |
|||
}, |
|||
}); |
|||
|
|||
function show_target_achieved_unit(frm){ |
|||
// shows target, achieved and unit columns as the goal can be measured in numeric values
|
|||
frm.fields_dict.values.grid.docfields[1].hidden = 0; |
|||
frm.fields_dict.values.grid.docfields[2].hidden = 0; |
|||
frm.fields_dict.values.grid.docfields[3].hidden = 0; |
|||
frm.fields_dict.values.grid.docfields[4].hidden = 1; |
|||
} |
|||
|
|||
function hide_target_achieved_unit(frm){ |
|||
// hides target and unit columns as the goal cannot be measured in numeric values
|
|||
frm.fields_dict.values.grid.docfields[1].hidden = 1; |
|||
frm.fields_dict.values.grid.docfields[2].hidden = 1; |
|||
frm.fields_dict.values.grid.docfields[3].hidden = 1; |
|||
frm.fields_dict.values.grid.docfields[4].hidden = 0; |
|||
} |
@ -0,0 +1,424 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"autoname": "QMS-REV-.#####", |
|||
"beta": 0, |
|||
"creation": "2018-10-02 11:45:16.301955", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "", |
|||
"fieldname": "goal", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Quality Goal", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Goal", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 1, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "date", |
|||
"fieldtype": "Date", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Evaluation Date", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "goal.measurable", |
|||
"fieldname": "measurable", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Measurable Goal", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "column_break_4", |
|||
"fieldtype": "Column Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "goal.procedure", |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Link", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Procedure", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Procedure", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "goal.scope", |
|||
"fieldname": "scope", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Scope", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"depends_on": "eval:doc.scope == 'Department'", |
|||
"fetch_from": "goal.department", |
|||
"fieldname": "department", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Department", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "values_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Values", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "values", |
|||
"fieldtype": "Table", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Values", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "Quality Review Table", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 1, |
|||
"columns": 0, |
|||
"fieldname": "additional_info_section", |
|||
"fieldtype": "Section Break", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Additional Information", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "additional_information", |
|||
"fieldtype": "Text", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 0, |
|||
"in_standard_filter": 0, |
|||
"label": "Additional Information", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 0, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-12 14:25:02.383387", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Review", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"amend": 0, |
|||
"cancel": 0, |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"if_owner": 0, |
|||
"import": 0, |
|||
"permlevel": 0, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"set_user_permissions": 0, |
|||
"share": 1, |
|||
"submit": 0, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,67 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.model.document import Document |
|||
import datetime |
|||
class QualityReview(Document): |
|||
pass |
|||
|
|||
def review(): |
|||
now = datetime.datetime.now() |
|||
day = now.day |
|||
day_name = now.strftime("%A") |
|||
month=now.strftime("%B") |
|||
|
|||
for data in frappe.get_all("Quality Goal",fields=['name', 'frequency', 'date', 'weekly', 'measurable']): |
|||
if data.frequency == 'Daily': |
|||
create_review(data.name, data.measurable) |
|||
|
|||
elif data.frequency == 'Weekly': |
|||
if data.weekly == day_name: |
|||
create_review(data.name, data.measurable) |
|||
|
|||
elif data.frequency == 'Monthly': |
|||
if data.date == str(day): |
|||
create_review(data.name, data.measurable) |
|||
|
|||
elif data.frequency == 'Quarterly': |
|||
if (month == 'January' or month == 'April' or month == 'July' or month == 'October') and str(day) == data.date: |
|||
create_review(data.name, data.measurable) |
|||
|
|||
elif data.frequency == 'Half Yearly': |
|||
if (month == 'January' or month == 'July') and str(day) == data.date: |
|||
create_review(data.name, data.measurable) |
|||
|
|||
elif data.frequency == 'Yearly': |
|||
if month == data.yearly and str(day) == data.date: |
|||
create_review(data.name, data.measurable) |
|||
|
|||
else: |
|||
pass |
|||
|
|||
def create_review(name, measurable): |
|||
objectives = frappe.get_all("Quality Objective", filters={'parent': name }, fields=['objective', 'target', 'unit']) |
|||
doc = frappe.get_doc({ |
|||
"doctype": "Quality Review", |
|||
"goal": name, |
|||
"date": frappe.as_unicode(frappe.utils.nowdate()), |
|||
"measurable": measurable, |
|||
}) |
|||
if measurable == 'Yes': |
|||
for objective in objectives: |
|||
doc.append("values",{ |
|||
'objective': objective.objective, |
|||
'target': objective.target, |
|||
'achieved': 0, |
|||
'unit': objective.unit |
|||
}) |
|||
else: |
|||
for objective in objectives: |
|||
doc.append("values",{ |
|||
'objective': objective.objective, |
|||
}) |
|||
doc.insert() |
|||
frappe.db.commit() |
@ -0,0 +1,16 @@ |
|||
from frappe import _ |
|||
|
|||
def get_data(): |
|||
return { |
|||
'fieldname': 'review', |
|||
'transactions': [ |
|||
{ |
|||
'label': _('Action'), |
|||
'items': ['Quality Action'] |
|||
}, |
|||
{ |
|||
'label': _('Meeting'), |
|||
'items': ['Quality Meeting'] |
|||
} |
|||
], |
|||
} |
@ -0,0 +1,12 @@ |
|||
frappe.listview_settings['Quality Review'] = { |
|||
add_fields: ["action"], |
|||
get_indicator: function(doc) |
|||
{ |
|||
if(doc.action == "No Action") { |
|||
return [__("No Action"), "green", "action,=,No Action"]; |
|||
} |
|||
else if(doc.action == "Action Initialised") { |
|||
return [__("Action Initialised"), "red", "action,=,Action Initialised"]; |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,23 @@ |
|||
/* eslint-disable */ |
|||
// rename this file from _test_[name] to test_[name] to activate
|
|||
// and remove above this line
|
|||
|
|||
QUnit.test("test: Performance Monitoring", function (assert) { |
|||
let done = assert.async(); |
|||
|
|||
// number of asserts
|
|||
assert.expect(1); |
|||
|
|||
frappe.run_serially([ |
|||
// insert a new Performance Monitoring
|
|||
() => frappe.tests.make('Performance Monitoring', [ |
|||
// values to be set
|
|||
{key: 'value'} |
|||
]), |
|||
() => { |
|||
assert.equal(cur_frm.doc.key, 'value'); |
|||
}, |
|||
() => done() |
|||
]); |
|||
|
|||
}); |
@ -0,0 +1,47 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and Contributors |
|||
# See license.txt |
|||
from __future__ import unicode_literals |
|||
|
|||
import frappe |
|||
import unittest |
|||
from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import create_procedure |
|||
from erpnext.quality_management.doctype.quality_goal.test_quality_goal import create_unit |
|||
from erpnext.quality_management.doctype.quality_goal.test_quality_goal import create_goal |
|||
|
|||
class TestQualityReview(unittest.TestCase): |
|||
|
|||
def test_quality_review(self): |
|||
create_procedure() |
|||
create_unit() |
|||
create_goal() |
|||
test_create_review = create_review() |
|||
test_get_review = get_review() |
|||
self.assertEquals(test_create_review.name, test_get_review.name) |
|||
|
|||
def create_review(): |
|||
review = frappe.get_doc({ |
|||
"doctype": "Quality Review", |
|||
"goal": "_Test Quality Goal", |
|||
"procedure": "_Test Quality Procedure", |
|||
"scope": "Company", |
|||
"date": ""+ frappe.utils.nowdate() +"", |
|||
"values": [ |
|||
{ |
|||
"objective": "_Test Quality Objective", |
|||
"target": "100", |
|||
"achieved": "100", |
|||
"unit": "_Test UOM" |
|||
} |
|||
] |
|||
}) |
|||
review_exist = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1) |
|||
if len(review_exist) == 0: |
|||
review.insert() |
|||
return review |
|||
else: |
|||
return review_exist[0] |
|||
|
|||
def get_review(): |
|||
review = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1) |
|||
return review[0] |
@ -0,0 +1,207 @@ |
|||
{ |
|||
"allow_copy": 0, |
|||
"allow_events_in_timeline": 0, |
|||
"allow_guest_to_view": 0, |
|||
"allow_import": 0, |
|||
"allow_rename": 0, |
|||
"beta": 0, |
|||
"creation": "2018-10-09 13:03:37.666929", |
|||
"custom": 0, |
|||
"docstatus": 0, |
|||
"doctype": "DocType", |
|||
"document_type": "", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"fields": [ |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "objective", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "objective", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fieldname": "target", |
|||
"fieldtype": "Int", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Target", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "", |
|||
"fieldname": "achieved", |
|||
"fieldtype": "Int", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Achieved", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"fetch_from": "target_unit", |
|||
"fieldname": "unit", |
|||
"fieldtype": "Data", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Unit", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 1, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 0, |
|||
"allow_in_quick_entry": 0, |
|||
"allow_on_submit": 0, |
|||
"bold": 0, |
|||
"collapsible": 0, |
|||
"columns": 0, |
|||
"default": "", |
|||
"fieldname": "yes_no", |
|||
"fieldtype": "Select", |
|||
"hidden": 0, |
|||
"ignore_user_permissions": 0, |
|||
"ignore_xss_filter": 0, |
|||
"in_filter": 0, |
|||
"in_global_search": 0, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 0, |
|||
"label": "Yes/No", |
|||
"length": 0, |
|||
"no_copy": 0, |
|||
"options": "No\nYes", |
|||
"permlevel": 0, |
|||
"precision": "", |
|||
"print_hide": 0, |
|||
"print_hide_if_no_value": 0, |
|||
"read_only": 0, |
|||
"remember_last_selected_value": 0, |
|||
"report_hide": 0, |
|||
"reqd": 0, |
|||
"search_index": 0, |
|||
"set_only_once": 0, |
|||
"translatable": 0, |
|||
"unique": 0 |
|||
} |
|||
], |
|||
"has_web_view": 0, |
|||
"hide_heading": 0, |
|||
"hide_toolbar": 0, |
|||
"idx": 0, |
|||
"image_view": 0, |
|||
"in_create": 0, |
|||
"is_submittable": 0, |
|||
"issingle": 0, |
|||
"istable": 1, |
|||
"max_attachments": 0, |
|||
"modified": "2018-11-03 11:10:53.818818", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Quality Review Table", |
|||
"name_case": "", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"quick_entry": 0, |
|||
"read_only": 0, |
|||
"read_only_onload": 0, |
|||
"show_name_in_global_search": 0, |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1, |
|||
"track_seen": 0, |
|||
"track_views": 0 |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright (c) 2018, Frappe and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
from __future__ import unicode_literals |
|||
from frappe.model.document import Document |
|||
|
|||
class QualityReviewTable(Document): |
|||
pass |
@ -0,0 +1,24 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"creation": "2018-10-16 12:28:43.651915", |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2018-10-16 15:23:25.667237", |
|||
"modified_by": "Administrator", |
|||
"module": "Quality Management", |
|||
"name": "Review", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"query": "SELECT\n `tabQuality Action`.name as \"Name:Data:200\",\n `tabQuality Action`.action as \"Action:Select/[corrective,Preventive]:200\",\n `tabQuality Action`.review as \"Review:Link/Quality Review:200\",\n `tabQuality Action`.date as \"Date:Date:120\",\n `tabQuality Action`.status as \"Status:Select/Planned:150\"\nFROM\n `tabQuality Action`\nWHERE\n `tabQuality Action`.type='Quality Review'\n \n ", |
|||
"ref_doctype": "Quality Action", |
|||
"report_name": "Review", |
|||
"report_type": "Query Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
Loading…
Reference in new issue