Debian Codegraph @

addons/hr_timesheet/views/project_project_views.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3 <data>
4 <record id="project_project_view_form_simplified_inherit_timesheet" model="ir.ui.view">
5 <field name="name">project.project.view.form.simplified.inherit.timesheet</field>
6 <field name="model">project.project</field>
7 <field name="inherit_id" ref="project.project_project_view_form_simplified"/>
8 <field name="priority">24</field>
9 <field name="arch" type="xml">
10 <xpath expr="//div[hasclass('o_settings_container')]" position="inside">
11 <setting string="Timesheets" help="Log time on tasks">
12 <field name="allow_timesheets"/>
13 </setting>
14 </xpath>
15 </field>
16 </record>
17
18 <record id="project_invoice_form" model="ir.ui.view">
19 <field name="name">Inherit project form : Invoicing Data</field>
20 <field name="model">project.project</field>
21 <field name="inherit_id" ref="project.edit_project"/>
22 <field name="priority">24</field>
23 <field name="arch" type="xml">
24 <xpath expr="//header" position="after">
25 <field name="analytic_account_active" invisible="1"/>
26 <t name="timesheet_error" invisible="not allow_timesheets or is_template">
27 <div class="alert alert-warning mb-1 text-center" role="alert" colspan="2" invisible="not account_id or analytic_account_active">
28 You cannot log timesheets on this project since it is linked to an inactive analytic account.<br/>
29 Please switch to another account, or reactivate the current one to timesheet on the project.
30 </div>
31 </t>
32 </xpath>
33 <xpath expr="//field[@name='date']" position="after">
34 <field name="allocated_hours" widget="timesheet_uom_no_toggle" invisible="not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"/>
35 </xpath>
36 <xpath expr="//group[@name='group_time_managment']" position="attributes">
37 <attribute name="invisible">0</attribute>
38 </xpath>
39 <xpath expr="//group[@name='group_time_managment']" position="inside">
40 <setting class="col-lg-12" id="timesheet_settings" string="Timesheets" help="Log time on tasks">
41 <field name="allow_timesheets"/>
42 </setting>
43 </xpath>
44 </field>
45 </record>
46
47 <record id="project_project_view_tree_inherit_sale_project" model="ir.ui.view">
48 <field name="name">project.project.list.inherit.sale.timesheet</field>
49 <field name="model">project.project</field>
50 <field name="inherit_id" ref="project.view_project"/>
51 <field name="arch" type="xml">
52 <xpath expr="//field[@name='date']" position="after">
53 <field name="allow_timesheets" column_invisible="1"/>
54 <field name="allocated_hours" widget="timesheet_uom_no_toggle" optional="hide" invisible="allocated_hours == 0 or not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"/>
55 <field name="effective_hours" widget="timesheet_uom_no_toggle" optional="hide" invisible="effective_hours == 0 or not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"/>
56 <field name="remaining_hours" widget="timesheet_uom_no_toggle"
57 decoration-danger="remaining_hours &lt; 0"
58 decoration-warning="allocated_hours > 0 and (remaining_hours / allocated_hours) &lt; 0.2"
59 optional="hide"
60 invisible="allocated_hours == 0 or not allow_timesheets"
61 groups="hr_timesheet.group_hr_timesheet_user"
62 />
63 </xpath>
64 </field>
65 </record>
66
67 <record id="view_project_kanban_inherited" model="ir.ui.view">
68 <field name="name">project.project.timesheet.kanban.inherited</field>
69 <field name="model">project.project</field>
70 <field name="inherit_id" ref="project.view_project_kanban"/>
71 <field name="priority">24</field>
72 <field name="arch" type="xml">
73 <xpath expr="//templates" position="before">
74 <field name="allow_timesheets"/>
75 <field name="remaining_hours"/>
76 <field name="encode_uom_in_days"/>
77 <field name="allocated_hours"/>
78 </xpath>
79 <xpath expr="//div[@name='card_menu_view']" position="inside">
80 <div role="menuitem" t-if="record.allow_timesheets.raw_value and !record.is_template.raw_value" groups="hr_timesheet.group_hr_timesheet_user">
81 <a name="action_project_timesheets" type="object">Timesheets</a>
82 </div>
83 </xpath>
84 <xpath expr="//div[hasclass('o_project_kanban_boxes')]" position="after">
85 <t t-set="badgeColor" t-value="'border-success'"/>
86 <t t-set="badgeColor" t-value="'border-danger'" t-if="record.remaining_hours.raw_value &lt; 0"/>
87 <t t-set="title" t-if="record.encode_uom_in_days.raw_value">Days Remaining</t>
88 <t t-set="title" t-else="">Time Remaining</t>
89 <div t-if="!record.is_template.raw_value and record.allow_timesheets.raw_value and record.allocated_hours.raw_value &gt; 0"
90 t-attf-class="me-1 ms-1 bg-transparent badge border {{ badgeColor }}" t-att-title="title" groups="hr_timesheet.group_hr_timesheet_user">
91 <field name="remaining_hours" widget="timesheet_uom" class="p-0"/>
92 </div>
93 </xpath>
94 </field>
95 </record>
96
97 <record id="view_project_project_filter_inherit_timesheet" model="ir.ui.view">
98 <field name="name">project.project.view.inherit.timesheet</field>
99 <field name="model">project.project</field>
100 <field name="inherit_id" ref="project.view_project_project_filter"/>
101 <field name="arch" type="xml">
102 <filter name="late_milestones" position="before">
103 <filter string="Timesheets &gt;100%" name="projects_in_overtime" domain="[('is_project_overtime', '=', True)]" groups="project.group_project_manager"/>
104 </filter>
105 </field>
106 </record>
107
108 <record id="project.open_view_project_all" model="ir.actions.act_window">
109 <field name="domain">[('is_internal_project', '=', False), ("is_template", "=", False)]</field>
110 </record>
111
112 <record id="project.open_view_project_all_group_stage" model="ir.actions.act_window">
113 <field name="domain">[('is_internal_project', '=', False), ("is_template", "=", False)]</field>
114 </record>
115
116 <!-- Project Template -->
117 <record id="project_templates_view_list_inherit_timesheet" model="ir.ui.view">
118 <field name="name">project.project.template.list.inherit.timesheet</field>
119 <field name="model">project.project</field>
120 <field name="inherit_id" ref="project.project_templates_view_list"/>
121 <field name="arch" type="xml">
122 <field name="effective_hours" position="replace"/>
123 <field name="remaining_hours" position="replace"/>
124 </field>
125 </record>
126 </data>
127 </odoo>