diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml index 6de4db8b85c5ef1f932930b7594dc013f865c4a5..5b1a849379318f75fb016c6ede098dadb33b918f 100644 --- a/views/hr_timesheet.xml +++ b/views/hr_timesheet.xml @@ -10,6 +10,7 @@ <field name="model">account.analytic.line</field> <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/> <field name="arch" type="xml"> + <field name="task_id" position="replace"/> <xpath expr="//filter[@name='groupby_task']" position="replace"> <filter string="Contact" name="groupby_partner" domain="[]" context="{'group_by':'partner_id'}"/> </xpath> @@ -19,6 +20,27 @@ </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> @@ -44,7 +66,6 @@ </field> </record> - <!-- 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> @@ -52,21 +73,53 @@ <field name="arch" type="xml"> <pivot string="Rapport"> <field name="project_id" type="row" string="Code activité UR" /> - <field name="date" type="col"/> - <field name="unit_amount" type="measure"/> + <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="name">Mes lignes de temps</field> <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> + <!-- 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"/> </data> <data noupdate="1"> <delete id="hr_timesheet.timesheet_menu_report_timesheet_by_task" model="ir.ui.menu"/>/>