diff --git a/manufacturing_timesheet/doc/RELEASE_NOTES.md b/manufacturing_timesheet/doc/RELEASE_NOTES.md index 432b5122e..edd0fab48 100644 --- a/manufacturing_timesheet/doc/RELEASE_NOTES.md +++ b/manufacturing_timesheet/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 17.0.1.0.0 #### ADD - Initial Commit for Manufacturing (MRP) Timesheet + +#### 08.11.2024 +#### Version 17.0.1.0.0 +#### Updated +- Updated the code for adding the value to allocated hours while creating a project task in the MRP work order. Also updated it in index. \ No newline at end of file diff --git a/manufacturing_timesheet/models/mrp_workorder.py b/manufacturing_timesheet/models/mrp_workorder.py index 7aaf0a51d..47e4f43f0 100644 --- a/manufacturing_timesheet/models/mrp_workorder.py +++ b/manufacturing_timesheet/models/mrp_workorder.py @@ -51,13 +51,15 @@ class MrpWorkorder(models.Model): Boolean: Returns true """ res = super(MrpWorkorder, self).button_start() - allocated_hours = int(self.duration_expected) - allocated_minutes = int((self.duration_expected - allocated_hours) * 60) - allocated_time_str = f"{allocated_hours:02d}:{allocated_minutes:02d}" - allocated_minutes_str, allocated_seconds_str = allocated_time_str.split(":") - allocated_minutes = int(allocated_minutes_str) - allocated_seconds = int(allocated_minutes_str) - total_allocated_hours = (allocated_minutes + allocated_seconds / 60) / 60 + minutes = int(self.duration_expected) + seconds = int((self.duration_expected - minutes) * 60) + time_str = f"{minutes:02d}:{seconds:02d}" + minutes_str, seconds_str = time_str.split(":") + minutes = int(minutes_str) + seconds = int(seconds_str) + if seconds % 30 == 0: + minutes += (seconds // 30) + total_allocated_hours = minutes / 60 project = self.env['project.project'].search( [('name', '=', ("MO: {}".format(self.production_id.name)))]) if project: diff --git a/manufacturing_timesheet/static/description/index.html b/manufacturing_timesheet/static/description/index.html index db57af11a..ac35bee81 100644 --- a/manufacturing_timesheet/static/description/index.html +++ b/manufacturing_timesheet/static/description/index.html @@ -200,7 +200,10 @@

- Inside the task,you can see the timesheet created in the name of employee that selected in the work order. + Inside the task,you can see the timesheet created in the name of employee that selected in the work order.The expected time, mentioned in minutes and seconds + format in the work order, will be added to the allocated hours of the task in hours and minutes format. + Any seconds equal to or greater than 30 will be rounded up to 1 minute, and seconds less than 30 will + be rounded down to 0 minutes.