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
b00e5742
Commit
b00e5742
authored
Nov 19, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not send shift mail reminder for committee members
parent
88c283ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
lacagette_shift_registrations.py
.../lacagette_shifts/models/lacagette_shift_registrations.py
+11
-1
No files found.
lacagette_addons/lacagette_shifts/models/lacagette_shift_registrations.py
View file @
b00e5742
...
...
@@ -2,6 +2,9 @@
from
openerp
import
_
,
api
,
models
,
fields
import
datetime
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
class
ShiftRegistration
(
models
.
Model
):
_inherit
=
'shift.registration'
...
...
@@ -21,12 +24,19 @@ class ShiftRegistration(models.Model):
@api.multi
def
send_shift_reminder_email
(
self
):
conf
=
self
.
env
[
'ir.config_parameter'
]
committees_shift_template_id
=
0
try
:
committees_shift_template_id
=
int
(
conf
.
get_param
(
"lacagette_membership.committees_shift_id"
))
except
:
pass
mail_template
=
self
.
env
.
ref
(
'lacagette_shifts.custom_shift_email_reminder'
)
if
not
mail_template
:
return
False
for
reg_target
in
self
:
if
reg_target
.
shift_id
.
shift_template_id
.
id
!=
committees_shift_template_id
:
mail_template
.
send_mail
(
reg_target
.
id
)
self
.
write
({
'reminder_mail_sent'
:
True
})
reg_target
.
write
({
'reminder_mail_sent'
:
True
})
return
True
@api.model
...
...
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