Browse Source

Nov 13: [FIX] Bug Fixed 'manufacturing_timesheet'

pull/348/merge
Cybrosys Technologies 6 months ago
parent
commit
49c154b0a3
  1. 5
      manufacturing_timesheet/doc/RELEASE_NOTES.md
  2. 16
      manufacturing_timesheet/models/mrp_workorder.py
  3. 5
      manufacturing_timesheet/static/description/index.html

5
manufacturing_timesheet/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial Commit for Manufacturing (MRP) Timesheet - 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.

16
manufacturing_timesheet/models/mrp_workorder.py

@ -51,13 +51,15 @@ class MrpWorkorder(models.Model):
Boolean: Returns true Boolean: Returns true
""" """
res = super(MrpWorkorder, self).button_start() res = super(MrpWorkorder, self).button_start()
allocated_hours = int(self.duration_expected) minutes = int(self.duration_expected)
allocated_minutes = int((self.duration_expected - allocated_hours) * 60) seconds = int((self.duration_expected - minutes) * 60)
allocated_time_str = f"{allocated_hours:02d}:{allocated_minutes:02d}" time_str = f"{minutes:02d}:{seconds:02d}"
allocated_minutes_str, allocated_seconds_str = allocated_time_str.split(":") minutes_str, seconds_str = time_str.split(":")
allocated_minutes = int(allocated_minutes_str) minutes = int(minutes_str)
allocated_seconds = int(allocated_minutes_str) seconds = int(seconds_str)
total_allocated_hours = (allocated_minutes + allocated_seconds / 60) / 60 if seconds % 30 == 0:
minutes += (seconds // 30)
total_allocated_hours = minutes / 60
project = self.env['project.project'].search( project = self.env['project.project'].search(
[('name', '=', ("MO: {}".format(self.production_id.name)))]) [('name', '=', ("MO: {}".format(self.production_id.name)))])
if project: if project:

5
manufacturing_timesheet/static/description/index.html

@ -200,7 +200,10 @@
<div class="px-3"> <div class="px-3">
<h4 class="mt-2" <h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important"> style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
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.
</h4> </h4>
</div> </div>
</div> </div>

Loading…
Cancel
Save