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
3
Merge Requests
3
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
574f0397
Commit
574f0397
authored
3 years ago
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error if pair parent is unsubscribed (no shift subscription)
parent
da54d6c6
1 merge request
!164
Intégration des dév. Cooperatic pour la Cagette
Pipeline
#2054
passed with stage
in 1 minute 31 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
admin.py
members/admin.py
+6
-2
No files found.
members/admin.py
View file @
574f0397
...
...
@@ -609,6 +609,11 @@ def create_pair(request):
child
[
field
]
=
False
child
[
'is_associated_people'
]
=
True
child
[
'parent_id'
]
=
parent
[
'id'
]
# Following lines are useful if parent or child is unsubscribed
if
not
'shift_type'
in
parent
:
parent
[
'shift_type'
]
=
'standard'
if
not
'shift_type'
in
child
:
child
[
'shift_type'
]
=
'standard'
# fusion des rattrapages
child_makeups
=
child
[
'makeups_to_do'
]
parent_makeups
=
parent
[
'makeups_to_do'
]
...
...
@@ -631,8 +636,7 @@ def create_pair(request):
api
.
update
(
"res.partner"
,
[
parent_id
],
{
"makeups_to_do"
:
parent
[
'makeups_to_do'
]
+
child
[
'makeups_to_do'
]})
# On annule les rattrapages du child
api
.
update
(
'res.partner'
,
[
child_id
],
{
"makeups_to_do"
:
0
})
if
not
'shift_type'
in
parent
:
parent
[
'shift_type'
]
=
child
[
'shift_type'
]
for
makeup
in
range
(
child_makeups
):
# reset du compteur du suppléant
api
.
create
(
'shift.counter.event'
,
{
"name"
:
'passage en binôme'
,
...
...
This diff is collapsed.
Click to expand it.
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