Browse Source

Show mail tracking in message form

pull/355/head
Oleksandr Komarov 6 years ago
parent
commit
0c06991a35
  1. 3
      mail_tracking/__manifest__.py
  2. 4
      mail_tracking/models/mail_message.py
  3. 22
      mail_tracking/views/mail_message_views.xml

3
mail_tracking/__manifest__.py

@ -5,7 +5,7 @@
{ {
"name": "Email tracking", "name": "Email tracking",
"summary": "Email tracking system for all mails sent", "summary": "Email tracking system for all mails sent",
"version": "11.0.1.2.0",
"version": "11.0.1.2.1",
"category": "Social Network", "category": "Social Network",
"website": "http://github.com/OCA/social", "website": "http://github.com/OCA/social",
"author": "Tecnativa, " "author": "Tecnativa, "
@ -25,6 +25,7 @@
"views/mail_tracking_email_view.xml", "views/mail_tracking_email_view.xml",
"views/mail_tracking_event_view.xml", "views/mail_tracking_event_view.xml",
"views/res_partner_view.xml", "views/res_partner_view.xml",
"views/mail_message_views.xml",
], ],
"qweb": [ "qweb": [
"static/src/xml/mail_tracking.xml", "static/src/xml/mail_tracking.xml",

4
mail_tracking/models/mail_message.py

@ -1,12 +1,14 @@
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> # Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api
from odoo import models, fields, api
class MailMessage(models.Model): class MailMessage(models.Model):
_inherit = "mail.message" _inherit = "mail.message"
mail_tracking_email_ids = fields.One2many('mail.tracking.email', 'mail_message_id')
def _tracking_status_map_get(self): def _tracking_status_map_get(self):
return { return {
'False': 'waiting', 'False': 'waiting',

22
mail_tracking/views/mail_message_views.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_message_form">
<field name="name">mail.message.form.pbx</field>
<field name="model">mail.message</field>
<field name="inherit_id" ref="mail.view_message_form"/>
<field name="arch" type="xml">
<data>
<notebook position="inside">
<page string="Mail Tracking">
<group>
<field name="mail_tracking_email_ids" widget="one2many_list" nolabel="1">
</field>
</group>
</page>
</notebook>
</data>
</field>
</record>
</odoo>
Loading…
Cancel
Save