我的问题是表单电子邮件界面不显示
请帮助我我像这样创建模板电子邮件
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="entretien_send_email" model="email.template">
<field name="name">Entretien Send by email</field>
<field name="model_id" ref="model_appelsoffres_entretien"/>
<field name="email_from">${(object.user_id.email or '')|safe}</field>
<field name="subject">entretien</field>
<field name="email_to">${(object.candidat.email or '')|safe}</field>
<field name="auto_delete" eval="True" />
<field name="subject">Your request has been submit</field>
<field name="message"><![CDATA[
THIS IS AN AUTOMATED EMAIL. DO NOT REPLY.
Hello,
We are here to inform you that the request [[object.candidat.nom]] est
de faire un entretien [[object.titre_evenement]] with the following data:
| Request - Details
|=========================
| Titre Evenement: [[object.titre_evenement]]
|=========================
| Nom Person: [[object.candidat.nom]]
| Date Entretien: [[object.date_entretien]]
| Heure Debut: [[object.heure_debut]]
|=========================
| Heure Fin: [[object.heure_fin]]
Has not been confirmed and is closed.
If you have any question, do not hesitate to contact your supervisor.
Thank you!]]>
</field>
</record>
</data>
</openerp>
和我的代码python
我调用了电子邮件模板,然后设置了
表单视图但不显示表单界面
class entretien(models.Model):
_name='appelsoffres.entretien'
titre_evenement = fields.Char(required=True)
candidat =fields.Many2one('appelsoffres.candidature',string="Candidat",required=True)
email = fields.Char(required=True)
telephone = fields.Char(required=True)
portable = fields.Char(required=True)
state = fields.Selection([
('draft', "Brouillon"),
('confirmed', "Rendez Vous Planifié"),
('done', "Terminé"),
('sent', "Envoyé"),
], default='draft')
@api.multi
def action_draftentretien(self):
self.state = 'draft'
@api.multi
def action_confirmentretien(self):
self.state = 'confirmed'
@api.multi
def action_doneentretien(self):
self.state = 'done'
@api.multi
def send(self):
self.state = 'sent'
entretien_send_email = self.env.ref('Appelsdoffres.entretien_send_email',False)
entretien_send_email.sudo().with_context().send_mail(self.id, True)
result = {
'name': 'Send Mail',
'view_type': 'form',
'view_mode': 'tree,form',
'views': [('false', 'form'), ],
'res_model':'appelsoffres.entretien',
'context': 'ctx',
'type': 'ir.actions.act_window',
'res_id': '1',
'target': 'current',
'context': {},
}
return result
entretien()