Timesheet Without Overlap Validation

Is there any way to disable the Time Overlap Validation in Timesheet

Hi @Arvindwill,

to my knowledge, there is no setting item to deactivate the validation.

From source code it is straightforward, simply comment out line 172 in erpnext/erpnext/projects/doctype/timesheet/timesheet.py and restart bench

def validate_time_logs(self):
	for data in self.get('time_logs'):
		# self.validate_overlap(data)

Hope this helps.

1 Like

Thanks for solution. Im new to editing code of ERPNext. Having strong believer of regular Update of any system, does this code editing will spoil the Automated Upgrade process. Is there any methodology to be followed while editing code so that Update process don’t get complicated.

Hi @Arvindwill,

this is quite straightforward thanks to the git backbone that ERPNext is using.

For example if you use Debian or any of its derivates, navigate to your erpnext folder, typically

 $ cd /home/frappe/frappe-bench/apps/erpnext

Now, the first time (before you want to make your changes), create your personal branch, e.g. like

$ sudo git checkout -b myerp

This will start a new branch from what you have. Now, apply your changes directly in the file system. Once they are done, commit them (locally), e.g. in this case with the comment as below

$ sudo git commit -a -m "removed timesheet overlap" 


$ git status

will tell you the status and which branch you are in. You can also open Help > About in your ERPNext desk to find the version (from ERPNext) and your branch name.

Now, when you want to upgrade, first bring your local branch back to the master branch

$ sudo git checkout master

Then, perform the upgrade

$ cd /home/frappe/frappe-bench
$ bench update

After this is complete, you have the system in the current original version. Now, all you have to do is merge this into your version:

$ cd cd /home/frappe/frappe-bench/apps/erpnext
$ sudo git checkout myerp
$ sudo git merge master

Done! In case of issues, refer to the Git docu. In case you have changes that are of pubic interest, consider making a separate branch for these changes and making a pull request.


Exact one im looking for
:star_struck::star_struck::star_struck::star_struck: :+1: