fix(timesheet): Hours automatically used to set 0
- Case: If the company had standard working hour set and when the user creates a timesheet with same date for "To" and "From" then the hours field automatically used to get reset to 0 after saving the form.
This commit is contained in:
parent
e4abaa7cdd
commit
cab8e9be89
@ -96,7 +96,7 @@ class Timesheet(Document):
|
||||
|
||||
for time in self.time_logs:
|
||||
if time.from_time and time.to_time:
|
||||
if flt(std_working_hours) > 0:
|
||||
if flt(std_working_hours) and date_diff(time.to_time, time.from_time):
|
||||
time.hours = flt(std_working_hours) * date_diff(time.to_time, time.from_time)
|
||||
else:
|
||||
if not time.hours:
|
||||
|
Loading…
x
Reference in New Issue
Block a user