mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Guidelines file names
This commit is contained in:
23
pms/models/mail_compose_message.py
Normal file
23
pms/models/mail_compose_message.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2017 Alexandre Díaz
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class MailComposeMessage(models.TransientModel):
|
||||
_inherit = "mail.compose.message"
|
||||
|
||||
def send_mail(self, auto_commit=False):
|
||||
if (
|
||||
self._context.get("default_model") == "pms.folio"
|
||||
and self._context.get("default_res_id")
|
||||
and self._context.get("mark_so_as_sent")
|
||||
):
|
||||
folio = self.env["pms.folio"].browse([self._context["default_res_id"]])
|
||||
if folio:
|
||||
cmds = [
|
||||
(1, lid, {"to_send": False}) for lid in folio.reservation_ids.ids
|
||||
]
|
||||
if any(cmds):
|
||||
folio.reservation_ids = cmds
|
||||
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||
Reference in New Issue
Block a user