From ee339a01e8481da0d289d39e9cf4a158824329dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Tue, 8 Jul 2025 15:33:13 +0200 Subject: [PATCH] [IMP] project_working_time_task_portal: add total_billable_effective_hours field in task model --- project_working_time_task_portal/i18n/fr.po | 90 +++++++++++++------ .../models/project_task.py | 16 +++- .../views/hr_timesheet_view_task_form2.xml | 9 +- 3 files changed, 88 insertions(+), 27 deletions(-) diff --git a/project_working_time_task_portal/i18n/fr.po b/project_working_time_task_portal/i18n/fr.po index 1389982..67bd5a9 100644 --- a/project_working_time_task_portal/i18n/fr.po +++ b/project_working_time_task_portal/i18n/fr.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 09:37+0000\n" -"PO-Revision-Date: 2023-12-04 09:37+0000\n" +"POT-Creation-Date: 2025-07-08 13:43+0000\n" +"PO-Revision-Date: 2025-07-08 15:45+0200\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -31,24 +31,9 @@ msgid "Subtask Planned Hours: " msgstr "Heures Planifiées Sous-tâches: " #. module: project_working_time_task_portal -#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.portal_my_task_remaining_hours -msgid "Remaining Hours:" -msgstr "Heures restantes:" - -#. module: project_working_time_task_portal -#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__billable_remaining_hours -#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form -msgid "Billable Remaining Hours" -msgstr "Heures restantes facturables" -#. module: project_working_time_task_portal -#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.portal_tasks_list_inherit -msgid "Billable Hours" -msgstr "Heures facturables" - -#. module: project_working_time_task_portal -#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form -msgid "Billable Remaining Days" -msgstr "Jours restants facturables" +#: model:ir.model,name:project_working_time_task_portal.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" #. module: project_working_time_task_portal #: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form @@ -62,9 +47,25 @@ msgid "Billable Effective Hours" msgstr "Heures passées facturables" #. module: project_working_time_task_portal -#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__subtask_billable_effective_hours -msgid "Subtask Billable Effective Hours" -msgstr "Heures passées facturables Sous-tâches" +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.portal_tasks_list_inherit +msgid "Billable Hours" +msgstr "Heures facturables" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__billable_progress +msgid "Billable Progress" +msgstr "" + +#. module: project_working_time_task_portal +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form +msgid "Billable Remaining Days" +msgstr "Jours restants facturables" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__billable_remaining_hours +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form +msgid "Billable Remaining Hours" +msgstr "Heures restantes facturables" #. module: project_working_time_task_portal #: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form @@ -75,4 +76,43 @@ msgstr "Jours passés non facturables" #: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__non_billable_effective_hours #: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form msgid "Non Billable Effective Hours" -msgstr "Heures passées non facturables" \ No newline at end of file +msgstr "Heures passées non facturables" + +#. module: project_working_time_task_portal +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.portal_my_task_remaining_hours +msgid "Remaining Hours:" +msgstr "Heures restantes:" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_account_analytic_line__smart_search +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__smart_search +msgid "Smart Search" +msgstr "" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__subtask_billable_effective_hours +msgid "Subtask Billable Effective Hours" +msgstr "Heures passées facturables Sous-tâches" + +#. module: project_working_time_task_portal +#: model:ir.model,name:project_working_time_task_portal.model_project_task +msgid "Task" +msgstr "Tâche" + +#. module: project_working_time_task_portal +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form +msgid "Total Billable Effective Days" +msgstr "Total des jours facturables" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,field_description:project_working_time_task_portal.field_project_task__total_billable_effective_hours +#: model_terms:ir.ui.view,arch_db:project_working_time_task_portal.project_working_time_view_task_form +msgid "Total Billable Effective Hours" +msgstr "Total des heures facturables" + +#. module: project_working_time_task_portal +#: model:ir.model.fields,help:project_working_time_task_portal.field_project_task__billable_remaining_hours +msgid "" +"Total Billable remaining time (without exclude_from_sale_order timesheet " +"lines), can be re-estimated periodically by the assignee of the task." +msgstr "" diff --git a/project_working_time_task_portal/models/project_task.py b/project_working_time_task_portal/models/project_task.py index c6f5d70..f5225bf 100644 --- a/project_working_time_task_portal/models/project_task.py +++ b/project_working_time_task_portal/models/project_task.py @@ -1,4 +1,4 @@ -from odoo import models, fields, api, _ +from odoo import api, fields, models from odoo.tools.float_utils import float_compare @@ -40,6 +40,13 @@ class Task(models.Model): recursive=True, ) + total_billable_effective_hours = fields.Float( + compute="_compute_total_billable_effective_hours", + string="Total Billable Effective Hours", + store=True, + compute_sudo=True, + ) + @api.depends("timesheet_ids.unit_amount") def _compute_billable_effective_hours(self): if not any(self._ids): @@ -120,3 +127,10 @@ class Task(models.Model): ) else: task.billable_progress = 0.0 + + @api.depends("billable_effective_hours", "subtask_billable_effective_hours") + def _compute_total_billable_effective_hours(self): + for task in self: + task.total_billable_effective_hours = ( + task.billable_effective_hours + task.subtask_billable_effective_hours + ) diff --git a/project_working_time_task_portal/views/hr_timesheet_view_task_form2.xml b/project_working_time_task_portal/views/hr_timesheet_view_task_form2.xml index 53141a4..d299112 100644 --- a/project_working_time_task_portal/views/hr_timesheet_view_task_form2.xml +++ b/project_working_time_task_portal/views/hr_timesheet_view_task_form2.xml @@ -19,6 +19,13 @@ + + + + + - \ No newline at end of file +