Skip to content

Commit

Permalink
POC Check
Browse files Browse the repository at this point in the history
  • Loading branch information
Talleyrand333 committed Nov 11, 2024
1 parent 9aabd3f commit efe9217
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 61 deletions.
15 changes: 2 additions & 13 deletions one_fm/one_fm/doctype/general_attendance/general_attendance.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions one_fm/operations/doctype/mom/mom.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
"fieldname": "attendees",
"fieldtype": "Table",
"label": "Attendees",
"options": "MOM POC",
"read_only": 1
"options": "MOM POC"
},
{
"fieldname": "section_break_5",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion one_fm/operations/doctype/mom/mom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')



Expand Down
90 changes: 49 additions & 41 deletions one_fm/operations/doctype/mom_poc/mom_poc.json
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions one_fm/operations/doctype/poc_check/poc_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
},
});
9 changes: 6 additions & 3 deletions one_fm/operations/doctype/poc_check/poc_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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 <b>{each.poc_name}</b> is not set as a POC in <b>{one}</b> <b>{self.project if one=='Project' else self.site}</b>")


0 comments on commit efe9217

Please sign in to comment.