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
1f68d0ab
Commit
1f68d0ab
authored
Nov 07, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modification condition attribution statut delay
parent
8b3bd9fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
16 deletions
+1
-16
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+1
-14
shift_counter_event.py
...addons/lacagette_membership/models/shift_counter_event.py
+0
-2
No files found.
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
1f68d0ab
...
...
@@ -76,19 +76,6 @@ class ResPartner(models.Model):
@api.multi
def
get_makeups_choosen_shifts
(
self
):
for
partner
in
self
:
cond
=
[
[
'partner_id'
,
'='
,
partner
.
id
],
[
'shift_type'
,
'='
,
'standard'
],
[
'is_makeup'
,
'='
,
True
],
[
'date_begin'
,
'>='
,
datetime
.
datetime
.
now
()
.
isoformat
()],
[
'state'
,
'='
,
'open'
]
]
fields
=
[
'id'
]
return
self
.
env
[
'shift.registration'
]
.
search_read
(
cond
,
fields
)
@api.multi
def
_compute_lacagette_working_state
(
self
):
_logger
.
debug
(
"Dans _compute_lacagette_working_state"
)
conf
=
self
.
env
[
'ir.config_parameter'
]
...
...
@@ -128,7 +115,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
and
partner
.
date_delay_stop
>
current_datetime
:
if
partner
.
makeups_to_do
==
0
and
partner
.
date_delay_stop
and
partner
.
date_delay_stop
>
current_datetime
:
state
=
'delay'
else
:
state
=
'suspended'
...
...
lacagette_addons/lacagette_membership/models/shift_counter_event.py
View file @
1f68d0ab
...
...
@@ -181,8 +181,6 @@ class ShiftCounterEvent(models.Model):
if
partner
.
makeups_to_do
==
0
:
target_status
=
'up_to_date'
else
:
already_choosen_makeups_to_do
=
partner
.
get_makeups_choosen_shifts
()
_logger
.
info
(
"already_choosen_makeups_to_do :
%
s"
,
str
(
already_choosen_makeups_to_do
))
target_status
=
'delay'
if
target_status
is
not
None
:
vals_for_update
=
{
'working_state'
:
target_status
,
'cooperative_state'
:
target_status
}
...
...
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