[IMP] project_task_billable_hours : display billable_remaining_hours instead of remaining_hours in project kanban view

This commit is contained in:
2025-09-04 17:24:30 +02:00
parent be81194749
commit 8c32e99f2f
4 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1 @@
from . import billable_time

View File

@@ -0,0 +1,16 @@
from odoo import models, fields, api
class Project(models.Model):
_inherit = "project.project"
billable_remaining_hours = fields.Float(
compute="_compute_project_billable_remaining_hours",
string="Billable Remaining Hours",
store=True,
help="Total Billable remaining time (without exclude_from_sale_order timesheet lines)."
)
@api.depends("task_ids.billable_remaining_hours")
def _compute_project_billable_remaining_hours(self):
for project in self:
project.billable_remaining_hours = sum(task.billable_remaining_hours for task in project.task_ids)