internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: tensorlayer/TensorLayer

Issue:
Issue about tf.layers.initialize_rnn_state
Function `tf.layers.initialize_rnn_state` is used by several tutorials (e.g., `tutorial_ptb_lstm.py`). However, this function does not consider the situation where `batch_size` is not fixed. For example:

```python
X = tf.placeholder(tf.int32, [None, num_steps])
```

I wrote a small RNN model by imitating `tutorial_ptb_lstm.py`, but the `batch_size` of my inputs is flexible. So I can not use `tf.layers.initialize_rnn_state` directly. I need to do like this:

```python
c = lstm.initial_state.c.eval(feed_dict={X: dataX})
h = lstm.initial_state.h.eval(feed_dict={X: dataX})
state = (c, h)
```

Is it possible to add the argument `feed_dict` to `tf.layers.initialize_rnn_state` to handle this kind of situation?

I've sent a pr about this. I'll appreciate if someone can help to check.


Discussion:

Resolving patch:
diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py
--- a/tensorlayer/layers.py
+++ b/tensorlayer/layers.py
@@ -115,13 +115,14 @@ def set_name_reuse(enable=True):
     """
     set_keep['name_reuse'] = enable
 
-def initialize_rnn_state(state):
+def initialize_rnn_state(state, feed_dict=None):
     """Return the initialized RNN state.
-    The input is LSTMStateTuple or State of RNNCells.
+    The inputs are LSTMStateTuple or State of RNNCells and an optional feed_dict.
 
     Parameters
     -----------
     state : a RNN state.
+    feed_dict : a dictionary.
     """
     try: # TF1.0
         LSTMStateTuple = tf.contrib.rnn.LSTMStateTuple
@@ -129,11 +130,11 @@ def initialize_rnn_state(state):
         LSTMStateTuple = tf.nn.rnn_cell.LSTMStateTuple
 
     if isinstance(state, LSTMStateTuple):
-        c = state.c.eval()
-        h = state.h.eval()
+        c = state.c.eval(feed_dict=feed_dict)
+        h = state.h.eval(feed_dict=feed_dict)
         return (c, h)
     else:
-        new_state = state.eval()
+        new_state = state.eval(feed_dict=feed_dict)
         return new_state
 
 def print_all_variables(train_only=False):


Test patch:
Repository: tensorlayer/TensorLayer

Issue:
install error
### New Issue Checklist

- [ ]ImportError: No module named progressbar

### Issue Description

 when i use the command pip install -e .,error occurs as 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/dega/Downloads/degawong/tensorflow/tensorlayer/setup.py", line 18, in <module>
        from tensorlayer import (
      File "tensorlayer/__init__.py", line 14, in <module>
        from . import files
      File "tensorlayer/files.py", line 12, in <module>
        import progressbar
    ImportError: No module named progressbar
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/.../tensorflow/tensorlayer/

but if i use import progressbar,it works well and get current screen picture
someone helps me,thanks

### Reproducible Code

- ubuntu 17.10

[INSERT CODE HERE]

```python
pip install -e .





Discussion:
Are you sure, you have the latest master version?

If you don't need to install from sources, you can use the PyPI package.

`pip install tensorlayer`

Can you give us the output of this command :

`pip freeze`

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -57,6 +57,7 @@ def req_file(filename):
 extras_require = {
     'tf_cpu': ['tensorflow>=1.8.0,<1.9'],
     'tf_gpu': ['tensorflow-gpu>=1.8.0,<1.9'],
+	'db': req_file("requirements_db.txt"),
 	'dev': req_file("requirements_dev.txt"),
 	'doc': req_file("docs/requirements.txt"),
 	'test': req_file("tests/requirements.txt")
diff --git a/tensorlayer/__init__.py b/tensorlayer/__init__.py
--- a/tensorlayer/__init__.py
+++ b/tensorlayer/__init__.py
@@ -3,19 +3,7 @@
 """Deep learning and Reinforcement learning library for Researchers and Engineers"""
 from __future__ import absolute_import
 
-import pkg_resources
-installed_packages = [d for d in pkg_resources.working_set]
-
-TF_is_installed = False
-TL_is_installed = False
-
-for package in installed_packages:
-    if 'tensorflow' in package.project_name:
-        TF_is_installed = True
-    if 'tensorlayer' in package.project_name and 'site-packages' in package.location:
-        TL_is_installed = True
-
-if TF_is_installed:  # The tensorlayer package is installed
+try:
     import tensorflow
 
     from . import activation
@@ -38,9 +26,14 @@
     global_flag = {}
     global_dict = {}
 
-elif TL_is_installed:
-    install_instr = "Please make sure you install a recent enough version of TensorFlow."
-    raise ImportError("__init__.py : Could not import TensorFlow. {}".format(install_instr))
+except Exception as e:
+
+    import pkg_resources
+    installed_packages = [d for d in pkg_resources.working_set]
+
+    for package in installed_packages:
+        if 'tensorlayer' in package.project_name and 'site-packages' in package.location:
+            raise ImportError("__init__.py : Could not import TensorLayer.\nError: {}".format(e))
 
 # Use the following formating: (major, minor, patch, prerelease)
 VERSION = (1, 8, 5, 'rc2')


Test patch:
Repository: tensorlayer/TensorLayer

Issue:
Should change np.hstack to np.vstack.
https://github.com/tensorlayer/tensorlayer/blob/4db0b9f52f629742967eb05e3ddb1a23a5ca666f/tensorlayer/utils.py#L323


Discussion:

Resolving patch:
diff --git a/tensorlayer/utils.py b/tensorlayer/utils.py
--- a/tensorlayer/utils.py
+++ b/tensorlayer/utils.py
@@ -320,7 +320,7 @@ def predict(sess, network, X, x, y_op, batch_size=None):
             if result is None:
                 result = result_a
             else:
-                result = np.hstack((result, result_a))  # TODO: https://github.com/tensorlayer/tensorlayer/issues/288
+                result = np.concatenate((result, result_a))
         if result is None:
             if len(X) % batch_size != 0:
                 dp_dict = dict_to_one(network.all_drop)
@@ -338,7 +338,7 @@ def predict(sess, network, X, x, y_op, batch_size=None):
                 }
                 feed_dict.update(dp_dict)
                 result_a = sess.run(y_op, feed_dict=feed_dict)
-                result = np.hstack((result, result_a))  # TODO: https://github.com/tensorlayer/tensorlayer/issues/288
+                result = np.concatenate((result, result_a))
         return result
 
 


Test patch:
diff --git a/tests/test_utils_predict.py b/tests/test_utils_predict.py
new file mode 100644
--- /dev/null
+++ b/tests/test_utils_predict.py
@@ -0,0 +1,51 @@
+import unittest
+
+try:
+    from tests.unittests_helper import CustomTestCase
+except ImportError:
+    from unittests_helper import CustomTestCase
+
+import tensorflow as tf
+import tensorlayer as tl
+import numpy as np
+
+
+class Util_Predict_Test(CustomTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.x1 = tf.placeholder(tf.float32, [None, 5, 5, 3])
+        cls.x2 = tf.placeholder(tf.float32, [8, 5, 5, 3])
+        cls.X1 = np.ones([127, 5, 5, 3])
+        cls.X2 = np.ones([7, 5, 5, 3])
+        cls.batch_size = 8
+
+    @classmethod
+    def tearDownClass(cls):
+        tf.reset_default_graph()
+
+    def test_case1(self):
+        with self.assertNotRaises(Exception):
+            with tf.Session() as sess:
+                n = tl.layers.InputLayer(self.x1)
+                y = n.outputs
+                y_op = tf.nn.softmax(y)
+                tl.utils.predict(sess, n, self.X1, self.x1, y_op, batch_size=self.batch_size)
+                sess.close()
+
+    def test_case2(self):
+        with self.assertRaises(Exception):
+            with tf.Session() as sess:
+                n = tl.layers.InputLayer(self.x2)
+                y = n.outputs
+                y_op = tf.nn.softmax(y)
+                tl.utils.predict(sess, n, self.X2, self.x2, y_op, batch_size=self.batch_size)
+                sess.close()
+
+
+if __name__ == '__main__':
+
+    # tf.logging.set_verbosity(tf.logging.INFO)
+    tf.logging.set_verbosity(tf.logging.DEBUG)
+
+    unittest.main()
Repository: frappe/hrms

Issue:
Mark attendance considers only joining month and date not year
### Information about bug

Description of the issue
While marking the attendance from the "Mark attendance" button in attendance list, the unmarked dates coming are incorrect.
It compares the joining date of the employee to current month and put the starting date same as joining day if months are same. It is not checking the year of joining.

For example, if the employee has joined 22nd May 2021, if we are trying to mark attendance for may month 2022, the attendance dates are starting from 23rd of may 2022.


Steps to reproduce the issue
Put the joining date as any date of the month you are trying to mark the attendance, but not current year
Go to attendance list and click on mark attendance button, and select the employee and same month of joining
It will show unmarked days starting from joining date even though the person has joined last year
Observed result
![image](https://user-images.githubusercontent.com/67686213/172105439-0c3e37bb-d8bf-450c-85be-d22b1bc65134.png)

![image](https://user-images.githubusercontent.com/67686213/172105472-79f36593-070f-41e0-831f-174d826f1444.png)


Expected result
![image](https://user-images.githubusercontent.com/67686213/172105523-cad99a85-b47a-480d-8b6a-bb80804417d1.png)


### Module

HR

### Version

ERPNext: v13.32.0 (HEAD)
Frappe Framework: v13.31.0 (HEAD)

### Installation method

FrappeCloud

### Relevant log output / Stack trace / Full Error Message.

```shell
Code snippet
method: 'erpnext.hr.doctype.attendance.attendance.get_unmarked_days',

if joining_date and joining_date.month == month_map[month]:
start_day = joining_date.day
if relieving_date and relieving_date.month == month_map[month]:
end_day = relieving_date.day + 1

Possible Solution:

i have overridden the whitelisted method and changed this part and is working

if joining_date and joining_date.month == month_map[month] and joining_date.year == today.year:
        start_day = joining_date.day
```



Discussion:

Resolving patch:
diff --git a/hrms/hr/doctype/attendance/attendance.py b/hrms/hr/doctype/attendance/attendance.py
--- a/hrms/hr/doctype/attendance/attendance.py
+++ b/hrms/hr/doctype/attendance/attendance.py
@@ -350,10 +350,12 @@ def get_unmarked_days(employee, month, exclude_holidays=0):
 	start_day = 1
 	end_day = calendar.monthrange(today.year, month_map[month])[1] + 1
 
-	if joining_date and joining_date.month == month_map[month]:
+	if joining_date and joining_date.year == today.year and joining_date.month == month_map[month]:
 		start_day = joining_date.day
 
-	if relieving_date and relieving_date.month == month_map[month]:
+	if (
+		relieving_date and relieving_date.year == today.year and relieving_date.month == month_map[month]
+	):
 		end_day = relieving_date.day + 1
 
 	dates_of_month = [


Test patch:
Repository: frappe/hrms

Issue:
Bug Report On Payroll entry HRMS 
### Information about bug

Hi Team,

Version: Frappe HR: v15.0.0-dev (main)

Unable to validate the attendance of the employee in payroll entry, while I check the box, it’s showing as **" Attendance records not found"** But the attendance is marked for the employee. Guide on this issue from the HRMS team or forum side. that will be greatly appreciated.

**Payroll Entry :**
![image](https://github.com/frappe/hrms/assets/134295161/e4ad00da-ed42-4112-8582-8fa4915fb6f3)

**Attendance of the employee :**

![image](https://github.com/frappe/hrms/assets/134295161/c5a3f22d-0e50-45d9-ab28-6fd4e62159ab)

Thanks for look on this report.



### Module

Payroll

### Version

ERPNext: v14.24.3 (main)

Frappe Framework: v14.36.1 (main)

Frappe HR: v15.0.0-dev (main)

### Installation method

None

### Relevant log output / Stack trace / Full Error Message.

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/hrms/payroll/doctype/payroll_entry/payroll_entry.py b/hrms/payroll/doctype/payroll_entry/payroll_entry.py
--- a/hrms/payroll/doctype/payroll_entry/payroll_entry.py
+++ b/hrms/payroll/doctype/payroll_entry/payroll_entry.py
@@ -837,14 +837,16 @@ def get_employees_to_mark_attendance(self) -> list[dict]:
 		employee_details = self.get_employee_and_attendance_details()
 
 		for emp in self.employees:
-			details = next((details for details in employee_details if details["name"] == emp.name), None)
+			details = next(
+				(details for details in employee_details if details["name"] == emp.employee), None
+			)
 
 			if not details:
 				continue
 
 			start_date = self.start_date
 
-			if details.get("date_of_joining") > self.start_date:
+			if details.get("date_of_joining") > getdate(self.start_date):
 				start_date = details.get("date_of_joining")
 
 			holidays = self.get_holiday_list_based_count(


Test patch:
Repository: frappe/hrms

Issue:
Getting Interview Feedback Reminder for upcomming Interviews
### Information about bug

System sending Interview Feedback Reminders for upcomming interviews.

![Screenshot from 2023-07-14 09-18-15](https://github.com/frappe/hrms/assets/43608142/b6300230-2b74-4cf4-ac7c-77f946f79152)


### Module

HR

### Version

Frappe Version : v14.40.3 (version-14)
ERPNExt Version : v14.30.1 (version-14)
HRMS Version : v14.3.4 (version-14)

### Installation method

manual install

### Relevant log output / Stack trace / Full Error Message.

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/hrms/hr/doctype/interview/interview.py b/hrms/hr/doctype/interview/interview.py
--- a/hrms/hr/doctype/interview/interview.py
+++ b/hrms/hr/doctype/interview/interview.py
@@ -7,7 +7,7 @@
 import frappe
 from frappe import _
 from frappe.model.document import Document
-from frappe.utils import cstr, flt, get_datetime, get_link_to_form
+from frappe.utils import cstr, flt, get_datetime, get_link_to_form, getdate, nowtime
 
 
 class DuplicateInterviewRoundError(frappe.ValidationError):
@@ -217,8 +217,15 @@ def send_daily_feedback_reminder():
 	interview_feedback_template = frappe.get_doc(
 		"Email Template", reminder_settings.feedback_reminder_notification_template
 	)
+
 	interviews = frappe.get_all(
-		"Interview", filters={"status": ["in", ["Under Review", "Pending"]], "docstatus": ["!=", 2]}
+		"Interview",
+		filters={
+			"status": "Under Review",
+			"docstatus": ["!=", 2],
+			"scheduled_on": ["<=", getdate()],
+			"to_time": ["<=", nowtime()],
+		},
 	)
 
 	for entry in interviews:


Test patch:
diff --git a/hrms/hr/doctype/interview/test_interview.py b/hrms/hr/doctype/interview/test_interview.py
--- a/hrms/hr/doctype/interview/test_interview.py
+++ b/hrms/hr/doctype/interview/test_interview.py
@@ -76,7 +76,9 @@ def test_notification_for_feedback_submission(self):
 
 		job_applicant = create_job_applicant()
 		scheduled_on = add_days(getdate(), -4)
-		create_interview_and_dependencies(job_applicant.name, scheduled_on=scheduled_on)
+		interview = create_interview_and_dependencies(
+			job_applicant.name, scheduled_on=scheduled_on, status="Under Review"
+		)
 
 		frappe.db.sql("DELETE FROM `tabEmail Queue`")
 		send_daily_feedback_reminder()
@@ -106,7 +108,13 @@ def tearDown(self):
 
 
 def create_interview_and_dependencies(
-	job_applicant, scheduled_on=None, from_time=None, to_time=None, designation=None, save=1
+	job_applicant,
+	scheduled_on=None,
+	from_time=None,
+	to_time=None,
+	designation=None,
+	status=None,
+	save=True,
 ):
 	if designation:
 		designation = create_designation(designation_name="_Test_Sales_manager").name
@@ -128,6 +136,9 @@ def create_interview_and_dependencies(
 	interview.append("interview_details", {"interviewer": interviewer_1.name})
 	interview.append("interview_details", {"interviewer": interviewer_2.name})
 
+	if status:
+		interview.status = status
+
 	if save:
 		interview.save()
Repository: frappe/hrms

Issue:
Email Template not rendered when using HTML
### Information about bug

Leave Approval Staus mail is being sent as an empty message via e-mail when the template is using HTML.

I believe this has to do with the following line

https://github.com/frappe/hrms/blob/1ac2f52a44aaf160a02544ec048993a0d7f0a2a4/hrms/hr/doctype/leave_application/leave_application.py#L591

The `Email Template` code has been refactored to user `response_` as a property so that HTML templates or plaintext can be utilized. Relevant code is [here](https://github.com/frappe/frappe/blob/develop/frappe/email/doctype/email_template/email_template.py#L27-L47)

I think this should be changed to 
```python
message = email_template.get_formatted_response(args) 
```
or
```python
message = frappe.render_template(email_template.response_, args) 
```


### Module

HR

### Version

Frappe Version - 15.9.0
ERPNext Version - 15.10.1
HRMS Version - 15.9.0

### Installation method

manual install

### Relevant log output / Stack trace / Full Error Message.

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/hrms/hr/doctype/leave_application/leave_application.py b/hrms/hr/doctype/leave_application/leave_application.py
--- a/hrms/hr/doctype/leave_application/leave_application.py
+++ b/hrms/hr/doctype/leave_application/leave_application.py
@@ -588,7 +588,7 @@ def notify_employee(self):
 			frappe.msgprint(_("Please set default template for Leave Status Notification in HR Settings."))
 			return
 		email_template = frappe.get_doc("Email Template", template)
-		message = frappe.render_template(email_template.response, args)
+		message = frappe.render_template(email_template.response_, args)
 
 		self.notify(
 			{
@@ -613,7 +613,7 @@ def notify_leave_approver(self):
 				)
 				return
 			email_template = frappe.get_doc("Email Template", template)
-			message = frappe.render_template(email_template.response, args)
+			message = frappe.render_template(email_template.response_, args)
 
 			self.notify(
 				{


Test patch:
Repository: frappe/hrms

Issue:
Organizational Chart: Total connections includes employees left
### Information about bug

<img width="329" alt="Screenshot 2024-03-08 at 11 20 37 AM" src="https://github.com/frappe/hrms/assets/20027965/b88248f8-502e-41fa-ba1a-87c0cd43165a">

The current system displays a total count of connections for each employee, including those who are no longer with the company. However, when viewing the connections, only active employees are shown.

**Expected Output:**
The count now reflects only active employees, ensuring consistency between the number displayed and the individuals visible upon selecting any employee.

### Module

HR

### Version

ERPNext: v14.x.x-develop () (develop)

Frappe Framework: v15.x.x-develop () (develop)

Frappe HR: v16.0.0-dev (develop)

### Installation method

manual install

### Relevant log output / Stack trace / Full Error Message.

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/hrms/hr/page/organizational_chart/organizational_chart.py b/hrms/hr/page/organizational_chart/organizational_chart.py
--- a/hrms/hr/page/organizational_chart/organizational_chart.py
+++ b/hrms/hr/page/organizational_chart/organizational_chart.py
@@ -43,7 +43,7 @@ def get_connections(employee: str, lft: int, rgt: int) -> int:
 	query = (
 		frappe.qb.from_(Employee)
 		.select(Count(Employee.name))
-		.where((Employee.lft > lft) & (Employee.rgt < rgt))
+		.where((Employee.lft > lft) & (Employee.rgt < rgt) & (Employee.status == "Active"))
 	).run()
 
 	return query[0][0]


Test patch:
Repository: frappe/hrms

Issue:
IFSC Code showing wrong value in Bank Remittance Report
### Information about bug

IFSC Code showing wrong value in Bank Remittance Report. It is showing the same IFSC Code for all the employee in the list.

### Module

Payroll

### Version

ERPNext: v14.52.1 (HEAD)
Frappe Framework: v14.57.0 (HEAD)
Frappe HR: v14.18.1 (HEAD)

### Installation method

FrappeCloud

### Relevant log output / Stack trace / Full Error Message.

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:
Current Code -
![img_v3_025s_5ec1d66c-b9c0-498f-a73d-76558643ecfh](https://github.com/frappe/hrms/assets/30950233/99dd5a6a-b48f-4f5a-a1b9-52281091ecea)

Rectified Code -
![img_v3_025s_9a9aded1-24f8-4be8-8da4-33e3565556bh](https://github.com/frappe/hrms/assets/30950233/91a92c93-f6ce-4b91-bff5-42b82acdbaa2)

@ruchamahabal Is this done?

Resolving patch:
diff --git a/hrms/payroll/report/bank_remittance/bank_remittance.py b/hrms/payroll/report/bank_remittance/bank_remittance.py
--- a/hrms/payroll/report/bank_remittance/bank_remittance.py
+++ b/hrms/payroll/report/bank_remittance/bank_remittance.py
@@ -22,7 +22,12 @@ def execute(filters=None):
 			"hidden": 1,
 			"width": 200,
 		},
-		{"label": _("Payment Date"), "fieldtype": "Data", "fieldname": "payment_date", "width": 100},
+		{
+			"label": _("Payment Date"),
+			"fieldtype": "Data",
+			"fieldname": "payment_date",
+			"width": 100,
+		},
 		{
 			"label": _("Employee Name"),
 			"fieldtype": "Link",
@@ -146,12 +151,10 @@ def get_emp_bank_ifsc_code(salary_slips):
 	emp_names = [d.employee for d in salary_slips]
 	ifsc_codes = get_all("Employee", [("name", "IN", emp_names)], ["ifsc_code", "name"])
 
-	ifsc_codes_map = {}
-	for code in ifsc_codes:
-		ifsc_codes_map[code.name] = code
+	ifsc_codes_map = {code.name: code.ifsc_code for code in ifsc_codes}
 
 	for slip in salary_slips:
-		slip["ifsc_code"] = ifsc_codes_map[code.name]["ifsc_code"]
+		slip["ifsc_code"] = ifsc_codes_map[slip.employee]
 
 	return salary_slips
 


Test patch:
Repository: frappe/hrms

Issue:
Disable check-ins from mobile app
### Is your feature request related to a problem? Please describe.

In the Frappe HR mobile app, by default the Check-in option is available. This is the good feature to have if you don't have Biometric.
If we have Biometric and if we give this option to employees, they can do Check-in and Checkout anytime they want. This will be misuse of the Check-in Button. So we should not have this in the Mobile App.

### Describe the solution you'd like

We should add a field in HR settings to "Allow check ins from mobile app", 
If we say Yes, It should be shown in Mobile app, if we say No It should be disabled. 
So that it will give feasibility for both type of use cases.

### Describe the alternatives you've considered

_No response_

### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/hrms/api/__init__.py b/hrms/api/__init__.py
--- a/hrms/api/__init__.py
+++ b/hrms/api/__init__.py
@@ -3,6 +3,7 @@
 from frappe.model.workflow import get_workflow_name
 from frappe.query_builder import Order
 from frappe.utils import getdate
+from frappe.utils.data import cint
 
 SUPPORTED_FIELD_TYPES = [
 	"Link",
@@ -634,3 +635,8 @@ def get_allowed_states_for_workflow(workflow: dict, user_id: str) -> list[str]:
 	return [
 		transition.state for transition in workflow.transitions if transition.allowed in user_roles
 	]
+
+
+@frappe.whitelist()
+def is_employee_checkin_allowed():
+	return cint(frappe.db.get_single_value("HR Settings", "allow_employee_checkin_from_mobile_app"))
diff --git a/hrms/patches/v15_0/enable_allow_checkin_setting.py b/hrms/patches/v15_0/enable_allow_checkin_setting.py
new file mode 100644
--- /dev/null
+++ b/hrms/patches/v15_0/enable_allow_checkin_setting.py
@@ -0,0 +1,9 @@
+import frappe
+
+
+def execute():
+	settings = frappe.get_single("HR Settings")
+	settings.allow_employee_checkin_from_mobile_app = 1
+	settings.flags.ignore_mandatory = True
+	settings.flags.ignore_permissions = True
+	settings.save()


Test patch: