Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
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
0
Merge Requests
0
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
odoo
Commits
fac232e5
Commit
fac232e5
authored
Nov 16, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7151 : Statut suite à réinscription d'un membre 'parti.e'
parent
1f68d0ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+7
-0
No files found.
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
fac232e5
...
@@ -84,6 +84,7 @@ class ResPartner(models.Model):
...
@@ -84,6 +84,7 @@ class ResPartner(models.Model):
for
partner
in
self
:
for
partner
in
self
:
_logger
.
debug
(
"partner_id =
%
s, cooperative_state =
%
s"
,
str
(
partner
.
id
),
str
(
partner
.
cooperative_state
))
_logger
.
debug
(
"partner_id =
%
s, cooperative_state =
%
s"
,
str
(
partner
.
id
),
str
(
partner
.
cooperative_state
))
state
=
'up_to_date'
state
=
'up_to_date'
if
partner
.
leave_ids
:
if
partner
.
leave_ids
:
is_exempted
=
partner
.
leave_ids
.
filtered
(
is_exempted
=
partner
.
leave_ids
.
filtered
(
lambda
l
:
l
.
state
==
'done'
and
l
.
start_date
<=
current_datetime
and
l
.
stop_date
>=
lambda
l
:
l
.
state
==
'done'
and
l
.
start_date
<=
current_datetime
and
l
.
stop_date
>=
...
@@ -97,6 +98,12 @@ class ResPartner(models.Model):
...
@@ -97,6 +98,12 @@ class ResPartner(models.Model):
state
=
partner
.
parent_id
.
cooperative_state
state
=
partner
.
parent_id
.
cooperative_state
else
:
else
:
if
partner
.
cooperative_state
in
[
'gone'
,
'associated'
]:
if
partner
.
cooperative_state
in
[
'gone'
,
'associated'
]:
if
partner
.
cooperative_state
==
'gone'
and
partner
.
is_unsubscribed
is
False
:
# the coop member came back and has now a shift template registration
if
(
partner
.
shift_type
==
'standard'
and
partner
.
final_standard_point
<=
0
)
\
or
(
partner
.
shift_type
==
'ftop'
and
partner
.
final_ftop_point
<=
0
)
:
state
=
'suspended'
else
:
state
=
partner
.
cooperative_state
state
=
partner
.
cooperative_state
else
:
else
:
potential_associated_record
=
self
.
env
[
'res.partner'
]
.
search
([(
'email'
,
'='
,
self
.
email
),
(
'is_associated_people'
,
'='
,
True
)])
potential_associated_record
=
self
.
env
[
'res.partner'
]
.
search
([(
'email'
,
'='
,
self
.
email
),
(
'is_associated_people'
,
'='
,
True
)])
...
...
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