You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
704 B
22 lines
704 B
# -*- coding: utf-8 -*-
|
|
# Copyright 2018 ACSONE SA/NV
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from openerp import api, fields, models
|
|
|
|
|
|
class EmailTemplate(models.Model):
|
|
|
|
_inherit = 'email.template'
|
|
|
|
# Fake field for auto-completing placeholder
|
|
placeholder_id = fields.Many2one(
|
|
'email.template.placeholder', string="Placeholder")
|
|
placeholder_value = fields.Char(
|
|
help='Placeholder value to copy-paste in the desired template field')
|
|
|
|
@api.onchange('placeholder_id')
|
|
def _onchange_placeholder_id(self):
|
|
for tmpl in self:
|
|
if tmpl.placeholder_id:
|
|
tmpl.placeholder_value = tmpl.placeholder_id.placeholder
|