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
f6f6a0de
Commit
f6f6a0de
authored
Oct 25, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#6995 et pb statut suppléant suite création binôme
parent
54208bec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+5
-2
shift_extension.py
...tte_addons/lacagette_membership/models/shift_extension.py
+4
-2
No files found.
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
f6f6a0de
...
...
@@ -116,7 +116,7 @@ class ResPartner(models.Model):
self
.
env
[
'shift.counter.event'
]
.
unsubscribe_partner
(
partner
,
unsubscribe_limit
,
points
)
else
:
if
partner
.
date_alert_stop
:
if
partner
.
date_delay_stop
>
current_datetime
:
if
partner
.
date_delay_stop
and
partner
.
date_delay_stop
>
current_datetime
:
state
=
'delay'
else
:
state
=
'suspended'
...
...
@@ -335,7 +335,10 @@ class ResPartner(models.Model):
if
'barcode_base'
in
vals
:
vals
[
'cooperative_state'
]
=
'unsubscribed'
vals
[
'working_state'
]
=
'unsubscribed'
return
super
(
ResPartner
,
self
)
.
write
(
vals
)
res
=
super
(
ResPartner
,
self
)
.
write
(
vals
)
if
'barcode_base'
in
vals
and
self
.
parent_id
:
self
.
recompute_member_states
()
return
res
@api.model
...
...
lacagette_addons/lacagette_membership/models/shift_extension.py
View file @
f6f6a0de
...
...
@@ -12,14 +12,16 @@ class ShiftExtension(models.Model):
@api.model
def
_update_member_status
(
self
,
vals
):
_logger
.
debug
(
"_update_member_status, reçu
%
s"
,
str
(
vals
))
res_partner
=
self
.
env
[
'res.partner'
]
.
search
([(
'id'
,
'='
,
vals
[
'partner_id'
])])
if
res_partner
:
res_partner
[
0
]
.
recompute_member_states
()
@api.m
odel
@api.m
ulti
def
write
(
self
,
vals
):
_logger
.
debug
(
"Shift extension
Vals recues =
%
s"
,
str
(
vals
))
_logger
.
debug
(
"Shift extension
vals =
%
s, partner_id =
%
s"
,
str
(
vals
),
str
(
self
.
partner_id
.
id
))
res
=
super
(
ShiftExtension
,
self
)
.
write
(
vals
)
vals
[
'partner_id'
]
=
self
.
partner_id
.
id
self
.
_update_member_status
(
vals
)
return
res
...
...
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