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
3b99d988
Commit
3b99d988
authored
Jan 30, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move child status update 'associated' to the end of the create_pair process so that odoo accepts it
parent
c9dbb00e
Pipeline
#4100
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
admin.py
members/admin.py
+6
-3
No files found.
members/admin.py
View file @
3b99d988
...
...
@@ -829,9 +829,7 @@ def create_pair(request):
child_id
,
0
,
'création de binôme (mise à zéro suppléant)'
)
m
=
CagetteMember
(
child_id
)
.
unsubscribe_member
()
# update child base account state
api
.
update
(
"res.partner"
,
[
child_id
],
{
'cooperative_state'
:
"associated"
})
CagetteMember
(
child_id
)
.
unsubscribe_member
()
# get barcode rule id
bbcode_rule
=
api
.
search_read
(
"barcode.rule"
,
[[
'for_associated_people'
,
"="
,
True
]],
[
'id'
])[
0
]
...
...
@@ -850,6 +848,11 @@ def create_pair(request):
attached_account
=
api
.
create
(
'res.partner'
,
child
)
# generate_base
api
.
execute
(
'res.partner'
,
'generate_base'
,
[
attached_account
])
# update child base account state after contact is created otherwise odoo complains that
# setting status associated is not allowed
api
.
update
(
"res.partner"
,
[
child_id
],
{
'cooperative_state'
:
"associated"
})
response
=
JsonResponse
({
"message"
:
"Succesfuly paired members"
},
status
=
200
)
else
:
response
=
JsonResponse
({
"message"
:
"Unauthorized"
},
status
=
403
)
...
...
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