Browse Source

Nov 13: [FIX] Bug Fixed 'manufacturing_timesheet'

pull/345/merge
Cybrosys Technologies 6 months ago
parent
commit
c84ce7d809
  1. 5
      manufacturing_timesheet/doc/RELEASE_NOTES.md
  2. 14
      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 16.0.1.0.0
#### ADD
Initial Commit for Manufacturing (MRP) Timesheet.
#### 07.11.2024
#### Version 16.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.

14
manufacturing_timesheet/models/mrp_workorder.py

@ -54,7 +54,15 @@ class MrpWorkorder(models.Model):
project = self.env['project.project'].search(
[('name', '=', ("MO: {}".format(self.production_id.name)))])
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_hours = minutes / 60
if project:
task_id = project.task_ids.search([('name', '=', (
"{} in {} for {} on {}".format(self.name,
@ -70,7 +78,7 @@ class MrpWorkorder(models.Model):
'project_id': project.id,
'date_assign': self.date_planned_start,
'date_deadline': self.date_planned_finished,
'planned_hours': self.duration_expected,
'planned_hours': total_hours
})
self.env['account.analytic.line'].create({
'task_id': task_id.id,
@ -99,7 +107,7 @@ class MrpWorkorder(models.Model):
'project_id': project_id.id,
'date_assign': self.date_planned_start,
'date_deadline': self.date_planned_finished,
'planned_hours': self.duration_expected,
'planned_hours': total_hours,
})
self.env['account.analytic.line'].create({
'task_id': task_id.id,

5
manufacturing_timesheet/static/description/index.html

@ -214,7 +214,10 @@
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Inside of the task,you can see the timesheet created in the
name of employee that selected in the work order.
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.
</h3>
<img src="assets/screenshots/6.png" class="img-thumbnail">
</div>

Loading…
Cancel
Save