Newer
Older
<?xml version="1.0"?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Form View Project CG -->
<record id="view_cgscop_project_timesheet_form" model="ir.ui.view">
<field name="name">cgscop.project.timesheet.form</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<form string="Project">
<sheet string="Project">
<div class="oe_button_box" name="button_box" groups="base.group_user">
<button class="oe_stat_button" name="%(hr_timesheet.act_hr_timesheet_line_by_project)d" type="action" icon="fa-calendar" string="Timesheets" attrs="{'invisible': [('allow_timesheets', '=', False)]}" groups="hr_timesheet.group_hr_timesheet_user"/>
<button name="toggle_active" type="object"
confirm="(Un)archiving a project automatically (un)archives its tasks. Do you want to proceed?"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name" placeholder="Code activité UR"/>
</h1>
</div>
<group>
<group>
<field name="partner_id" string="Contact par défaut" help="Contact par défaut auquel est rattaché cette activité. Ce contact sera sélectionné automatiquement dans les feuilles de temps" options="{'no_open': True, 'no_create': True}"/>
<field name="ur_id" string="Union Régionale" options="{'no_open': True, 'no_create': True}" required="1" />
<field name="company_id" groups="base.group_multi_company" options="{'no_open': True, 'no_create': True}" string="Société" invisible="1" />
<field name="cgscop_timesheet_code_id" required="1" placeholder="Code activité National" options="{'no_open': True, 'no_create': True}"/>

Benjamin - Le Filament
committed
<field name="analytic_account_id" invisible="1"/>
<field name="privacy_visibility" invisible="1"/>
<field name="allow_timesheets" invisible="1"/>
</group>
</group>
<group string="Configuration" name="project_config" groups="base.group_no_one">
<group>
<field name="user_id" string="Project Manager"
attrs="{'readonly':[('active','=',False)]}" options="{'no_open': True, 'no_create': True}"/>
<field name="sequence" groups="base.group_no_one"/>
</group>
<group >
<field name="allow_timesheets" />
<field name="privacy_visibility" widget="radio"/>
<field name="resource_calendar_id" groups="base.group_no_one"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically track the events associated to tasks and issues of this project." groups="base.group_user"/>
</div>
</form>
</field>
</record>
<!-- Search View Project CG -->
<record id="view_cgscop_project_timesheet_filter" model="ir.ui.view">
<field name="name">cgscop.project.timesheet.search</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<search string="Search Project">
<field name="name" string="Code activité UR"/>
<field name="cgscop_timesheet_code_id" string="Code activité National"/>
<field name="partner_id" string="Contact par défaut"/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<group expand="0" string="Group By">
<filter string="Contact par défaut" name="Partner" context="{'group_by': 'partner_id'}"/>
</group>
</search>
</field>
</record>
<!-- Tree View Project CG -->
<record id="view_cgscop_project_timesheet_tree" model="ir.ui.view">
<field name="name">cgscop.project.timesheet.tree</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<tree decoration-muted="active == False" string="Projects">
<field name="sequence" widget="handle"/>
<field name="active" invisible="1"/>
<field name="name" />
<field name="cgscop_timesheet_code_id" options="{'no_open': True, 'no_create': True}"/>
<field name="partner_id" string="Contact" options="{'no_open': True, 'no_create': True}"/>
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
</tree>
</field>
</record>
<!-- Kanban View Project CG -->
<record id="view_cgscop_project_timesheet_kanban" model="ir.ui.view">
<field name="name">cgscop.project.timesheet.kanban</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="user_id" string="Project Manager"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_content oe_kanban_global_click o_kanban_get_form">
<div class="row">
<div class="col-12">
<strong><field name="name" string="Code activité UR"/></strong>
<field name="cgscop_timesheet_code_id" string="Code activité CG"/>
</div>
</div>
<div class="row">
<div class="col-8">
<field name="partner_id" string="Contact"/>
</div>
<div class="col-4">
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="act_cgscop_project_timesheet" model="ir.actions.act_window">
<field name="name">Codes activités UR</field>
<field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="domain">[]</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('view_cgscop_project_timesheet_tree')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('view_cgscop_project_timesheet_kanban')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_cgscop_project_timesheet_form')})]"/>
<field name="search_view_id" ref="view_cgscop_project_timesheet_filter"/>
<field name="context">{
'default_privacy_visibility': 'employees',
'default_allow_timesheets': True,
}</field>
</record>
<menuitem
name="Codes Activité UR"
parent="hr_timesheet.hr_timesheet_menu_configuration"
action="act_cgscop_project_timesheet"
id="menu_action_project_lines_tree"
sequence="35"
groups="cgscop_partner.group_ur_list_modif,cgscop_partner.group_cg_administrator"/>