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
6f151f38
Commit
6f151f38
authored
Feb 22, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix potential error that people get more makeups than they should
parent
59273361
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
shift_registration.py
..._addons/lacagette_membership/models/shift_registration.py
+3
-2
No files found.
lacagette_addons/lacagette_membership/models/shift_registration.py
View file @
6f151f38
...
...
@@ -23,10 +23,11 @@ class ShiftRegistration(models.Model):
absence_status
=
conf
.
get_param
(
"lacagette_membership.absence_status"
)
if
'state'
in
vals
and
vals
[
'state'
]
==
absence_status
:
if
self
.
ids
:
# it is the case when called from "absence cron job" run in external third-party
to_add
=
2
if
absence_status
==
'absent'
else
1
for
s
in
self
.
env
[
'shift.registration'
]
\
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
# it is the case when called from "absence cron job" run in external third-party
to_add
=
2
if
absence_status
==
'absent'
else
1
# 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
...
...
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