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
5fcff4ae
Commit
5fcff4ae
authored
Sep 29, 2021
by
François
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Afficahge des 2 noms dans le cas de parrainnage
parent
2d590dc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
+18
-1
models.py
members/models.py
+18
-1
No files found.
members/models.py
View file @
5fcff4ae
...
@@ -20,7 +20,7 @@ FUNDRAISING_CAT_ID = {'A': 1, 'B': 2, 'C': 3}
...
@@ -20,7 +20,7 @@ FUNDRAISING_CAT_ID = {'A': 1, 'B': 2, 'C': 3}
class
CagetteMember
(
models
.
Model
):
class
CagetteMember
(
models
.
Model
):
"""Class to handle cagette Odoo member."""
"""Class to handle cagette Odoo member."""
m_default_fields
=
[
'name'
,
'sex'
,
'image_medium'
,
'active'
,
m_default_fields
=
[
'name'
,
'
parent_name'
,
'
sex'
,
'image_medium'
,
'active'
,
'barcode_base'
,
'barcode'
,
'in_ftop_team'
,
'barcode_base'
,
'barcode'
,
'in_ftop_team'
,
'is_associated_people'
,
'is_member'
,
'shift_type'
,
'is_associated_people'
,
'is_member'
,
'shift_type'
,
'display_ftop_points'
,
'display_std_points'
,
'display_ftop_points'
,
'display_std_points'
,
...
@@ -714,6 +714,9 @@ class CagetteMember(models.Model):
...
@@ -714,6 +714,9 @@ class CagetteMember(models.Model):
CagetteMember
.
get_state_fr
(
m
[
'cooperative_state'
])
CagetteMember
.
get_state_fr
(
m
[
'cooperative_state'
])
# member = CagetteMember(m['id'], m['email'])
# member = CagetteMember(m['id'], m['email'])
# m['next_shifts'] = member.get_next_shift()
# m['next_shifts'] = member.get_next_shift()
if
not
m
[
'parent_name'
]
is
False
:
m
[
'name'
]
+=
' / '
+
m
[
'parent_name'
]
del
m
[
'parent_name'
]
members
.
append
(
m
)
members
.
append
(
m
)
return
CagetteMember
.
add_next_shifts_to_members
(
members
)
return
CagetteMember
.
add_next_shifts_to_members
(
members
)
...
@@ -1104,6 +1107,20 @@ class CagetteServices(models.Model):
...
@@ -1104,6 +1107,20 @@ class CagetteServices(models.Model):
fields
=
[
'partner_id'
,
'shift_type'
,
'state'
]
fields
=
[
'partner_id'
,
'shift_type'
,
'state'
]
members
=
api
.
search_read
(
'shift.registration'
,
cond
,
fields
)
members
=
api
.
search_read
(
'shift.registration'
,
cond
,
fields
)
s
[
'members'
]
=
sorted
(
members
,
key
=
lambda
x
:
x
[
'partner_id'
][
0
])
s
[
'members'
]
=
sorted
(
members
,
key
=
lambda
x
:
x
[
'partner_id'
][
0
])
if
len
(
s
[
'members'
])
>
0
:
# search for associated people linked to these members
mids
=
[]
for
m
in
s
[
'members'
]:
mids
.
append
(
m
[
'partner_id'
][
0
])
cond
=
[[
'parent_id'
,
'in'
,
mids
]]
fields
=
[
'parent_id'
,
'name'
]
associated
=
api
.
search_read
(
'res.partner'
,
cond
,
fields
)
if
len
(
associated
)
>
0
:
for
m
in
s
[
'members'
]:
for
a
in
associated
:
if
int
(
a
[
'parent_id'
][
0
])
==
int
(
m
[
'partner_id'
][
0
]):
m
[
'partner_id'
][
1
]
+=
' / '
+
a
[
'name'
]
return
services
return
services
...
...
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