Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
e9d98f1c
Commit
e9d98f1c
authored
Feb 04, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 2 makeups if a makeup shift is missed
parent
87d5994b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
shift_registration.py
..._addons/lacagette_membership/models/shift_registration.py
+4
-0
No files found.
lacagette_addons/lacagette_membership/models/shift_registration.py
View file @
e9d98f1c
...
@@ -27,6 +27,9 @@ class ShiftRegistration(models.Model):
...
@@ -27,6 +27,9 @@ class ShiftRegistration(models.Model):
to_add
=
2
if
absence_status
==
'absent'
else
1
to_add
=
2
if
absence_status
==
'absent'
else
1
for
s
in
self
.
env
[
'shift.registration'
]
\
for
s
in
self
.
env
[
'shift.registration'
]
\
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
# Missing a makeup leads to have an additional makeup (the shift you initialy missed + the makeup you missed)
if
s
.
is_makeup
is
True
:
to_add
+=
1
new_makeups_to_do
=
s
.
partner_id
.
makeups_to_do
+
to_add
new_makeups_to_do
=
s
.
partner_id
.
makeups_to_do
+
to_add
s
.
partner_id
.
update
({
'makeups_to_do'
:
new_makeups_to_do
})
s
.
partner_id
.
update
({
'makeups_to_do'
:
new_makeups_to_do
})
return
super
(
ShiftRegistration
,
self
)
.
write
(
vals
)
return
super
(
ShiftRegistration
,
self
)
.
write
(
vals
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment