-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] projectt_workload_timesheet_additions
- Loading branch information
1 parent
c19b902
commit b197904
Showing
6 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Project Workload Timesheet Additions", | ||
"summary": "Add Workload Additions To Timesheets", | ||
"version": "14.0.1.0.0", | ||
"development_status": "Alpha", | ||
"category": "Uncategorized", | ||
"website": "https://github.com/akretion/ak-odoo-incubator", | ||
"author": " Akretion", | ||
"license": "AGPL-3", | ||
"depends": ["project_workload_additions", "project_workload_timesheet"], | ||
"data": ["views/hr_timesheet_sheet_views.xml"], | ||
"auto_install": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import hr_timesheet_sheet | ||
from . import project_workload_unit |
8 changes: 8 additions & 0 deletions
8
project_workload_timesheet_additions/models/hr_timesheet_sheet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import api, fields, models | ||
|
||
|
||
class Sheet(models.Model): | ||
_inherit = "hr_timesheet.sheet" |
25 changes: 25 additions & 0 deletions
25
project_workload_timesheet_additions/models/project_workload_unit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProjectWorkloadUnit(models.Model): | ||
_inherit = "project.workload.unit" | ||
additional_workload_id = fields.Many2one( | ||
"project.task.workload.addition", | ||
"Additional Task Workload", | ||
related="workload_id.additional_workload_id", | ||
) | ||
additional_task_id = fields.Many2one( | ||
"project.task", | ||
"Additional Task", | ||
related="workload_id.additional_workload_task_id", | ||
) | ||
|
||
def _get_timesheeting_task(self): | ||
# Timesheet in additional workload task | ||
if self.additional_workload_id: | ||
return self.additional_task_id | ||
return super()._get_timesheeting_task() |
12 changes: 12 additions & 0 deletions
12
project_workload_timesheet_additions/views/hr_timesheet_sheet_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="hr_timesheet_sheet_form_my" model="ir.ui.view"> | ||
<field name="model">hr_timesheet.sheet</field> | ||
<field name="inherit_id" ref="project_workload_timesheet.hr_timesheet_sheet_form_my" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='workload_unit_ids']/tree/field[@name='task_id']" position="after"> | ||
<field name="additional_task_id" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |