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
06d1755d
Commit
06d1755d
authored
Feb 28, 2022
by
Thibault Grandjean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean code
parent
f585a4dd
Pipeline
#1858
passed with stage
in 1 minute 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
admin.py
members/admin.py
+2
-5
No files found.
members/admin.py
View file @
06d1755d
...
...
@@ -501,7 +501,6 @@ def create_pair(request):
"sex"
,
"street"
,
"street2"
,
"zip"
"zip"
,
"nb_associated_people"
]
...
...
@@ -517,10 +516,8 @@ def create_pair(request):
bbcode_rule
=
api
.
search_read
(
"barcode.rule"
,
[[
'for_associated_people'
,
"="
,
True
]],
[
'id'
])[
0
]
child
[
'barcode_rule_id'
]
=
bbcode_rule
[
"id"
]
attached_account
=
api
.
create
(
'res.partner'
,
child
)
print
(
attached_account
)
# generate_barcode
# generate_base
api
.
execute
(
'res.partner'
,
'generate_base'
,
[
attached_account
])
# api.execute('res.partner', 'generate_barcode', [attached_account])
response
=
JsonResponse
({
"message"
:
"Succesfuly paired members"
},
status
=
200
)
else
:
response
=
JsonResponse
({
"message"
:
"Unauthorized"
},
status
=
403
)
...
...
@@ -541,7 +538,7 @@ def delete_pair(request):
api
=
OdooAPI
()
data
=
json
.
loads
(
request
.
body
.
decode
())
parent_id
=
data
[
'parent'
][
'id'
]
# get attached accoun
d
# get attached accoun
t
child
=
api
.
search_read
(
'res.partner'
,
[[
'parent_id'
,
'='
,
parent_id
]],
[
'id'
])[
0
]
api
.
delete
(
'res.partner'
,
[
child
[
'id'
]])
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