Newer
Older
<?xml version="1.0"?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="cgscop_hr_timesheet_line_search" model="ir.ui.view">
<field name="name">cgscop.hr.timesheet.line.search</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='groupby_task']" position="replace">
<filter string="Contact" name="groupby_partner" domain="[]" context="{'group_by':'partner_id'}"/>
</xpath>
<xpath expr="//filter[@name='groupby_project']" position="attributes">
<attribute name="string">Code activité UR</attribute>
</xpath>
</field>
</record>
<!-- Form View Timesheet CG -->
<record id="view_cgscop_hr_timesheet_line_form" model="ir.ui.view">
<field name="name">account.analytic.line.timesheet.form.cgscop</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<field name="project_id" position="attributes" >
<attribute name="options">{'no_open': True, 'no_create': True}</attribute>
<attribute name="string">Code activité UR</attribute>
</field>
<field name="project_id" position="after" >
<field name="partner_id" domain="[('is_company', '=', True)]" required="True" class="td-ellipsis" options="{'no_open': True, 'no_create': True}" string="Contact"/>
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}"/>
<field name="ur_id" options="{'no_open': True, 'no_create': True}"/>
</field>
<field name="task_id" position="attributes">
<attribute name="invisible">True</attribute>
</field>
</field>
</record>
<!-- Tree View Timesheet CG -->
<record id="view_cgscop_hr_timesheet_line_tree" model="ir.ui.view">
<field name="name">account.analytic.line.timesheet.cgscop</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<field name="name" position="replace"/>
<field name="project_id" position="attributes" >
<attribute name="options">{'no_open': True, 'no_create': True}</attribute>
<attribute name="string">Code activité UR</attribute>
</field>
<field name="project_id" position="after" >
<field name="partner_id" domain="[('is_company', '=', True)]" required="True" class="td-ellipsis" options="{'no_open': True, 'no_create': True}" string="Contact"/>
<field name="task_id" position="attributes">
<attribute name="invisible">True</attribute>
</field>
<field name="unit_amount" position="attributes">
<attribute name="widget">float_time</attribute>
</field>
<field name="unit_amount" position="after">
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}"/>
<!-- Pivot View Timesheet CG -->
<record id="view_cgscop_hr_timesheet_line_pivot" model="ir.ui.view">
<field name="name">account.analytic.line.timesheet.cgscop.pivot</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<pivot string="Rapport">
<field name="project_id" type="row" string="Code activité UR" />
<field name="partner_id" type="row" string="Contact"/>
<field name="date" interval="month" type="col"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
</pivot>
</field>
</record>
<!-- Hérite l'action de la fenetre -->
<record id="hr_timesheet.act_hr_timesheet_line" model="ir.actions.act_window">
<field name="view_mode">tree,form,pivot,graph</field>
</record>
<record id="hr_timesheet.timesheet_action_all" model="ir.actions.act_window">
<field name="name">Toutes les lignes de temps</field>
</record>
<!-- ajoute des droits sur le menu Configuration -->
<record model="ir.ui.menu" id="hr_timesheet.hr_timesheet_menu_configuration">
<field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator'), ref('cgscop_partner.group_ur_list_modif')])]"/>
</record>
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
<!-- ajoute des droits pour gestionnaire uniquement sur le menu Toutes les feuilles de temps -->
<record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_activity_all">
<field name="groups_id" eval="[(6,0, [ref('hr_timesheet.group_timesheet_manager'), ref('cgscop_partner.group_cg_administrator')])]"/>
</record>
<record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_report_timesheet_by_project">
<field name="name">Par code activité UR</field>
</record>
<!-- Report View per Contact -->
<record id="timesheet_action_report_by_contact" model="ir.actions.act_window">
<field name="name">Par Contact</field>
<field name="res_model">account.analytic.line</field>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{'search_default_groupby_partner':1,}</field>
<field name="search_view_id" ref="cgscop_timesheet.cgscop_hr_timesheet_line_search"/>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'pivot', 'sequence': 5, 'view_id': ref('hr_timesheet.view_hr_timesheet_line_pivot')}),
(0, 0, {'view_mode': 'tree', 'sequence': 10, 'view_id': ref('cgscop_timesheet.view_cgscop_hr_timesheet_line_tree')}),
(0, 0, {'view_mode': 'form', 'sequence': 15, 'view_id': ref('cgscop_timesheet.view_cgscop_hr_timesheet_line_form')})]"/>
</record>
<menuitem id="timesheet_menu_report_timesheet_by_contact"
parent="hr_timesheet.menu_timesheets_reports_timesheet"
action="timesheet_action_report_by_contact"
name="Par Contact"
sequence="25"/>
<delete id="hr_timesheet.timesheet_menu_report_timesheet_by_task" model="ir.ui.menu"/>/>