mirror of
https://github.com/bringout/oca-mrp.git
synced 2026-04-20 16:52:04 +02:00
Initial commit: OCA Mrp packages (117 packages)
This commit is contained in:
commit
277e84fd7a
4403 changed files with 395154 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
# Copyright 2017 Tecnativa - Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import Command, api, fields, models
|
||||
|
||||
|
||||
class EventEvent(models.Model):
|
||||
_inherit = "event.event"
|
||||
|
||||
@api.model
|
||||
def _default_event_mail_template_id(self):
|
||||
return self.env.company.event_mail_template_id
|
||||
|
||||
event_mail_template_id = fields.Many2one(
|
||||
comodel_name="event.mail.template",
|
||||
string="Mail Template Scheduler",
|
||||
default=_default_event_mail_template_id,
|
||||
)
|
||||
|
||||
@api.depends("event_mail_template_id")
|
||||
def _compute_event_mail_ids(self):
|
||||
records = self.filtered("event_mail_template_id")
|
||||
without_template = self - records
|
||||
for event in records:
|
||||
command = [(5, 0)] + [
|
||||
Command.create(line._prepare_event_mail_values())
|
||||
for line in event.event_mail_template_id.scheduler_template_ids
|
||||
]
|
||||
event.event_mail_ids = command
|
||||
return super(EventEvent, without_template)._compute_event_mail_ids()
|
||||
Loading…
Add table
Add a link
Reference in a new issue