diff --git a/models/cgscop_timesheet_code.py b/models/cgscop_timesheet_code.py index 76dc8feee2fa916dc06400562fb6968942f54982..d41441c82f3b297a1d9aee9193f3abfe32557af1 100644 --- a/models/cgscop_timesheet_code.py +++ b/models/cgscop_timesheet_code.py @@ -10,3 +10,8 @@ class ScopTimesheetCode(models.Model): _order = 'name' name = fields.Char('Nom') + company_id = fields.Many2one( + comodel_name='res.company', + string='Company', + required=True, + default=lambda self: self.env.user.company_id) diff --git a/models/hr_timesheet.py b/models/hr_timesheet.py index 5770f42fe6e89094dc7b76f3c7648ed6f3f46292..82f77c093f257e7e412bf227e66edef34189a07d 100644 --- a/models/hr_timesheet.py +++ b/models/hr_timesheet.py @@ -16,10 +16,6 @@ class ScopHrTimesheet(models.Model): comodel_name='ur.financial.system', string='Dispositif Financier') - # ------------------------------------------------------ - # Compute Functions - # ------------------------------------------------------ - # ------------------------------------------------------ # OnChange Functions # ------------------------------------------------------ diff --git a/models/project.py b/models/project.py index 412a08daebdcc0af2081d8d005c547f05f7d0a2f..332c5d5eefc6c529869ef03dd9ccef7b69df94ba 100644 --- a/models/project.py +++ b/models/project.py @@ -10,13 +10,7 @@ class ScopProjectTimesheet(models.Model): cgscop_timesheet_code_id = fields.Many2one( comodel_name='cgscop.timesheet.code', string='Code Activité CG') + privacy_visibility = fields.Selection(default="employees") - # ------------------------------------------------------ - # Compute Functions - # ------------------------------------------------------ - - # ------------------------------------------------------ - # Onchange Functions - # ------------------------------------------------------ diff --git a/views/cgscop_timesheet_code.xml b/views/cgscop_timesheet_code.xml index 481a67343e1931b9757bc07e9b927c7eaadf9f6e..fbf5240519ab27c955c9298d55f22af1f46f1535 100644 --- a/views/cgscop_timesheet_code.xml +++ b/views/cgscop_timesheet_code.xml @@ -10,6 +10,7 @@ <field name="arch" type="xml"> <tree editable='top'> <field name="name" /> + <field name="company_id" groups="base.group_no_one" /> </tree> </field> </record> diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml index 61d5b7df8532c8b46e735228874a8a22d154c83c..570b1d296dc3bc29a3fc35fbd63bd3306877719b 100644 --- a/views/hr_timesheet.xml +++ b/views/hr_timesheet.xml @@ -27,5 +27,24 @@ </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> + <field name="model">account.analytic.line</field> + <field name="arch" type="xml"> + <pivot string="Rapport"> + <field name="project_id" type="row"/> + <field name="date" type="col"/> + <field name="unit_amount" type="measure"/> + </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> + </data> </odoo> \ No newline at end of file diff --git a/views/hr_timesheet_cgscop.xml b/views/hr_timesheet_cgscop.xml index ac9b5d78efe897d0043ce3c9c4d627de284ee019..f6ef5e962383be58c74ac6554bef147b06f4e1e2 100644 --- a/views/hr_timesheet_cgscop.xml +++ b/views/hr_timesheet_cgscop.xml @@ -37,6 +37,21 @@ <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)]}"/> + <field name="sequence" groups="base.group_no_one"/> + <field name="company_id" groups="base.group_multi_company"/> + </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"/> @@ -127,13 +142,6 @@ 'default_privacy_visibility': 'employees', 'default_allow_timesheets': True, }</field> - <field name="help" type="html"> - <p class="o_view_nocontent_empty_folder"> - Create a new project - </p><p> - Organize your activities (plan tasks, track issues, invoice timesheets) for internal, personal or customer projects. - </p> - </field> </record> <menuitem