Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version-15 to Staging #3893

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
31c1972
POC-data-export-issue
yusuffGoodie Dec 5, 2024
6e420c3
added project_type field
NoBoneZ Dec 19, 2024
3891e7b
added patch for historical tasks
NoBoneZ Dec 19, 2024
0f6fd9d
added check for relieving date
NoBoneZ Dec 22, 2024
4df0d6a
bypassed allocation days validation
NoBoneZ Dec 22, 2024
81e164f
Merge pull request #3887 from ONE-F-M/188715631
Talleyrand333 Dec 22, 2024
6672c45
Merge pull request #3889 from ONE-F-M/188715639
Talleyrand333 Dec 22, 2024
a9c9546
removed unused addition
NoBoneZ Dec 22, 2024
5331393
Merge pull request #3883 from ONE-F-M/188708378
pjamsheer Dec 23, 2024
cc748df
Merge pull request #3884 from ONE-F-M/188708425
pjamsheer Dec 23, 2024
afd9b94
fix: added validation for leave application role checking
ibtesam-onefm Jan 7, 2025
0a73728
allowed only procurement manager to make updates in PO at all stages
ibtesam-onefm Jan 7, 2025
8695639
purchase officer should have access to make changes in draft PO
ibtesam-onefm Jan 7, 2025
689bd7a
Merge pull request #3845 from ONE-F-M/POC-data-export-issue
pjamsheer Jan 9, 2025
1b12f1f
Merge pull request #3919 from ONE-F-M/188751538
pjamsheer Jan 9, 2025
57360a5
Merge pull request #3918 from ONE-F-M/188751184
pjamsheer Jan 9, 2025
b7a6897
report on absentees per supervisors
samdanikouser Jan 12, 2025
73c37ce
fixed po workflow pending purchase manager state
ibtesam-onefm Jan 13, 2025
5138412
Merge pull request #3927 from ONE-F-M/188751538
pjamsheer Jan 13, 2025
ec11dad
Merge pull request #3925 from ONE-F-M/188648472
ks093 Jan 13, 2025
a6f3438
job applicant dialog box chnages
samdanikouser Dec 29, 2024
8a176d1
removed console
samdanikouser Dec 29, 2024
0b8306b
recruitment-story
yusuffGoodie Dec 29, 2024
b4d7884
added shortlisted
samdanikouser Dec 30, 2024
529f44c
decline popup
samdanikouser Dec 30, 2024
9c894bc
magic link
samdanikouser Dec 30, 2024
a14d116
updated the popup to visible only once
samdanikouser Dec 30, 2024
f0a6829
feat: auto email job offer
pjamsheer Dec 30, 2024
e171c21
feat: Job Offer email on Magic link submit
pjamsheer Dec 31, 2024
9fd05e5
fix: Job Offer - On Accept Applicant
pjamsheer Jan 13, 2025
4d66287
feat: Mark as shortlisted - conf
pjamsheer Jan 13, 2025
5a55358
feat: Shortlisted applicant
pjamsheer Jan 13, 2025
5a34eca
Merge pull request #3930 from ONE-F-M/rec_update
pjamsheer Jan 13, 2025
98bf683
feat: job offer-validate shift project in alacarte hiring
pjamsheer Jan 14, 2025
60471e6
Merge pull request #3931 from ONE-F-M/rec_updates
pjamsheer Jan 14, 2025
ff291f2
fix: Job Applicant - realtime msg
pjamsheer Jan 15, 2025
38a8c9a
fix: Job Offer terms from the ERF
pjamsheer Jan 15, 2025
ab86b4c
Merge pull request #3935 from ONE-F-M/rec_updates
pjamsheer Jan 15, 2025
8e1eec0
filter for roster in absentees report
samdanikouser Jan 16, 2025
35c4872
Merge pull request #3938 from ONE-F-M/188789442
Talleyrand333 Jan 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions one_fm/accommodation/doctype/accommodation/accommodation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import frappe
import functools
from frappe.model.document import Document
from frappe import _

class Accommodation(Document):
def autoname(self):
Expand Down Expand Up @@ -59,3 +60,38 @@ def accommodation_contact_update(doc, method):
link_name = doc.get_link_for('Accommodation')
if link_name and doc.one_fm_doc_contact_field:
frappe.db.set_value('Accommodation', link_name, doc.one_fm_doc_contact_field, doc.name)


def validate_contact(doc, method):
if doc.has_value_changed("first_name") or doc.has_value_changed("last_name"):

base_name = f"{doc.first_name or ''} {doc.last_name or ''}".strip()

if base_name and base_name != doc.name:
new_name = make_unique_name(base_name)

if new_name != doc.name:
frappe.rename_doc("Contact", doc.name, new_name, force=True)
doc.name = new_name
doc.db_set("last_name", doc.last_name)
doc.db_set("first_name", doc.first_name)

# Notify frontend to redirect to the new URL
frappe.msgprint(
_("The contact has been renamed. Redirecting to the new page..."),
indicator="green"
)
frappe.local.response["location"] = frappe.utils.get_url(f"/app/contact/{new_name}")


def make_unique_name(base_name, count=0):
"""
Generates a unique name by appending a counter if necessary.
"""

unique_name = f"{base_name}-{count}" if count > 0 else base_name

if frappe.db.exists("Contact", unique_name):
return make_unique_name(base_name, count + 1)

return unique_name
2 changes: 1 addition & 1 deletion one_fm/after_migrate/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,4 @@ def run_command(command, cwd=None, shell=True):
except subprocess.CalledProcessError as e:
print(f"An error occurred while running the command: {e}")
print(f"Output: {e.stdout}")
print(f"Error: {e.stderr}")
print(f"Error: {e.stderr}")
5 changes: 5 additions & 0 deletions one_fm/api/v1/leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ def proof_document_required_for_leave_type(leave_type):
def leave_approver_action(leave_id: str,status: str) -> dict:
try:
doc = frappe.get_doc("Leave Application",{"name":leave_id})
has_leave_approver_role = "Leave Approver" in frappe.get_roles(frappe.session.user)

if not has_leave_approver_role:
return response("error", 403, {}, "You are not allowed to approve leave applications")

if doc:
if not doc.leave_approver in [frappe.session.user, 'administrator']:
return response("error", 401, {}, "Unauthorised.")
Expand Down
8 changes: 4 additions & 4 deletions one_fm/fixtures/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@
"workflow_builder_id": null
},
{
"allow_edit": "Purchase Manager",
"allow_edit": "Procurement Manager",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
Expand All @@ -1489,7 +1489,7 @@
"workflow_builder_id": null
},
{
"allow_edit": "Finance PO Approver",
"allow_edit": "Procurement Manager",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
Expand All @@ -1504,7 +1504,7 @@
"workflow_builder_id": null
},
{
"allow_edit": "Purchase User",
"allow_edit": "Procurement Manager",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
Expand All @@ -1519,7 +1519,7 @@
"workflow_builder_id": null
},
{
"allow_edit": "Purchase User",
"allow_edit": "Procurement Manager",
"avoid_status_override": 0,
"doc_status": "1",
"is_optional_state": 0,
Expand Down
54 changes: 53 additions & 1 deletion one_fm/hiring/doctype/hiring_settings/hiring_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"performance_profile_resource",
"performance_profile_guid",
"job_offer_section",
"auto_email_job_offer",
"job_offer_workflow_state",
"auto_email_hiring_method",
"job_offer_print_format",
"job_offer_email_template",
"column_break_vjwl",
"notify_finance_department_for_job_offer_salary_advance",
"default_terms_and_conditions",
"job_applicaion_section",
Expand Down Expand Up @@ -143,11 +149,57 @@
"fieldtype": "Link",
"label": "Default Terms and Conditions",
"options": "Terms and Conditions"
},
{
"default": "0",
"description": "If Checked, then the system will Email Job Offer Automatically on Workflow State and Hiring Method",
"fieldname": "auto_email_job_offer",
"fieldtype": "Check",
"label": "Auto Email Job Offer"
},
{
"fieldname": "column_break_vjwl",
"fieldtype": "Column Break"
},
{
"depends_on": "auto_email_job_offer",
"description": "Email Job Offer based on the Hiring Method selected here",
"fieldname": "auto_email_hiring_method",
"fieldtype": "Select",
"label": "Auto Email Hiring Method",
"mandatory_depends_on": "auto_email_job_offer",
"options": "\nBulk Recruitment\nA la carte Recruitment\nAll Recruitment"
},
{
"depends_on": "auto_email_job_offer",
"description": "Email Job Offer on the selected workflow state",
"fieldname": "job_offer_workflow_state",
"fieldtype": "Link",
"label": "Auto Email Job Offer Workflow State",
"mandatory_depends_on": "auto_email_job_offer",
"options": "Workflow State"
},
{
"depends_on": "auto_email_job_offer",
"description": "Selected Email Template will be used in Job Offer Auto Email. If not selected any default message will send to the candidate.",
"fieldname": "job_offer_email_template",
"fieldtype": "Link",
"label": "Job Offer Email Template",
"options": "Email Template"
},
{
"depends_on": "auto_email_job_offer",
"description": "Selected Print Format will use to attach in the email",
"fieldname": "job_offer_print_format",
"fieldtype": "Link",
"label": "Job Offer Print Format",
"mandatory_depends_on": "auto_email_job_offer",
"options": "Print Format"
}
],
"issingle": 1,
"links": [],
"modified": "2024-02-27 08:29:05.173163",
"modified": "2024-12-30 17:44:45.951842",
"modified_by": "Administrator",
"module": "Hiring",
"name": "Hiring Settings",
Expand Down
19 changes: 18 additions & 1 deletion one_fm/hiring/doctype/hiring_settings/hiring_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,25 @@
# For license information, please see license.txt

from __future__ import unicode_literals
# import frappe
import frappe
from frappe.model.document import Document

class HiringSettings(Document):
pass


def get_job_offer_auto_email_settings():
"""
Retrieves the job offer auto-email settings from the 'Hiring Settings' doctype.

The function fetches specific fields related to automatic job offer emails,
such as whether auto-emailing is enabled, the workflow state to trigger the email,
the hiring method, and the email template to use.

Returns:
dict: A dictionary containing the values of the specified fields from the 'Hiring Settings' doctype.
"""
fields = [
'auto_email_job_offer', 'job_offer_workflow_state', 'auto_email_hiring_method', 'job_offer_email_template'
]
return frappe.db.get_value('Hiring Settings', None, fields, as_dict=1)
20 changes: 14 additions & 6 deletions one_fm/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
"Task": "public/js/doctype_js/task.js",
"HD Ticket": "public/js/doctype_js/hd_ticket.js",
"Appraisal": "public/js/doctype_js/appraisal.js",
"Employee Performance Feedback":"public/js/doctype_js/employee_performance_feedback.js"
"Employee Performance Feedback":"public/js/doctype_js/employee_performance_feedback.js",
"Contact": "public/js/doctype_js/contact.js"
}
doctype_list_js = {
"Job Applicant" : "public/js/doctype_js/job_applicant_list.js",
Expand Down Expand Up @@ -249,7 +250,7 @@
"after_insert":[
"one_fm.overrides.hd_ticket.send_google_chat_notification",
"one_fm.overrides.hd_ticket.notify_ticket_raiser_of_receipt"
],
],
"on_change": "one_fm.overrides.hd_ticket.notify_issue_raiser_about_priority",
"on_update": "one_fm.overrides.hd_ticket.apply_ticket_escalation"
},
Expand All @@ -262,7 +263,11 @@
"Job Applicant": {
"validate": "one_fm.utils.validate_job_applicant",
"onload": "one_fm.utils.validate_pam_file_number_and_pam_designation",
"on_update": "one_fm.one_fm.utils.send_notification_to_grd_or_recruiter"
"on_update": [
"one_fm.one_fm.utils.send_notification_to_grd_or_recruiter",
"one_fm.utils.on_update_job_applicant"
]

},
"Warehouse": {
"autoname": "one_fm.utils.warehouse_naming_series",
Expand Down Expand Up @@ -306,7 +311,8 @@
]
},
"Contact": {
"on_update": "one_fm.accommodation.doctype.accommodation.accommodation.accommodation_contact_update"
"on_update": "one_fm.accommodation.doctype.accommodation.accommodation.accommodation_contact_update",
"validate": "one_fm.accommodation.doctype.accommodation.accommodation.validate_contact",
},
"Project": {
"validate": [
Expand Down Expand Up @@ -376,7 +382,7 @@
"after_insert": [
"one_fm.utils.assign_issue",
"one_fm.api.doc_methods.issue.notify_issue_raiser"

],
"on_update": "one_fm.utils.notify_on_close",
},
Expand Down Expand Up @@ -508,7 +514,9 @@
"Payroll Entry": "one_fm.overrides.payroll_entry.PayrollEntryOverride",
"Salary Slip": "one_fm.overrides.salary_slip.SalarySlipOverride",
"Interview Feedback": "one_fm.overrides.interview_feedback.InterviewFeedbackOverride",

"Leave Allocation": "one_fm.overrides.leave_allocation.LeaveAllocationOverride",
"Interview": "one_fm.overrides.interview.InterviewOverride",

# "User": "one_fm.overrides.user.UserOverride"
}

Expand Down
3 changes: 0 additions & 3 deletions one_fm/one_fm/custom/designation_skill.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
"non_negative": 0,
"options": "",
"owner": "Administrator",
"parent": null,
"parentfield": null,
"parenttype": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
Expand Down
Loading