Compare commits
2 Commits
dcfd27b636
...
16.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 763fca0d30 | |||
| b1cfdeba30 |
@@ -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:
|
||||||
|
|||||||
@@ -9,15 +9,15 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='effective_hours']" position="after">
|
<xpath expr="//field[@name='effective_hours']" position="after">
|
||||||
<span>
|
<span>
|
||||||
<label class="font-weight-bold" for="billable_effective_hours" string="Billable Effective Hours" attrs="{'invisible': ['|', ('planned_hours', '=', 0.0), ('encode_uom_in_days', '=', True)]}"/>
|
<label class="font-weight-bold" for="billable_effective_hours" string="Billable Effective Hours" attrs="{'invisible': ['|', ('non_billable_effective_hours', '=', 0.0), ('encode_uom_in_days', '=', True)]}"/>
|
||||||
<label class="font-weight-bold" for="billable_effective_hours" string="Billable Effective Days" attrs="{'invisible': ['|', ('planned_hours', '=', 0.0), ('encode_uom_in_days', '=', False)]}"/>
|
<label class="font-weight-bold" for="billable_effective_hours" string="Billable Effective Days" attrs="{'invisible': ['|', ('non_billable_effective_hours', '=', 0.0), ('encode_uom_in_days', '=', False)]}"/>
|
||||||
</span>
|
</span>
|
||||||
<field name="billable_effective_hours" widget="timesheet_uom" class="mt-2" attrs="{'invisible' : [('planned_hours', '=', 0.0)]}" nolabel="1"/>
|
<field name="billable_effective_hours" widget="timesheet_uom" class="mt-2" attrs="{'invisible' : [('non_billable_effective_hours', '=', 0.0)]}" nolabel="1"/>
|
||||||
<span>
|
<span>
|
||||||
<label class="font-weight-bold" for="non_billable_effective_hours" string="Non Billable Effective Hours" attrs="{'invisible': ['|', ('planned_hours', '=', 0.0), ('encode_uom_in_days', '=', True)]}"/>
|
<label class="font-weight-bold" for="non_billable_effective_hours" string="Non Billable Effective Hours" attrs="{'invisible': ['|', ('non_billable_effective_hours', '=', 0.0), ('encode_uom_in_days', '=', True)]}"/>
|
||||||
<label class="font-weight-bold" for="non_billable_effective_hours" string="Non Billable Effective Days" attrs="{'invisible': ['|', ('planned_hours', '=', 0.0), ('encode_uom_in_days', '=', False)]}"/>
|
<label class="font-weight-bold" for="non_billable_effective_hours" string="Non Billable Effective Days" attrs="{'invisible': ['|', ('non_billable_effective_hours', '=', 0.0), ('encode_uom_in_days', '=', False)]}"/>
|
||||||
</span>
|
</span>
|
||||||
<field name="non_billable_effective_hours" widget="timesheet_uom" class="mt-2" attrs="{'invisible' : [('planned_hours', '=', 0.0)]}" nolabel="1"/>
|
<field name="non_billable_effective_hours" widget="timesheet_uom" class="mt-2" attrs="{'invisible' : [('non_billable_effective_hours', '=', 0.0)]}" nolabel="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='subtask_effective_hours']" position="after">
|
<xpath expr="//field[@name='subtask_effective_hours']" position="after">
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
Reference in New Issue
Block a user