From efe921764f88a371c8ddfd36ea82bca57cb2cf2a Mon Sep 17 00:00:00 2001 From: Ebuka Date: Mon, 11 Nov 2024 11:37:10 +0100 Subject: [PATCH] POC Check --- .../general_attendance.json | 15 +--- one_fm/operations/doctype/mom/mom.json | 5 +- one_fm/operations/doctype/mom/mom.py | 4 +- .../operations/doctype/mom_poc/mom_poc.json | 90 ++++++++++--------- .../operations/doctype/poc_check/poc_check.js | 1 + .../operations/doctype/poc_check/poc_check.py | 9 +- 6 files changed, 63 insertions(+), 61 deletions(-) diff --git a/one_fm/one_fm/doctype/general_attendance/general_attendance.json b/one_fm/one_fm/doctype/general_attendance/general_attendance.json index 3126f21be..d60c115ad 100644 --- a/one_fm/one_fm/doctype/general_attendance/general_attendance.json +++ b/one_fm/one_fm/doctype/general_attendance/general_attendance.json @@ -6,26 +6,15 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ - "attendees", "attendees_designation", "attended_meeting" ], "fields": [ { - "fieldname": "attendees", - "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Attendees", - "options": "User" - }, - { - "fetch_from": "attendees.full_name", "fieldname": "attendees_designation", "fieldtype": "Data", "in_list_view": 1, - "label": "Attendees Full Name", - "read_only": 1 + "label": "Attendees Full Name" }, { "default": "0", @@ -39,7 +28,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2024-11-10 20:24:55.032713", + "modified": "2024-11-11 12:53:50.378306", "modified_by": "Administrator", "module": "One Fm", "name": "General Attendance", diff --git a/one_fm/operations/doctype/mom/mom.json b/one_fm/operations/doctype/mom/mom.json index 15ea39c17..010da489e 100755 --- a/one_fm/operations/doctype/mom/mom.json +++ b/one_fm/operations/doctype/mom/mom.json @@ -63,8 +63,7 @@ "fieldname": "attendees", "fieldtype": "Table", "label": "Attendees", - "options": "MOM POC", - "read_only": 1 + "options": "MOM POC" }, { "fieldname": "section_break_5", @@ -233,7 +232,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2024-11-10 08:20:30.914523", + "modified": "2024-11-11 13:07:53.357841", "modified_by": "Administrator", "module": "Operations", "name": "MOM", diff --git a/one_fm/operations/doctype/mom/mom.py b/one_fm/operations/doctype/mom/mom.py index ef555d83c..ee2bc041c 100755 --- a/one_fm/operations/doctype/mom/mom.py +++ b/one_fm/operations/doctype/mom/mom.py @@ -53,11 +53,13 @@ def create_poc_check(self): 'doctype': "POC Check", 'name': poc_check_doc.name, 'assign_to': [mom_user], - 'description':f"Kindly Update this document to update the POC details for {self.project}", + 'description':f"Kindly fill and submit this document to update the POC details for Site: {self.site} and Project: {self.project}", "date": frappe.utils.getdate(), "priority": "Medium" }) frappe.db.commit() + frappe.msgprint(_(f"POC Check {poc_check_doc.name} Created!"), + alert=True, indicator='green') diff --git a/one_fm/operations/doctype/mom_poc/mom_poc.json b/one_fm/operations/doctype/mom_poc/mom_poc.json index 1f09e92ea..c0bbc731b 100755 --- a/one_fm/operations/doctype/mom_poc/mom_poc.json +++ b/one_fm/operations/doctype/mom_poc/mom_poc.json @@ -1,42 +1,50 @@ { - "creation": "2020-04-27 14:56:26.766154", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": ["poc_name", "poc_designation", "attended_meeting"], - "fields": [ - { - "fieldname": "poc_name", - "fieldtype": "Link", - "in_list_view": 1, - "label": "POC Name", - "options": "Contact" - }, - { - "default": "0", - "fieldname": "attended_meeting", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Attended Meeting" - }, - { - "fetch_from": "poc_name.designation", - "fieldname": "poc_designation", - "fieldtype": "Data", - "in_list_view": 1, - "label": "POC Designation", - "read_only": 1 - } - ], - "istable": 1, - "modified": "2020-04-27 15:54:06.313386", - "modified_by": "Administrator", - "module": "Operations", - "name": "MOM POC", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1 -} + "actions": [], + "creation": "2020-04-27 14:56:26.766154", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "poc_name", + "poc_designation", + "attended_meeting" + ], + "fields": [ + { + "fieldname": "poc_name", + "fieldtype": "Link", + "in_list_view": 1, + "label": "POC Name", + "options": "Contact", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "attended_meeting", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Attended Meeting" + }, + { + "fetch_from": "poc_name.designation", + "fieldname": "poc_designation", + "fieldtype": "Data", + "in_list_view": 1, + "label": "POC Designation", + "read_only": 1 + } + ], + "istable": 1, + "links": [], + "modified": "2024-11-11 13:08:29.073583", + "modified_by": "Administrator", + "module": "Operations", + "name": "MOM POC", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 +} \ No newline at end of file diff --git a/one_fm/operations/doctype/poc_check/poc_check.js b/one_fm/operations/doctype/poc_check/poc_check.js index d83d4c0e1..5ab45e40d 100644 --- a/one_fm/operations/doctype/poc_check/poc_check.js +++ b/one_fm/operations/doctype/poc_check/poc_check.js @@ -5,6 +5,7 @@ frappe.ui.form.on("POC Check", { refresh(frm) { if(frm.doc.docstatus ==0){ frm.set_intro("On each row of the MOM POC Table, Update the Action field with the appropriate action for the POC",'blue') + frm.set_intro("Select Update POC if the contact for the Project and Site should be changed.\n Select Do Nothing If the contact for the Project and Site should be unchanged",'blue') } }, }); diff --git a/one_fm/operations/doctype/poc_check/poc_check.py b/one_fm/operations/doctype/poc_check/poc_check.py index d85272ddd..353b6a7fc 100644 --- a/one_fm/operations/doctype/poc_check/poc_check.py +++ b/one_fm/operations/doctype/poc_check/poc_check.py @@ -8,10 +8,13 @@ class POCCheck(Document): - def on_submit(self): + def validate_rows(self): for each in self.mom_poc_table: if each.action not in ['Do Nothing',"Update POC"]: frappe.throw(f"Please set an action for row {each.idx} in MOM POC Table") + + def on_submit(self): + self.validate_rows() self.remove_assignments() self.update_poc_details() @@ -33,8 +36,8 @@ def update_poc_details(self): existing_row.poc = each.new_poc_name existing_row.designation = each.new_poc_designation existing_row.save() - except frappe.DoesNotExistError: + except frappe.exceptions.DoesNotExistError: frappe.throw(f"Please note that {each.poc_name} is not set as a POC in {one} {self.project if one=='Project' else self.site}") - +