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
2c32dec4
Commit
2c32dec4
authored
Apr 01, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2676 : Fix binome cooperative_status
parent
ccda0152
Pipeline
#2044
passed with stage
in 2 minutes 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
admin.py
members/admin.py
+6
-5
No files found.
members/admin.py
View file @
2c32dec4
...
...
@@ -631,6 +631,8 @@ 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'
,
...
...
@@ -665,9 +667,10 @@ def create_pair(request):
api
.
execute
(
'res.partner'
,
'run_process_target_status'
,
[])
# update child base account state
api
.
execute
(
"res.partner"
,
"set_special_state"
,
{
"id"
:
child_id
,
'state'
:
"associated"
})
m
=
CagetteMember
(
child_id
)
.
unsuscribe_member
()
# update child base account state
api
.
update
(
"res.partner"
,
[
child_id
],
{
'cooperative_state'
:
"associated"
})
# get barcode rule id
bbcode_rule
=
api
.
search_read
(
"barcode.rule"
,
[[
'for_associated_people'
,
"="
,
True
]],
[
'id'
])[
0
]
...
...
@@ -722,10 +725,8 @@ def delete_pair(request):
parent
=
api
.
search_read
(
'res.partner'
,
[[
'id'
,
'='
,
child
[
'parent_id'
][
0
]]],
[
'cooperative_state'
])[
0
]
api
.
update
(
'res.partner'
,
[
child_id
],
{
"parent_id"
:
False
,
"is_associated_people"
:
False
})
api
.
delete
(
'res.partner'
,
[
child_id
])
# api.execute('res.partner', 'set_special_state', {"id": parent['id'], 'state': "cancel_special"})
for
id
in
prev_child
:
# api.update('res.partner', [id], {"cooperative_state": 'unsubscribed'})
api
.
execute
(
"res.partner"
,
"set_special_state"
,
{
"id"
:
id
,
'state'
:
"cancel_special"
})
api
.
update
(
"res.partner"
,
[
id
],
{
'cooperative_state'
:
"unsubscribed"
})
response
=
JsonResponse
({
"message"
:
"Succesfuly unpaired members"
},
status
=
200
)
...
...
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