Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_timesheet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_timesheet
Commits
b6a3afbe
Commit
b6a3afbe
authored
5 months ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Plain Diff
[MR] Ajout d'une notion d'heures supplémentaires (UR Ouest)
See merge request
!12
parents
f71ee0ef
6e33dea3
No related branches found
Branches containing commit
Tags
v1.0.2
1 merge request
!12
Ajout d'une notion d'heures supplémentaires (UR Ouest)
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
models/hr_timesheet.py
+17
-0
17 additions, 0 deletions
models/hr_timesheet.py
models/res_company.py
+5
-0
5 additions, 0 deletions
models/res_company.py
views/hr_timesheet.xml
+18
-0
18 additions, 0 deletions
views/hr_timesheet.xml
views/res_company.xml
+1
-0
1 addition, 0 deletions
views/res_company.xml
with
41 additions
and
0 deletions
models/hr_timesheet.py
+
17
−
0
View file @
b6a3afbe
...
...
@@ -72,6 +72,14 @@ class ScopHrTimesheet(models.Model):
string
=
"
Lieu
"
,
)
justificatifs
=
fields
.
Char
(
string
=
"
Justificatifs
"
,
required
=
False
)
is_overtime
=
fields
.
Boolean
(
string
=
"
Heures supplémentaires
"
,
default
=
False
,
)
is_overtime_allowed
=
fields
.
Boolean
(
string
=
"
Heures supplémentaires autorisées
"
,
compute
=
"
_compute_overtime_allowed
"
,
)
calendar_l1
=
fields
.
Char
(
string
=
"
Ligne 1 calendrier
"
,
...
...
@@ -85,6 +93,11 @@ class ScopHrTimesheet(models.Model):
# ------------------------------------------------------
# Compute Functions
# ------------------------------------------------------
@api.depends
(
"
ur_id
"
)
def
_compute_overtime_allowed
(
self
):
for
rec
in
self
:
rec
.
is_overtime_allowed
=
self
.
env
.
company
.
overtime_working
@api.depends
(
"
ur_id
"
)
def
_compute_ur_system_nb
(
self
):
for
timesheet
in
self
:
...
...
@@ -269,6 +282,10 @@ class ScopHrTimesheet(models.Model):
if
len
(
nbrc
)
==
0
:
custom_context
[
'
hide_regional_convention
'
]
=
True
overtime_allowed
=
self
.
env
.
company
.
overtime_working
if
not
overtime_allowed
:
custom_context
[
'
hide_overtime
'
]
=
True
res
=
super
(
ScopHrTimesheet
,
self
.
with_context
(
custom_context
)).
fields_view_get
(
view_id
=
view_id
,
view_type
=
view_type
,
toolbar
=
toolbar
,
submenu
=
submenu
)
...
...
This diff is collapsed.
Click to expand it.
models/res_company.py
+
5
−
0
View file @
b6a3afbe
...
...
@@ -18,3 +18,8 @@ class ResCompanyTmesheet(models.Model):
help
=
"
Si cette option est cochée, un employé peut imputer sans limite
"
"
de temps sur une journée
"
,
)
overtime_working
=
fields
.
Boolean
(
string
=
"
Heures supplémentaires
"
,
default
=
False
,
help
=
"
Si cette option est cochée, un employé peut déclarer des heures supplémentaire
"
)
This diff is collapsed.
Click to expand it.
views/hr_timesheet.xml
+
18
−
0
View file @
b6a3afbe
...
...
@@ -105,6 +105,12 @@
/>
<field
name=
"name"
/>
<field
name=
"unit_amount"
widget=
"float_time"
/>
<field
name=
"is_overtime_allowed"
invisible=
"1"
/>
<field
name=
"is_overtime"
widget=
"boolean_toggle"
attrs=
"{'invisible': [('is_overtime_allowed', '=', False)]}"
/>
</group>
<group
string=
"Divers"
>
<field
name=
"is_present"
widget=
"boolean_toggle"
/>
...
...
@@ -179,6 +185,13 @@
/>
<field
name=
"name"
/>
<field
name=
"unit_amount"
widget=
"float_time"
/>
<field
name=
"is_overtime_allowed"
invisible=
"1"
/>
<field
name=
"is_overtime"
widget=
"boolean_toggle"
attrs=
"{'invisible': [('is_overtime_allowed', '=', False)]}"
/>
</group>
<group
string=
"Divers"
>
<field
name=
"is_present"
widget=
"boolean_toggle"
/>
...
...
@@ -267,6 +280,11 @@
>
{'readonly': [('state', 'in', ('submit', 'valid'))]}
</attribute>
</field>
<field
name=
"unit_amount"
position=
"after"
>
<field
name=
"is_overtime"
widget=
"boolean_toggle"
invisible=
"context.get('hide_overtime')"
/>
<field
name=
"ur_regional_convention_nb"
invisible=
"1"
/>
<field
name=
"ur_financial_system_nb"
invisible=
"1"
/>
<field
...
...
This diff is collapsed.
Click to expand it.
views/res_company.xml
+
1
−
0
View file @
b6a3afbe
...
...
@@ -17,6 +17,7 @@
name=
"day_duration"
attrs=
"{'invisible': [('day_working', '=', True)]}"
/>
<field
name=
"overtime_working"
widget=
"boolean_toggle"
/>
</group>
</group>
</page>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment