16.0 [MIG] project_task_billable_hours: migrate to 16.0
This commit is contained in:
0
project_task_billable_hours/__init__.py
Normal file
0
project_task_billable_hours/__init__.py
Normal file
24
project_task_billable_hours/__manifest__.py
Normal file
24
project_task_billable_hours/__manifest__.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Copyright 2022 Elabore
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Project task billable hours",
|
||||||
|
"version": "16.0.1.0.0",
|
||||||
|
"author": "Elabore",
|
||||||
|
"website": "https://github.com/elabore-coop/project-tools",
|
||||||
|
"maintainer": "Laetitia Da Costa",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"category": "Tools",
|
||||||
|
"summary": "In task kanban view, display remaining billable hours instead of remaining hours",
|
||||||
|
"description": "",
|
||||||
|
"depends": [
|
||||||
|
"project",
|
||||||
|
"hr_timesheet",
|
||||||
|
"project_working_time_task_portal"
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
"views/project_task_views.xml",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
"application": False,
|
||||||
|
}
|
21
project_task_billable_hours/views/project_task_views.xml
Normal file
21
project_task_billable_hours/views/project_task_views.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<!-- Replace remaining hours by billable remaining hours in kanban view -->
|
||||||
|
<record id="view_task_kanban_billable_remaining_hours_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">project.task.kanban.billable.remaining.hours.inherit</field>
|
||||||
|
<field name="model">project.task</field>
|
||||||
|
<field name="inherit_id" ref="hr_timesheet.view_task_kanban_inherited_progress"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//t[@name='planned_hours']" position="replace">
|
||||||
|
<t t-set="badge" t-value=""/>
|
||||||
|
<t t-set="badge" t-value="'badge-warning'" t-if="record.billable_progress >= 80 and record.billable_progress <= 100"/>
|
||||||
|
<t t-set="badge" t-value="'badge-danger'" t-if="record.billable_remaining_hours.raw_value < 0"/>
|
||||||
|
<t t-set="title" t-value="'Remaining days'" t-if="record.encode_uom_in_days.raw_value"/>
|
||||||
|
<t t-set="title" t-value="'Billable remaining hours'" t-else=""/>
|
||||||
|
<div t-attf-class="oe_kanban_align badge {{ badge }}" t-att-title="title">
|
||||||
|
<field name="billable_remaining_hours" widget="timesheet_uom" />
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
Reference in New Issue
Block a user