Merge branch 'develop' of https://github.com/frappe/erpnext into leave-management
This commit is contained in:
commit
b16d395a8f
@ -4,6 +4,7 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "Document",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"item_code",
|
||||
"col_break1",
|
||||
@ -15,6 +16,10 @@
|
||||
"image_section",
|
||||
"image",
|
||||
"image_view",
|
||||
"manufacture_details",
|
||||
"manufacturer",
|
||||
"column_break_13",
|
||||
"manufacturer_part_no",
|
||||
"quantity_and_rate",
|
||||
"received_qty",
|
||||
"qty",
|
||||
@ -728,11 +733,32 @@
|
||||
{
|
||||
"fieldname": "dimension_col_break",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacture_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Manufacture"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_13",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Manufacturer Part Number",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2019-05-25 22:04:48.435730",
|
||||
"modified": "2019-06-02 06:36:17.078419",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Item",
|
||||
|
@ -17,6 +17,10 @@
|
||||
"col_break1",
|
||||
"image",
|
||||
"image_view",
|
||||
"manufacture_details",
|
||||
"manufacturer",
|
||||
"column_break_14",
|
||||
"manufacturer_part_no",
|
||||
"quantity_and_rate",
|
||||
"qty",
|
||||
"stock_uom",
|
||||
@ -672,11 +676,32 @@
|
||||
{
|
||||
"fieldname": "dimension_col_break",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacture_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Manufacture"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_14",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Manufacturer Part Number",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2019-05-25 22:10:32.518941",
|
||||
"modified": "2019-06-02 06:34:47.495730",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order Item",
|
||||
|
@ -18,6 +18,10 @@
|
||||
"col_break1",
|
||||
"image",
|
||||
"image_view",
|
||||
"manufacture_details",
|
||||
"manufacturer",
|
||||
"column_break_15",
|
||||
"manufacturer_part_no",
|
||||
"quantity_and_rate",
|
||||
"qty",
|
||||
"stock_uom",
|
||||
@ -285,6 +289,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_free_item",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Free Item",
|
||||
@ -493,6 +498,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"default": "0",
|
||||
"fieldname": "page_break",
|
||||
"fieldtype": "Check",
|
||||
"label": "Page Break",
|
||||
@ -500,11 +506,33 @@
|
||||
"oldfieldname": "page_break",
|
||||
"oldfieldtype": "Check",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "manufacture_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Manufacture"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Manufacturer Part Number",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_15",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2019-05-01 17:35:05.078030",
|
||||
"modified": "2019-06-02 05:32:46.019237",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Supplier Quotation Item",
|
||||
|
@ -59,14 +59,14 @@ def get_data():
|
||||
"items": [
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Customer Feedback",
|
||||
"description":_("Customer Feedback"),
|
||||
"name": "Quality Feedback",
|
||||
"description":_("Quality Feedback"),
|
||||
"onboard": 1,
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Customer Feedback Template",
|
||||
"description":_("Customer Feedback Template"),
|
||||
"name": "Quality Feedback Template",
|
||||
"description":_("Quality Feedback Template"),
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -161,6 +161,10 @@ def get_data():
|
||||
"type": "doctype",
|
||||
"name": "Item Alternative",
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Item Manufacturer",
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Item Variant Settings",
|
||||
|
@ -437,3 +437,20 @@ def get_batch_numbers(doctype, txt, searchfield, start, page_len, filters):
|
||||
query += " and item = {item}".format(item = frappe.db.escape(filters.get('item')))
|
||||
|
||||
return frappe.db.sql(query, filters)
|
||||
|
||||
@frappe.whitelist()
|
||||
def item_manufacturer_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
search_txt = "{0}%".format(txt)
|
||||
|
||||
item_filters = {
|
||||
'manufacturer': ('like', search_txt),
|
||||
'item_code': filters.get("item_code")
|
||||
}
|
||||
|
||||
return frappe.get_all("Item Manufacturer",
|
||||
fields = "manufacturer",
|
||||
filters = item_filters,
|
||||
limit_start=start,
|
||||
limit_page_length=page_len,
|
||||
as_list=1
|
||||
)
|
||||
|
@ -39,8 +39,8 @@
|
||||
"item_name": "Atocopherol",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
|
||||
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.577151",
|
||||
@ -123,8 +123,8 @@
|
||||
"item_name": "Abacavir",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
|
||||
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.678257",
|
||||
@ -207,8 +207,6 @@
|
||||
"item_name": "Abciximab",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.695413",
|
||||
@ -291,8 +289,6 @@
|
||||
"item_name": "Acacia",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.797774",
|
||||
@ -375,8 +371,6 @@
|
||||
"item_name": "Acamprosate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.826952",
|
||||
@ -459,8 +453,6 @@
|
||||
"item_name": "Acarbose",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.843890",
|
||||
@ -543,8 +535,6 @@
|
||||
"item_name": "Acebrofylline",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.969984",
|
||||
@ -627,8 +617,6 @@
|
||||
"item_name": "Acebrofylline (SR)",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:16.987354",
|
||||
@ -711,8 +699,6 @@
|
||||
"item_name": "Aceclofenac",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.004369",
|
||||
@ -795,8 +781,6 @@
|
||||
"item_name": "Ash",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.021192",
|
||||
@ -879,8 +863,6 @@
|
||||
"item_name": "Asparaginase",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.038058",
|
||||
@ -963,8 +945,6 @@
|
||||
"item_name": "Aspartame",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.054463",
|
||||
@ -1047,8 +1027,6 @@
|
||||
"item_name": "Aspartic Acid",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.071001",
|
||||
@ -1131,8 +1109,6 @@
|
||||
"item_name": "Bleomycin",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.087170",
|
||||
@ -1215,8 +1191,6 @@
|
||||
"item_name": "Bleomycin Sulphate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.103691",
|
||||
@ -1299,8 +1273,6 @@
|
||||
"item_name": "Blue cap contains",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.120040",
|
||||
@ -1383,8 +1355,6 @@
|
||||
"item_name": "Boran",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.135964",
|
||||
@ -1467,8 +1437,6 @@
|
||||
"item_name": "Borax",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.152575",
|
||||
@ -1551,8 +1519,6 @@
|
||||
"item_name": "Chlorbutanol",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.168998",
|
||||
@ -1635,8 +1601,6 @@
|
||||
"item_name": "Chlorbutol",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.185316",
|
||||
@ -1719,8 +1683,6 @@
|
||||
"item_name": "Chlordiazepoxide",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.208361",
|
||||
@ -1803,8 +1765,6 @@
|
||||
"item_name": "Chlordiazepoxide and Clidinium Bromide",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.224341",
|
||||
@ -1887,8 +1847,6 @@
|
||||
"item_name": "Chlorhexidine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.240634",
|
||||
@ -1971,8 +1929,6 @@
|
||||
"item_name": "Chlorhexidine 40%",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.256922",
|
||||
@ -2055,8 +2011,6 @@
|
||||
"item_name": "Chlorhexidine Acetate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.274789",
|
||||
@ -2139,8 +2093,6 @@
|
||||
"item_name": "Chlorhexidine Gluconate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.295371",
|
||||
@ -2223,8 +2175,6 @@
|
||||
"item_name": "Chlorhexidine HCL",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.312916",
|
||||
@ -2307,8 +2257,6 @@
|
||||
"item_name": "Chlorhexidine Hydrochloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.329570",
|
||||
@ -2391,8 +2339,6 @@
|
||||
"item_name": "Chloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.346088",
|
||||
@ -2475,8 +2421,6 @@
|
||||
"item_name": "Fosfomycin Tromethamine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.362777",
|
||||
@ -2559,8 +2503,6 @@
|
||||
"item_name": "Fosinopril",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.379465",
|
||||
@ -2643,8 +2585,6 @@
|
||||
"item_name": "Iodochlorhydroxyquinoline",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.396068",
|
||||
@ -2727,8 +2667,6 @@
|
||||
"item_name": "Iodochlorohydroxyquinoline",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.412734",
|
||||
@ -2811,8 +2749,6 @@
|
||||
"item_name": "Ipratropium",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.429333",
|
||||
@ -2895,8 +2831,6 @@
|
||||
"item_name": "Mebeverine hydrochloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.445814",
|
||||
@ -2979,8 +2913,6 @@
|
||||
"item_name": "Mecetronium ethylsulphate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.461696",
|
||||
@ -3063,8 +2995,6 @@
|
||||
"item_name": "Meclizine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.478020",
|
||||
@ -3147,8 +3077,8 @@
|
||||
"item_name": "Oxaprozin",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
|
||||
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.496221",
|
||||
@ -3231,8 +3161,6 @@
|
||||
"item_name": "Oxazepam",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.511933",
|
||||
@ -3315,8 +3243,6 @@
|
||||
"item_name": "Oxcarbazepine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.528472",
|
||||
@ -3399,8 +3325,6 @@
|
||||
"item_name": "Oxetacaine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.544177",
|
||||
@ -3483,8 +3407,6 @@
|
||||
"item_name": "Oxethazaine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.560193",
|
||||
@ -3567,8 +3489,6 @@
|
||||
"item_name": "Suxamethonium Chloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.576447",
|
||||
@ -3651,8 +3571,6 @@
|
||||
"item_name": "Tacrolimus",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.593481",
|
||||
@ -3735,8 +3653,6 @@
|
||||
"item_name": "Ubiquinol",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.609930",
|
||||
@ -3819,8 +3735,6 @@
|
||||
"item_name": "Vitamin B12",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.626225",
|
||||
@ -3903,8 +3817,6 @@
|
||||
"item_name": "Vitamin B1Hydrochloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.642423",
|
||||
@ -3987,8 +3899,6 @@
|
||||
"item_name": "Vitamin B1Monohydrate",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.658946",
|
||||
@ -4071,8 +3981,6 @@
|
||||
"item_name": "Vitamin B2",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.675234",
|
||||
@ -4155,8 +4063,6 @@
|
||||
"item_name": "Vitamin B3",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.691598",
|
||||
@ -4239,8 +4145,6 @@
|
||||
"item_name": "Vitamin D4",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.707840",
|
||||
@ -4323,8 +4227,6 @@
|
||||
"item_name": "Vitamin E",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.723859",
|
||||
@ -4407,8 +4309,6 @@
|
||||
"item_name": "Wheat Germ Oil",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.739829",
|
||||
@ -4491,8 +4391,6 @@
|
||||
"item_name": "Wheatgrass extr",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.757695",
|
||||
@ -4575,8 +4473,6 @@
|
||||
"item_name": "Whey Protein",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.774098",
|
||||
@ -4659,8 +4555,6 @@
|
||||
"item_name": "Xylometazoline",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.790224",
|
||||
@ -4743,8 +4637,6 @@
|
||||
"item_name": "Xylometazoline Hydrochloride",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.806359",
|
||||
@ -4827,8 +4719,6 @@
|
||||
"item_name": "Yeast",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.823305",
|
||||
@ -4911,8 +4801,6 @@
|
||||
"item_name": "Yellow Fever Vaccine",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.840250",
|
||||
@ -4995,8 +4883,6 @@
|
||||
"item_name": "Zafirlukast",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.856856",
|
||||
@ -5079,8 +4965,6 @@
|
||||
"item_name": "Zaleplon",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.873287",
|
||||
@ -5163,8 +5047,6 @@
|
||||
"item_name": "Zaltoprofen",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.889263",
|
||||
@ -5247,8 +5129,6 @@
|
||||
"item_name": "Zanamivir",
|
||||
"last_purchase_rate": 0.0,
|
||||
"lead_time_days": 0,
|
||||
"manufacturer": null,
|
||||
"manufacturer_part_no": null,
|
||||
"max_discount": 0.0,
|
||||
"min_order_qty": 0.0,
|
||||
"modified": "2017-07-06 12:53:17.905022",
|
||||
|
@ -606,3 +606,5 @@ erpnext.patches.v12_0.generate_leave_ledger_entries
|
||||
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
|
||||
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
|
||||
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
|
||||
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
|
||||
erpnext.patches.v12_0.make_item_manufacturer
|
||||
|
27
erpnext/patches/v12_0/make_item_manufacturer.py
Normal file
27
erpnext/patches/v12_0/make_item_manufacturer.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2017, Frappe and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc("stock", "doctype", "item_manufacturer")
|
||||
|
||||
item_manufacturer = []
|
||||
for d in frappe.db.sql(""" SELECT name, manufacturer, manufacturer_part_no, creation, owner
|
||||
FROM `tabItem` WHERE manufacturer is not null and manufacturer != ''""", as_dict=1):
|
||||
item_manufacturer.append((
|
||||
frappe.generate_hash("", 10),
|
||||
d.name,
|
||||
d.manufacturer,
|
||||
d.manufacturer_part_no,
|
||||
d.creation,
|
||||
d.owner
|
||||
))
|
||||
|
||||
if item_manufacturer:
|
||||
frappe.db.sql('''
|
||||
INSERT INTO `tabItem Manufacturer`
|
||||
(`name`, `item_code`, `manufacturer`, `manufacturer_part_no`, `creation`, `owner`)
|
||||
VALUES {}'''.format(', '.join(['%s'] * len(item_manufacturer))), tuple(item_manufacturer)
|
||||
)
|
@ -14,8 +14,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
this._super();
|
||||
},
|
||||
|
||||
onload: function() {
|
||||
this.setup_queries();
|
||||
onload: function(doc, cdt, cdn) {
|
||||
this.setup_queries(doc, cdt, cdn);
|
||||
this._super();
|
||||
|
||||
this.frm.set_query('shipping_rule', function() {
|
||||
@ -50,7 +50,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
/* eslint-enable */
|
||||
},
|
||||
|
||||
setup_queries: function() {
|
||||
setup_queries: function(doc, cdt, cdn) {
|
||||
var me = this;
|
||||
|
||||
if(this.frm.fields_dict.buying_price_list) {
|
||||
@ -90,6 +90,15 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.frm.set_query("manufacturer", "items", function(doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_manufacturer_query",
|
||||
filters:{ 'item_code': row.item_code }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
@ -338,6 +347,25 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
manufacturer: function(doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
|
||||
if(row.manufacturer) {
|
||||
frappe.call({
|
||||
method: "erpnext.stock.doctype.item_manufacturer.item_manufacturer.get_item_manufacturer_part_no",
|
||||
args: {
|
||||
'item_code': row.item_code,
|
||||
'manufacturer': row.manufacturer
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
frappe.model.set_value(cdt, cdn, 'manufacturer_part_no', r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -460,6 +460,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
weight_per_unit: item.weight_per_unit,
|
||||
weight_uom: item.weight_uom,
|
||||
uom : item.uom,
|
||||
manufacturer: item.manufacturer,
|
||||
stock_uom: item.stock_uom,
|
||||
pos_profile: me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : '',
|
||||
cost_center: item.cost_center,
|
||||
|
@ -1,29 +0,0 @@
|
||||
// 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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
@ -1,259 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'feedback',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Action'),
|
||||
'items': ['Quality Action']
|
||||
}
|
||||
],
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
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"];
|
||||
}
|
||||
}
|
||||
};
|
@ -1,23 +0,0 @@
|
||||
/* 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()
|
||||
]);
|
||||
|
||||
});
|
@ -1,31 +0,0 @@
|
||||
# -*- 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]
|
@ -1,142 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
// Copyright (c) 2018, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Customer Feedback Template', {
|
||||
});
|
@ -1,259 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# -*- 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
|
@ -1,23 +0,0 @@
|
||||
/* 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()
|
||||
]);
|
||||
|
||||
});
|
@ -1,35 +0,0 @@
|
||||
# -*- 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]
|
@ -1,75 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -5,83 +5,29 @@ 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();
|
||||
document_name: function(frm){
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: frm.doc.document_type,
|
||||
name: frm.doc.document_name
|
||||
},
|
||||
callback: function(data){
|
||||
frm.fields_dict.resolutions.grid.remove_all();
|
||||
let objectives = [];
|
||||
|
||||
if(frm.doc.document_type === "Quality Review"){
|
||||
for(let i in data.message.reviews) objectives.push(data.message.reviews[i].review);
|
||||
} else {
|
||||
for(let j in data.message.parameters) objectives.push(data.message.parameters[j].feedback);
|
||||
}
|
||||
});
|
||||
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();
|
||||
for (var objective in objectives){
|
||||
frm.add_child("resolutions");
|
||||
frm.fields_dict.resolutions.get_value()[objective].problem = objectives[objective];
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
frm.doc.goal = '';
|
||||
frm.doc.procedure = '';
|
||||
frm.refresh();
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
});
|
@ -1,493 +1,125 @@
|
||||
{
|
||||
"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",
|
||||
"autoname": "format:ACTN-{#####}",
|
||||
"creation": "2018-10-02 11:40:43.666100",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"corrective_preventive",
|
||||
"document_type",
|
||||
"goal",
|
||||
"cb_00",
|
||||
"date",
|
||||
"document_name",
|
||||
"procedure",
|
||||
"status",
|
||||
"sb_00",
|
||||
"resolutions"
|
||||
],
|
||||
"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
|
||||
},
|
||||
"depends_on": "eval:doc.type == 'Quality Review'",
|
||||
"fetch_from": "review.goal",
|
||||
"fieldname": "goal",
|
||||
"fieldtype": "Link",
|
||||
"label": "Goal",
|
||||
"options": "Quality Goal",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"depends_on": "eval:doc.type == 'Quality Review'",
|
||||
"fieldname": "procedure",
|
||||
"fieldtype": "Link",
|
||||
"label": "Procedure",
|
||||
"options": "Quality Procedure",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"default": "Open",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"options": "Open\nClosed"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "document_name",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Document Name",
|
||||
"options": "document_type"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "document_type",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Document Type",
|
||||
"options": "Quality Review\nQuality Feedback",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"default": "Corrective",
|
||||
"fieldname": "corrective_preventive",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Corrective/Preventive",
|
||||
"options": "Corrective\nPreventive",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Resolution"
|
||||
},
|
||||
{
|
||||
"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
|
||||
"fieldname": "resolutions",
|
||||
"fieldtype": "Table",
|
||||
"label": "Resolutions",
|
||||
"options": "Quality Action Resolution"
|
||||
}
|
||||
],
|
||||
"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",
|
||||
],
|
||||
"modified": "2019-05-28 13:10:44.092497",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Action",
|
||||
"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,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"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
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -3,18 +3,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
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'
|
||||
pass
|
@ -1,11 +0,0 @@
|
||||
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"];
|
||||
}
|
||||
}
|
||||
};
|
@ -19,28 +19,28 @@ class TestQualityAction(unittest.TestCase):
|
||||
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)
|
||||
|
||||
self.assertEquals(test_create_action, test_get_action)
|
||||
|
||||
def create_action():
|
||||
review = frappe.get_list("Quality Review", limit=1)
|
||||
review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
|
||||
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'
|
||||
"doctype": "Quality Action",
|
||||
"action": "Corrective",
|
||||
"document_type": "Quality Review",
|
||||
"document_name": review,
|
||||
"date": frappe.utils.nowdate(),
|
||||
"goal": "GOAL-_Test Quality Goal",
|
||||
"procedure": "PRC-_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_exist = frappe.db.exists("Quality Action", {"review": review})
|
||||
|
||||
if not action_exist:
|
||||
action.insert()
|
||||
return action
|
||||
return action.name
|
||||
else:
|
||||
return action_exist[0]
|
||||
return action_exist
|
||||
|
||||
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]
|
||||
review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
|
||||
return frappe.db.exists("Quality Action", {"document_name": review})
|
@ -0,0 +1,40 @@
|
||||
{
|
||||
"creation": "2019-05-26 20:36:44.337186",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"problem",
|
||||
"sb_00",
|
||||
"resolution"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "problem",
|
||||
"fieldtype": "Long Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Problem"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "resolution",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Resolution"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-28 13:09:50.435323",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Action Resolution",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityActionResolution(Document):
|
||||
pass
|
@ -1,205 +0,0 @@
|
||||
{
|
||||
"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,25 @@
|
||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Quality Feedback', {
|
||||
refresh: function(frm) {
|
||||
frm.set_value("date", frappe.datetime.get_today());
|
||||
},
|
||||
template: function(frm){
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Quality Feedback Template",
|
||||
name: frm.doc.template
|
||||
},
|
||||
callback: function(data){
|
||||
frm.fields_dict.parameters.grid.remove_all();
|
||||
for (var i in data.message.parameters){
|
||||
frm.add_child("parameters");
|
||||
frm.fields_dict.parameters.get_value()[i].parameter = data.message.parameters[i].parameter;
|
||||
}
|
||||
frm.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
@ -0,0 +1,95 @@
|
||||
{
|
||||
"autoname": "format:FDBK-{#####}",
|
||||
"creation": "2019-05-26 21:23:05.308379",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"document_type",
|
||||
"template",
|
||||
"cb_00",
|
||||
"document_name",
|
||||
"date",
|
||||
"sb_00",
|
||||
"parameters"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "template",
|
||||
"fieldtype": "Link",
|
||||
"label": "Template",
|
||||
"options": "Quality Feedback Template",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fetch_from": "template.feedback_values",
|
||||
"fieldname": "parameters",
|
||||
"fieldtype": "Table",
|
||||
"label": "Parameters",
|
||||
"options": "Quality Feedback Parameter"
|
||||
},
|
||||
{
|
||||
"fieldname": "document_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Type",
|
||||
"options": "User\nCustomer",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "document_name",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Name",
|
||||
"options": "document_type",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"modified": "2019-05-28 15:16:01.161662",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Feedback",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe and contributors
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CustomerFeedback(Document):
|
||||
class QualityFeedback(Document):
|
||||
pass
|
@ -0,0 +1,53 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.quality_management.doctype.quality_feedback_template.test_quality_feedback_template import create_template
|
||||
|
||||
class TestQualityFeedback(unittest.TestCase):
|
||||
|
||||
def test_quality_feedback(self):
|
||||
create_template()
|
||||
test_create_feedback = create_feedback()
|
||||
test_get_feedback = get_feedback()
|
||||
|
||||
self.assertEqual(test_create_feedback, test_get_feedback)
|
||||
|
||||
def create_feedback():
|
||||
create_customer()
|
||||
|
||||
feedabck = frappe.get_doc({
|
||||
"doctype": "Quality Feedback",
|
||||
"template": "TMPL-_Test Feedback Template",
|
||||
"document_type": "Customer",
|
||||
"document_name": "Quality Feedback Customer",
|
||||
"date": frappe.utils.nowdate(),
|
||||
"parameters": [
|
||||
{
|
||||
"parameter": "Test Parameter",
|
||||
"rating": 3,
|
||||
"feedback": "Test Feedback"
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
feedback_exists = frappe.db.exists("Quality Feedback", {"template": "TMPL-_Test Feedback Template"})
|
||||
|
||||
if not feedback_exists:
|
||||
feedabck.insert()
|
||||
return feedabck.name
|
||||
else:
|
||||
return feedback_exists
|
||||
|
||||
def get_feedback():
|
||||
return frappe.db.exists("Quality Feedback", {"template": "TMPL-_Test Feedback Template"})
|
||||
|
||||
def create_customer():
|
||||
if not frappe.db.exists("Customer", {"customer_name": "Quality Feedback Customer"}):
|
||||
customer = frappe.get_doc({
|
||||
"doctype": "Customer",
|
||||
"customer_name": "Quality Feedback Customer"
|
||||
}).insert(ignore_permissions=True)
|
@ -0,0 +1,57 @@
|
||||
{
|
||||
"creation": "2019-05-26 21:25:01.715807",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"parameter",
|
||||
"cb_00",
|
||||
"rating",
|
||||
"sb_00",
|
||||
"feedback"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "parameter",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Parameter",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "1",
|
||||
"fieldname": "rating",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Rating",
|
||||
"options": "1\n2\n3\n4\n5",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "feedback",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Feedback",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 21:50:48.951264",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Feedback Parameter",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityFeedbackParameter(Document):
|
||||
pass
|
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Quality Feedback Template', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"autoname": "format:TMPL-{template}",
|
||||
"creation": "2019-05-26 21:17:24.283061",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"template",
|
||||
"cb_00",
|
||||
"sb_00",
|
||||
"parameters"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "template",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Template",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "parameters",
|
||||
"fieldtype": "Table",
|
||||
"label": "Parameters",
|
||||
"options": "Quality Feedback Template Parameter"
|
||||
}
|
||||
],
|
||||
"modified": "2019-05-26 21:48:47.770610",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Feedback Template",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityFeedbackTemplate(Document):
|
||||
pass
|
@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestQualityFeedbackTemplate(unittest.TestCase):
|
||||
|
||||
def test_quality_feedback_template(self):
|
||||
test_create_template = create_template()
|
||||
test_get_template = get_template()
|
||||
|
||||
self.assertEqual(test_create_template, test_get_template)
|
||||
|
||||
def create_template():
|
||||
template = frappe.get_doc({
|
||||
"doctype": "Quality Feedback Template",
|
||||
"template": "_Test Feedback Template",
|
||||
"parameters": [
|
||||
{
|
||||
"parameter": "Test Parameter"
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
template_exists = frappe.db.exists("Quality Feedback Template", {"template": "_Test Feedback Template"})
|
||||
|
||||
if not template_exists:
|
||||
template.insert()
|
||||
return template.name
|
||||
else:
|
||||
return template_exists
|
||||
|
||||
def get_template():
|
||||
return frappe.db.exists("Quality Feedback Template", {"template": "_Test Feedback Template"})
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"creation": "2019-05-26 21:20:40.520197",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"parameter"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "parameter",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Parameter"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 21:23:53.574743",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Feedback Template Parameter",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityFeedbackTemplateParameter(Document):
|
||||
pass
|
@ -2,40 +2,7 @@
|
||||
// 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);
|
||||
}
|
||||
refresh: function(frm) {
|
||||
frm.doc.created_by = frappe.session.user;
|
||||
}
|
||||
});
|
||||
|
||||
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();
|
||||
}
|
@ -1,824 +1,149 @@
|
||||
{
|
||||
"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",
|
||||
"autoname": "format:GOAL-{goal}",
|
||||
"creation": "2018-10-02 12:17:41.727541",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"goal",
|
||||
"frequency",
|
||||
"created_by",
|
||||
"cb_00",
|
||||
"procedure",
|
||||
"weekday",
|
||||
"quarter",
|
||||
"date",
|
||||
"sb_00",
|
||||
"revision",
|
||||
"cb_01",
|
||||
"revised_on",
|
||||
"sb_01",
|
||||
"objectives"
|
||||
],
|
||||
"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,
|
||||
"fieldname": "created_by",
|
||||
"fieldtype": "Link",
|
||||
"label": "Created By",
|
||||
"options": "User",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "None",
|
||||
"fieldname": "frequency",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Monitoring Frequency",
|
||||
"options": "None\nDaily\nWeekly\nMonthly\nQuarterly"
|
||||
},
|
||||
{
|
||||
"fieldname": "procedure",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Procedure",
|
||||
"options": "Quality Procedure"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.frequency == 'Monthly' || doc.frequency == 'Quarterly';",
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Select",
|
||||
"label": "Date",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "revision",
|
||||
"fieldtype": "Int",
|
||||
"label": "Revision",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "revised_on",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Revised On",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.frequency == 'Weekly';",
|
||||
"fieldname": "weekday",
|
||||
"fieldtype": "Select",
|
||||
"label": "Weekday",
|
||||
"options": "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday"
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Revision and Revised On"
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_01",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_01",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Objectives"
|
||||
},
|
||||
{
|
||||
"fieldname": "objectives",
|
||||
"fieldtype": "Table",
|
||||
"label": "Objectives",
|
||||
"options": "Quality Goal Objective"
|
||||
},
|
||||
{
|
||||
"fieldname": "goal",
|
||||
"fieldtype": "Data",
|
||||
"label": "Goal",
|
||||
"reqd": 1,
|
||||
"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
|
||||
"default": "January-April-July-October",
|
||||
"depends_on": "eval:doc.frequency == 'Quarterly';",
|
||||
"fieldname": "quarter",
|
||||
"fieldtype": "Select",
|
||||
"label": "Quarter",
|
||||
"options": "January-April-July-October",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"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",
|
||||
],
|
||||
"modified": "2019-05-28 14:49:12.768863",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Goal",
|
||||
"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,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"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
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -3,8 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityGoal(Document):
|
||||
pass
|
||||
|
||||
def validate(self):
|
||||
self.revision += 1
|
||||
self.revised_on = frappe.utils.today()
|
||||
|
@ -1,16 +1,12 @@
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'goal',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Review'),
|
||||
'items': ['Quality Review']
|
||||
},
|
||||
{
|
||||
'label': _('Action'),
|
||||
'items': ['Quality Action']
|
||||
}
|
||||
]
|
||||
}
|
||||
return {
|
||||
'fieldname': 'goal',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Review'),
|
||||
'items': ['Quality Review']
|
||||
}
|
||||
]
|
||||
}
|
@ -14,33 +14,31 @@ class TestQualityGoal(unittest.TestCase):
|
||||
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": [
|
||||
"procedure": "PRC-_Test Quality Procedure",
|
||||
"objectives": [
|
||||
{
|
||||
"objective": "_Test Quality Objective",
|
||||
"target": "4",
|
||||
"unit": "_Test UOM"
|
||||
"uom": "_Test UOM"
|
||||
}
|
||||
]
|
||||
})
|
||||
goal_exist = frappe.db.exists("Quality Goal", ""+ goal.goal +"")
|
||||
goal_exist = frappe.db.exists("Quality Goal", {"goal": goal.goal})
|
||||
if not goal_exist:
|
||||
goal.insert()
|
||||
return goal.goal
|
||||
return goal.name
|
||||
else:
|
||||
return goal_exist
|
||||
|
||||
def get_goal():
|
||||
goal = frappe.db.exists("Quality Goal", "_Test Quality Goal")
|
||||
goal = frappe.db.exists("Quality Goal", "GOAL-_Test Quality Goal")
|
||||
return goal
|
||||
|
||||
def create_unit():
|
||||
@ -48,6 +46,6 @@ def create_unit():
|
||||
"doctype": "UOM",
|
||||
"uom_name": "_Test UOM",
|
||||
})
|
||||
unit_exist = frappe.db.exists("UOM", ""+ unit.uom_name +"")
|
||||
unit_exist = frappe.db.exists("UOM", unit.uom_name)
|
||||
if not unit_exist:
|
||||
unit.insert()
|
||||
|
@ -0,0 +1,51 @@
|
||||
{
|
||||
"autoname": "format:{####}",
|
||||
"creation": "2019-05-26 15:03:43.996455",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"objective",
|
||||
"cb_00",
|
||||
"target",
|
||||
"uom"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fetch_from": "goal.objective",
|
||||
"fieldname": "objective",
|
||||
"fieldtype": "Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Objective",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "target",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Target"
|
||||
},
|
||||
{
|
||||
"fieldname": "uom",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "UOM",
|
||||
"options": "UOM"
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 16:12:54.832058",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Goal Objective",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe and contributors
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CustomerFeedbackTemplateTable(Document):
|
||||
class QualityGoalObjective(Document):
|
||||
pass
|
@ -1,225 +1,93 @@
|
||||
{
|
||||
"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",
|
||||
"autoname": "format:MTNG-{date}",
|
||||
"creation": "2018-10-15 16:25:41.548432",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"date",
|
||||
"cb_00",
|
||||
"status",
|
||||
"sb_00",
|
||||
"agenda",
|
||||
"sb_01",
|
||||
"minutes"
|
||||
],
|
||||
"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
|
||||
},
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"default": "Open",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
"options": "Open\nClose"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "minutes",
|
||||
"fieldtype": "Table",
|
||||
"label": "Minutes",
|
||||
"options": "Quality Meeting Minutes"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"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
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Agenda"
|
||||
},
|
||||
{
|
||||
"fieldname": "agenda",
|
||||
"fieldtype": "Table",
|
||||
"label": "Agenda",
|
||||
"options": "Quality Meeting Agenda"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_01",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Minutes"
|
||||
}
|
||||
],
|
||||
"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",
|
||||
],
|
||||
"modified": "2019-05-26 23:12:23.364357",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Meeting",
|
||||
"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,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"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
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -6,13 +6,4 @@ 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'
|
||||
pass
|
@ -5,27 +5,41 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.quality_management.doctype.quality_review.test_quality_review import create_review
|
||||
|
||||
class TestQualityMeeting(unittest.TestCase):
|
||||
def test_quality_meeting(self):
|
||||
create_review()
|
||||
test_create_meeting = create_meeting()
|
||||
test_get_meeting = get_meeting()
|
||||
self.assertEquals(test_create_meeting.name, test_get_meeting.name)
|
||||
self.assertEquals(test_create_meeting, test_get_meeting)
|
||||
|
||||
def create_meeting():
|
||||
meeting = frappe.get_doc({
|
||||
"doctype": "Quality Meeting",
|
||||
"scope": "Company",
|
||||
"status": "Close",
|
||||
"date": ""+ frappe.as_unicode(frappe.utils.nowdate()) +""
|
||||
"status": "Open",
|
||||
"date": frappe.utils.nowdate(),
|
||||
"agenda": [
|
||||
{
|
||||
"agenda": "Test Agenda"
|
||||
}
|
||||
],
|
||||
"minutes": [
|
||||
{
|
||||
"document_type": "Quality Review",
|
||||
"document_name": frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"}),
|
||||
"minute": "Test Minute"
|
||||
}
|
||||
]
|
||||
})
|
||||
meeting_exist = frappe.get_list("Quality Meeting", filters={"date": ""+ meeting.date +""}, fields=["name"], limit=1)
|
||||
if len(meeting_exist) == 0:
|
||||
meeting_exist = frappe.db.exists("Quality Meeting", {"date": frappe.utils.nowdate(), "status": "Open"})
|
||||
|
||||
if not meeting_exist:
|
||||
meeting.insert()
|
||||
return meeting
|
||||
return meeting.name
|
||||
else:
|
||||
return meeting_exist[0]
|
||||
return meeting_exist
|
||||
|
||||
def get_meeting():
|
||||
meeting = frappe.get_list("Quality Meeting", limit=1)
|
||||
return meeting[0]
|
||||
meeting = frappe.db.exists("Quality Meeting", {"date": frappe.utils.nowdate(), "status": "Open"})
|
||||
return meeting
|
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Quality Meeting Agenda', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"creation": "2019-05-26 20:46:57.999300",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"agenda"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "agenda",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Agenda"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 20:49:01.328146",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Meeting Agenda",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe and contributors
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CustomerFeedbackTable(Document):
|
||||
class QualityMeetingAgenda(Document):
|
||||
pass
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestQualityMeetingAgenda(unittest.TestCase):
|
||||
pass
|
@ -0,0 +1,55 @@
|
||||
{
|
||||
"creation": "2019-05-26 20:45:26.226428",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"document_type",
|
||||
"cb_00",
|
||||
"document_name",
|
||||
"sb_00",
|
||||
"minute"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "minute",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Minute"
|
||||
},
|
||||
{
|
||||
"fieldname": "document_type",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Document Type",
|
||||
"options": "Quality Review\nQuality Action\nQuality Feedback",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "document_name",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Document Name",
|
||||
"options": "document_type"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 22:00:24.833920",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Meeting Minutes",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe and contributors
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityActionTable(Document):
|
||||
class QualityMeetingMinutes(Document):
|
||||
pass
|
@ -1,175 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# -*- 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
|
@ -1,386 +1,106 @@
|
||||
{
|
||||
"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",
|
||||
"autoname": "format:PRC-{procedure}",
|
||||
"creation": "2018-10-06 00:06:29.756804",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"procedure",
|
||||
"parent_quality_procedure",
|
||||
"is_group",
|
||||
"sb_00",
|
||||
"processes",
|
||||
"lft",
|
||||
"rgt",
|
||||
"old_parent"
|
||||
],
|
||||
"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
|
||||
},
|
||||
"fieldname": "parent_quality_procedure",
|
||||
"fieldtype": "Link",
|
||||
"label": "Parent Procedure",
|
||||
"options": "Quality Procedure",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"default": "0",
|
||||
"fieldname": "is_group",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Group",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "lft",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 1,
|
||||
"label": "Lft",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "rgt",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 1,
|
||||
"label": "Rgt",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "old_parent",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "old_parent",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Processes"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "processes",
|
||||
"fieldtype": "Table",
|
||||
"label": "Processes",
|
||||
"options": "Quality Procedure Process"
|
||||
},
|
||||
{
|
||||
"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
|
||||
"fieldname": "procedure",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Procedure",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"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",
|
||||
],
|
||||
"modified": "2019-05-26 22:11:53.771428",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Procedure",
|
||||
"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,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"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
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -11,12 +11,11 @@ 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 +"'"))
|
||||
for process in self.processes:
|
||||
if process.procedure:
|
||||
doc = frappe.get_doc("Quality Procedure", process.procedure)
|
||||
if doc.parent_quality_procedure:
|
||||
frappe.throw(_("{0} already has a Parent Procedure {1}.".format(process.procedure, doc.parent_quality_procedure)))
|
||||
self.is_group = 1
|
||||
|
||||
def on_update(self):
|
||||
@ -28,25 +27,28 @@ class QualityProcedure(NestedSet):
|
||||
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()
|
||||
for process in doc.processes:
|
||||
if process.procedure == self.name:
|
||||
doc.processes.remove(process)
|
||||
doc.save(ignore_permissions=True)
|
||||
|
||||
flag_is_group = 0
|
||||
doc.load_from_db()
|
||||
for data in doc.procedure_step:
|
||||
if data.procedure == "Procedure":
|
||||
|
||||
for process in doc.processes:
|
||||
if process.procedure:
|
||||
flag_is_group = 1
|
||||
|
||||
if flag_is_group == 0:
|
||||
doc.is_group = 0
|
||||
doc.save()
|
||||
doc.save(ignore_permissions=True)
|
||||
|
||||
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)
|
||||
for process in self.processes:
|
||||
if process.procedure:
|
||||
doc = frappe.get_doc("Quality Procedure", process.procedure)
|
||||
doc.parent_quality_procedure = self.name
|
||||
doc.save()
|
||||
doc.save(ignore_permissions=True)
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=False):
|
||||
@ -57,8 +59,11 @@ def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=Fa
|
||||
@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()
|
@ -1,20 +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']
|
||||
}
|
||||
],
|
||||
}
|
||||
return {
|
||||
'fieldname': 'procedure',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Goal'),
|
||||
'items': ['Quality Goal']
|
||||
},
|
||||
{
|
||||
'label': _('Review'),
|
||||
'items': ['Quality Review']
|
||||
},
|
||||
{
|
||||
'label': _('Action'),
|
||||
'items': ['Quality Action']
|
||||
}
|
||||
],
|
||||
}
|
@ -11,25 +11,26 @@ class TestQualityProcedure(unittest.TestCase):
|
||||
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)
|
||||
|
||||
self.assertEquals(test_create_procedure, test_get_procedure.get("name"))
|
||||
self.assertEquals(test_create_nested_procedure, test_get_nested_procedure.get("name"))
|
||||
|
||||
def create_procedure():
|
||||
procedure = frappe.get_doc({
|
||||
"doctype": "Quality Procedure",
|
||||
"procedure": "_Test Quality Procedure",
|
||||
"procedure_step": [
|
||||
"processes": [
|
||||
{
|
||||
"procedure": "Step",
|
||||
"step": "_Test Quality Procedure Table",
|
||||
"process_description": "_Test Quality Procedure Table",
|
||||
}
|
||||
]
|
||||
})
|
||||
procedure_exist = frappe.db.exists("Quality Procedure",""+ procedure.procedure +"")
|
||||
|
||||
procedure_exist = frappe.db.exists("Quality Procedure", "PRC-_Test Quality Procedure")
|
||||
|
||||
if not procedure_exist:
|
||||
procedure.insert()
|
||||
return procedure.procedure
|
||||
return procedure.name
|
||||
else:
|
||||
return procedure_exist
|
||||
|
||||
@ -37,21 +38,22 @@ def create_nested_procedure():
|
||||
nested_procedure = frappe.get_doc({
|
||||
"doctype": "Quality Procedure",
|
||||
"procedure": "_Test Nested Quality Procedure",
|
||||
"procedure_step": [
|
||||
"processes": [
|
||||
{
|
||||
"procedure": "Procedure",
|
||||
"procedure_name": "_Test Quality Procedure",
|
||||
"procedure": "PRC-_Test Quality Procedure"
|
||||
}
|
||||
]
|
||||
})
|
||||
nested_procedure_exist = frappe.db.exists("Quality Procedure",""+ nested_procedure.procedure +"")
|
||||
|
||||
nested_procedure_exist = frappe.db.exists("Quality Procedure", "PRC-_Test Nested Quality Procedure")
|
||||
|
||||
if not nested_procedure_exist:
|
||||
nested_procedure.insert()
|
||||
return nested_procedure.procedure
|
||||
return nested_procedure.name
|
||||
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]
|
||||
procedure = frappe.get_doc("Quality Procedure", "PRC-_Test Quality Procedure")
|
||||
nested_procedure = frappe.get_doc("Quality Procedure", "PRC-_Test Nested Quality Procedure")
|
||||
return {"name": procedure.name}, {"name": nested_procedure.name, "parent_quality_procedure": nested_procedure.parent_quality_procedure}
|
@ -0,0 +1,36 @@
|
||||
{
|
||||
"creation": "2019-05-26 00:10:00.248885",
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"process_description",
|
||||
"procedure"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "process_description",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Process Description"
|
||||
},
|
||||
{
|
||||
"description": "Link existing Quality Procedure.",
|
||||
"fieldname": "procedure",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Procedure",
|
||||
"options": "Quality Procedure"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 22:05:49.007189",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Procedure Process",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityProcedureProcess(Document):
|
||||
pass
|
@ -1,176 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# -*- 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
|
@ -4,69 +4,25 @@
|
||||
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();
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Quality Goal",
|
||||
name: frm.doc.goal
|
||||
},
|
||||
callback: function(data){
|
||||
frm.fields_dict.reviews.grid.remove_all();
|
||||
let objectives = data.message.objectives;
|
||||
for (var i in objectives) {
|
||||
frm.add_child("reviews");
|
||||
frm.fields_dict.reviews.get_value()[i].objective = objectives[i].objective;
|
||||
frm.fields_dict.reviews.get_value()[i].target = objectives[i].target;
|
||||
frm.fields_dict.reviews.get_value()[i].uom = objectives[i].uom;
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
frm.doc.procedure = '';
|
||||
frm.doc.scope = '';
|
||||
frm.doc.action = '';
|
||||
frm.doc.measurable = '';
|
||||
frm.refresh();
|
||||
}
|
||||
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;
|
||||
}
|
||||
});
|
@ -1,424 +1,110 @@
|
||||
{
|
||||
"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",
|
||||
"autoname": "format:REV-{#####}",
|
||||
"creation": "2018-10-02 11:45:16.301955",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"goal",
|
||||
"date",
|
||||
"cb_00",
|
||||
"procedure",
|
||||
"status",
|
||||
"sb_00",
|
||||
"reviews",
|
||||
"sb_01",
|
||||
"additional_information"
|
||||
],
|
||||
"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
|
||||
},
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fetch_from": "goal.procedure",
|
||||
"fieldname": "procedure",
|
||||
"fieldtype": "Link",
|
||||
"label": "Procedure",
|
||||
"options": "Quality Procedure",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "additional_information",
|
||||
"fieldtype": "Text",
|
||||
"label": "Additional Information"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Review"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"collapsible": 1,
|
||||
"fieldname": "sb_01",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Additional Information"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"fieldname": "reviews",
|
||||
"fieldtype": "Table",
|
||||
"label": "Reviews",
|
||||
"options": "Quality Review Objective"
|
||||
},
|
||||
{
|
||||
"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
|
||||
},
|
||||
"default": "Open",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
"options": "Open\nClosed"
|
||||
},
|
||||
{
|
||||
"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
|
||||
"fieldname": "goal",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Goal",
|
||||
"options": "Quality Goal",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"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",
|
||||
],
|
||||
"modified": "2019-05-26 23:12:47.302189",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Review",
|
||||
"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,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "All",
|
||||
"share": 1,
|
||||
"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
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -5,63 +5,50 @@
|
||||
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")
|
||||
day = frappe.utils.getdate().day
|
||||
weekday = frappe.utils.getdate().strftime("%A")
|
||||
month = frappe.utils.getdate().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)
|
||||
for goal in frappe.get_list("Quality Goal", fields=['name', 'frequency', 'date', 'weekday']):
|
||||
if goal.frequency == 'Daily':
|
||||
create_review(goal.name)
|
||||
|
||||
elif data.frequency == 'Weekly':
|
||||
if data.weekly == day_name:
|
||||
create_review(data.name, data.measurable)
|
||||
elif goal.frequency == 'Weekly' and goal.weekday == weekday:
|
||||
create_review(goal.name)
|
||||
|
||||
elif data.frequency == 'Monthly':
|
||||
if data.date == str(day):
|
||||
create_review(data.name, data.measurable)
|
||||
elif goal.frequency == 'Monthly' and goal.date == str(day):
|
||||
create_review(goal.name)
|
||||
|
||||
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 goal.frequency == 'Quarterly' and goal.data == str(day) and get_quarter(month):
|
||||
create_review(goal.name)
|
||||
|
||||
elif data.frequency == 'Half Yearly':
|
||||
if (month == 'January' or month == 'July') and str(day) == data.date:
|
||||
create_review(data.name, data.measurable)
|
||||
def create_review(goal):
|
||||
goal = frappe.get_doc("Quality Goal", goal)
|
||||
|
||||
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({
|
||||
review = frappe.get_doc({
|
||||
"doctype": "Quality Review",
|
||||
"goal": name,
|
||||
"date": frappe.as_unicode(frappe.utils.nowdate()),
|
||||
"measurable": measurable,
|
||||
"goal": goal.name,
|
||||
"date": frappe.utils.getdate()
|
||||
})
|
||||
if measurable == 'Yes':
|
||||
for objective in objectives:
|
||||
doc.append("values",{
|
||||
'objective': objective.objective,
|
||||
'target': objective.target,
|
||||
'achieved': 0,
|
||||
'unit': objective.unit
|
||||
})
|
||||
|
||||
for objective in goal.objectives:
|
||||
review.append("reviews",
|
||||
{
|
||||
"objective": objective.objective,
|
||||
"target": objective.target,
|
||||
"uom": objective.uom
|
||||
}
|
||||
)
|
||||
|
||||
review.insert(ignore_permissions=True)
|
||||
|
||||
def get_quarter(month):
|
||||
if month in ["January", "April", "July", "October"]:
|
||||
return True
|
||||
else:
|
||||
for objective in objectives:
|
||||
doc.append("values",{
|
||||
'objective': objective.objective,
|
||||
})
|
||||
doc.insert()
|
||||
frappe.db.commit()
|
||||
return False
|
@ -1,16 +0,0 @@
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'review',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Action'),
|
||||
'items': ['Quality Action']
|
||||
},
|
||||
{
|
||||
'label': _('Meeting'),
|
||||
'items': ['Quality Meeting']
|
||||
}
|
||||
],
|
||||
}
|
@ -17,31 +17,30 @@ class TestQualityReview(unittest.TestCase):
|
||||
create_goal()
|
||||
test_create_review = create_review()
|
||||
test_get_review = get_review()
|
||||
self.assertEquals(test_create_review.name, test_get_review.name)
|
||||
self.assertEquals(test_create_review, test_get_review)
|
||||
|
||||
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": [
|
||||
"goal": "GOAL-_Test Quality Goal",
|
||||
"procedure": "PRC-_Test Quality Procedure",
|
||||
"date": frappe.utils.nowdate(),
|
||||
"reviews": [
|
||||
{
|
||||
"objective": "_Test Quality Objective",
|
||||
"target": "100",
|
||||
"achieved": "100",
|
||||
"unit": "_Test UOM"
|
||||
"uom": "_Test UOM",
|
||||
"review": "Test Review"
|
||||
}
|
||||
]
|
||||
})
|
||||
review_exist = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1)
|
||||
if len(review_exist) == 0:
|
||||
review.insert()
|
||||
return review
|
||||
review_exist = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
|
||||
if not review_exist:
|
||||
review.insert(ignore_permissions=True)
|
||||
return review.name
|
||||
else:
|
||||
return review_exist[0]
|
||||
return review_exist
|
||||
|
||||
def get_review():
|
||||
review = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1)
|
||||
return review[0]
|
||||
review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
|
||||
return review
|
@ -0,0 +1,64 @@
|
||||
{
|
||||
"creation": "2019-05-26 15:17:44.796958",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"objective",
|
||||
"cb_00",
|
||||
"target",
|
||||
"uom",
|
||||
"sb_00",
|
||||
"review"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "objective",
|
||||
"fieldtype": "Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Objective",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "target",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Target",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "target_unit",
|
||||
"fieldname": "uom",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "UOM",
|
||||
"options": "UOM",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "review",
|
||||
"fieldtype": "Text Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Review"
|
||||
},
|
||||
{
|
||||
"fieldname": "sb_00",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Review"
|
||||
},
|
||||
{
|
||||
"fieldname": "cb_00",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-05-26 16:14:12.586128",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Quality Management",
|
||||
"name": "Quality Review Objective",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2018, Frappe and contributors
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QualityMeetingTable(Document):
|
||||
class QualityReviewObjective(Document):
|
||||
pass
|
@ -1,207 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# -*- 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
|
@ -76,9 +76,8 @@
|
||||
"is_customer_provided_item",
|
||||
"customer",
|
||||
"supplier_details",
|
||||
"manufacturers",
|
||||
"delivered_by_supplier",
|
||||
"manufacturer",
|
||||
"manufacturer_part_no",
|
||||
"column_break2",
|
||||
"supplier_items",
|
||||
"foreign_trade_details",
|
||||
@ -198,6 +197,7 @@
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_item_from_hub",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Item from Hub",
|
||||
@ -218,11 +218,13 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "disabled",
|
||||
"fieldtype": "Check",
|
||||
"label": "Disabled"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "allow_alternative_item",
|
||||
"fieldtype": "Check",
|
||||
"label": "Allow Alternative Item"
|
||||
@ -263,6 +265,7 @@
|
||||
"label": "Standard Selling Rate"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_fixed_asset",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Fixed Asset",
|
||||
@ -439,6 +442,7 @@
|
||||
"label": "Serial Nos and Batches"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.is_stock_item",
|
||||
"fieldname": "has_batch_no",
|
||||
"fieldtype": "Check",
|
||||
@ -448,6 +452,7 @@
|
||||
"oldfieldtype": "Select"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "has_batch_no",
|
||||
"fieldname": "create_new_batch",
|
||||
"fieldtype": "Check",
|
||||
@ -462,12 +467,14 @@
|
||||
"translatable": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "has_batch_no",
|
||||
"fieldname": "has_expiry_date",
|
||||
"fieldtype": "Check",
|
||||
"label": "Has Expiry Date"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "has_batch_no",
|
||||
"fieldname": "retain_sample",
|
||||
"fieldtype": "Check",
|
||||
@ -485,6 +492,7 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset",
|
||||
"fieldname": "has_serial_no",
|
||||
"fieldtype": "Check",
|
||||
@ -601,6 +609,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_customer_provided_item",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Customer Provided Item"
|
||||
@ -619,26 +628,15 @@
|
||||
"label": "Supplier Details"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "delivered_by_supplier",
|
||||
"fieldtype": "Check",
|
||||
"label": "Delivered by Supplier (Drop Ship)",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Manufacturer Part Number"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"label": "Item Code for Suppliers",
|
||||
"oldfieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
@ -718,6 +716,7 @@
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enable_deferred_revenue",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Deferred Revenue"
|
||||
@ -747,6 +746,7 @@
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enable_deferred_expense",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Deferred Expense"
|
||||
@ -800,6 +800,7 @@
|
||||
"options": "fa fa-search"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "inspection_required_before_purchase",
|
||||
"fieldtype": "Check",
|
||||
"label": "Inspection Required before Purchase",
|
||||
@ -807,6 +808,7 @@
|
||||
"oldfieldtype": "Select"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "inspection_required_before_delivery",
|
||||
"fieldtype": "Check",
|
||||
"label": "Inspection Required before Delivery"
|
||||
@ -840,6 +842,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "If subcontracted to a vendor",
|
||||
"fieldname": "is_sub_contracted_item",
|
||||
"fieldtype": "Check",
|
||||
@ -867,6 +870,7 @@
|
||||
"options": "fa fa-globe"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:!doc.variant_of",
|
||||
"fieldname": "show_in_website",
|
||||
"fieldtype": "Check",
|
||||
@ -874,6 +878,7 @@
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "variant_of",
|
||||
"fieldname": "show_variant_in_website",
|
||||
"fieldtype": "Check",
|
||||
@ -1016,6 +1021,12 @@
|
||||
"fieldtype": "Check",
|
||||
"label": "Synced With Hub",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturers",
|
||||
"fieldtype": "Table",
|
||||
"label": "Manufacturers",
|
||||
"options": "Item Manufacturer"
|
||||
}
|
||||
],
|
||||
"has_web_view": 1,
|
||||
@ -1023,7 +1034,7 @@
|
||||
"idx": 2,
|
||||
"image_field": "image",
|
||||
"max_attachments": 1,
|
||||
"modified": "2019-05-16 09:32:27.056036",
|
||||
"modified": "2019-06-02 04:45:59.911507",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Item",
|
||||
|
@ -41,7 +41,7 @@ def get_data():
|
||||
},
|
||||
{
|
||||
'label': _('Manufacture'),
|
||||
'items': ['Work Order']
|
||||
'items': ['Work Order', 'Item Manufacturer']
|
||||
}
|
||||
]
|
||||
}
|
7
erpnext/stock/doctype/item/templates/item.html
Normal file
7
erpnext/stock/doctype/item/templates/item.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>{{ title }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
<!-- this is a sample default web page template -->
|
4
erpnext/stock/doctype/item/templates/item_row.html
Normal file
4
erpnext/stock/doctype/item/templates/item_row.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div>
|
||||
<a href={{ route }}>{{ title }}</a>
|
||||
</div>
|
||||
<!-- this is a sample default list template -->
|
0
erpnext/stock/doctype/item_manufacturer/__init__.py
Normal file
0
erpnext/stock/doctype/item_manufacturer/__init__.py
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Item Manufacturer', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
105
erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
Normal file
105
erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
Normal file
@ -0,0 +1,105 @@
|
||||
{
|
||||
"allow_import": 1,
|
||||
"creation": "2019-06-02 04:41:37.332911",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"item_code",
|
||||
"manufacturer",
|
||||
"manufacturer_part_no",
|
||||
"column_break_3",
|
||||
"item_name",
|
||||
"description"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Manufacturer Part Number",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"label": "Item Code",
|
||||
"options": "Item",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "item_code.item_name",
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Item Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fetch_from": "item_code.description",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"modified": "2019-06-06 19:07:31.175919",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Item Manufacturer",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock User",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Stock Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Item Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"title_field": "item_code",
|
||||
"track_changes": 1
|
||||
}
|
30
erpnext/stock/doctype/item_manufacturer/item_manufacturer.py
Normal file
30
erpnext/stock/doctype/item_manufacturer/item_manufacturer.py
Normal file
@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class ItemManufacturer(Document):
|
||||
def validate(self):
|
||||
self.validate_duplicate_entry()
|
||||
|
||||
def validate_duplicate_entry(self):
|
||||
if self.is_new():
|
||||
filters = {
|
||||
'item_code': self.item_code,
|
||||
'manufacturer': self.manufacturer,
|
||||
'manufacturer_part_no': self.manufacturer_part_no
|
||||
}
|
||||
|
||||
if frappe.db.exists("Item Manufacturer", filters):
|
||||
frappe.throw(_("Duplicate entry against the item code {0} and manufacturer {1}")
|
||||
.format(self.item_code, self.manufacturer))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_item_manufacturer_part_no(item_code, manufacturer):
|
||||
return frappe.db.get_value("Item Manufacturer",
|
||||
{'item_code': item_code, 'manufacturer': manufacturer}, 'manufacturer_part_no')
|
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestItemManufacturer(unittest.TestCase):
|
||||
pass
|
@ -15,6 +15,10 @@
|
||||
"brand",
|
||||
"image_section",
|
||||
"image",
|
||||
"manufacture_details",
|
||||
"manufacturer",
|
||||
"column_break_12",
|
||||
"manufacturer_part_no",
|
||||
"quantity_and_warehouse",
|
||||
"qty",
|
||||
"uom",
|
||||
@ -378,11 +382,32 @@
|
||||
{
|
||||
"fieldname": "dimension_col_break",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacture_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Manufacture"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Manufacturer",
|
||||
"options": "Manufacturer"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_12",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "manufacturer_part_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Manufacturer Part Number",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2019-05-25 22:03:10.517886",
|
||||
"modified": "2019-06-02 06:49:36.493957",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Material Request Item",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user