mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-22 05:21:59 +02:00
Initial commit: Mail packages
This commit is contained in:
commit
4e53507711
1948 changed files with 751201 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ChatbotMailMessage(models.Model):
|
||||
""" Chatbot Mail Message
|
||||
We create a new model to store the related step to a mail.message and the user's answer.
|
||||
We do this in a new model to avoid bloating the 'mail.message' model.
|
||||
"""
|
||||
|
||||
_name = 'chatbot.message'
|
||||
_description = 'Chatbot Message'
|
||||
_order = 'create_date desc, id desc'
|
||||
_rec_name = 'mail_channel_id'
|
||||
|
||||
mail_message_id = fields.Many2one('mail.message', string='Related Mail Message', required=True, ondelete="cascade")
|
||||
mail_channel_id = fields.Many2one('mail.channel', string='Discussion Channel', required=True, ondelete="cascade")
|
||||
script_step_id = fields.Many2one(
|
||||
'chatbot.script.step', string='Chatbot Step', required=True, ondelete='cascade')
|
||||
user_script_answer_id = fields.Many2one('chatbot.script.answer', string="User's answer", ondelete="set null")
|
||||
user_raw_answer = fields.Html(string="User's raw answer")
|
||||
|
||||
_sql_constraints = [
|
||||
('_unique_mail_message_id', 'unique (mail_message_id)',
|
||||
"A mail.message can only be linked to a single chatbot message"),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue