Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
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
2
Merge Requests
2
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
third-party
Commits
f53cba2f
Commit
f53cba2f
authored
Nov 20, 2024
by
François COLOMBIER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifications mise à jour rattrapages suite création binôme
parent
e5cd3108
Pipeline
#3946
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
admin.py
members/admin.py
+8
-9
No files found.
members/admin.py
View file @
f53cba2f
...
...
@@ -852,7 +852,7 @@ def create_pair(request):
# on transfert les rattrapages sur le parent
# Comme on annule les services du suppléant, on ajoute en makeup_to_do du titulaire les rattrapages choisis ou non du suppléant
api
.
update
(
"res.partner"
,
[
parent_id
],
{
"makeups_to_do"
:
parent
[
'makeups_to_do'
]
+
child_makeups
})
# On annule les rattrapages du child
api
.
update
(
'res.partner'
,
[
child_id
],
{
"makeups_to_do"
:
0
})
...
...
@@ -863,7 +863,7 @@ def create_pair(request):
"type"
:
child
[
'shift_type'
],
"partner_id"
:
child_id
,
"point_qty"
:
1
})
# on retire les points au titulaire
# on retire les points au titulaire
, les rattrages sont automatiquement ajoutés
api
.
create
(
'shift.counter.event'
,
{
"name"
:
'passage en binôme'
,
"shift_id"
:
False
,
"type"
:
parent
[
'shift_type'
],
...
...
@@ -871,7 +871,6 @@ def create_pair(request):
"point_qty"
:
-
1
})
elif
child_makeups
+
parent_makeups
>
2
:
# on annule les rattrapages du suppléant et on met 2 rattrapages sur le titulaire
api
.
update
(
'res.partner'
,
[
parent_id
],
{
"makeups_to_do"
:
2
})
api
.
update
(
'res.partner'
,
[
child_id
],
{
"makeups_to_do"
:
0
})
for
makeup
in
range
(
child_makeups
):
# reset du compteur du suppléant
...
...
@@ -880,18 +879,18 @@ def create_pair(request):
"type"
:
child
[
'shift_type'
],
"partner_id"
:
child_id
,
"point_qty"
:
1
})
for
i
in
range
(
(
parent_makeups
+
child_makeups
)
-
2
):
for
i
in
range
(
abs
(
parent_makeups
-
2
)
):
# màj du compteur du titulaire
api
.
create
(
'shift.counter.event'
,
{
"name"
:
"passage en binôme"
,
"shift_id"
:
False
,
"type"
:
parent
[
'shift_type'
],
"partner_id"
:
parent_id
,
"point_qty"
:
-
1
})
try
:
api
.
execute
(
'res.partner'
,
'run_process_target_status'
,
[])
except
:
pass
# No more useful since status is fully managed by lacagette_addons modules
#
try:
#
api.execute('res.partner', 'run_process_target_status', [])
#
except:
#
pass
m
=
CagetteMember
(
child_id
)
.
unsubscribe_member
()
# update child base account state
...
...
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