[IMP] project_working_time_task_portal : recompute billable and non billable effective hours when timesheets exclude_from_sale_order is modified
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m27s
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m27s
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "project_working_time_task_portal",
|
"name": "project_working_time_task_portal",
|
||||||
"version": "16.0.1.0.4",
|
"version": "16.0.1.0.5",
|
||||||
"author": "Elabore",
|
"author": "Elabore",
|
||||||
"website": "https://elabore.coop",
|
"website": "https://elabore.coop",
|
||||||
"maintainer": "Boris Gallet",
|
"maintainer": "Boris Gallet",
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
from odoo import SUPERUSER_ID, api
|
||||||
|
|
||||||
|
def migrate(cr, version):
|
||||||
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||||
|
|
||||||
|
tasks = env["project.task"].search([("stage_id.fold", "=", False)])
|
||||||
|
tasks._compute_billable_effective_hours()
|
||||||
@@ -59,7 +59,7 @@ class Task(models.Model):
|
|||||||
help="Non billable time spent on this task and its sub-tasks (and their own sub-tasks).",
|
help="Non billable time spent on this task and its sub-tasks (and their own sub-tasks).",
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends('timesheet_ids.unit_amount')
|
@api.depends('timesheet_ids.unit_amount', 'timesheet_ids.exclude_from_sale_order')
|
||||||
def _compute_billable_effective_hours(self):
|
def _compute_billable_effective_hours(self):
|
||||||
if not any(self._ids):
|
if not any(self._ids):
|
||||||
for task in self:
|
for task in self:
|
||||||
|
|||||||
Reference in New Issue
Block a user