From 39d5bee8cfc39e0901eecd733189a50fabe271fe Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Fri, 14 Oct 2016 22:57:30 +0200 Subject: [PATCH] [MIG] mail_tracking_mailgun: Migrated to 10.0 --- mail_tracking_mailgun/__manifest__.py | 4 ++-- mail_tracking_mailgun/models/ir_mail_server.py | 6 ++---- mail_tracking_mailgun/models/mail_tracking_email.py | 2 +- mail_tracking_mailgun/tests/test_mailgun.py | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mail_tracking_mailgun/__manifest__.py b/mail_tracking_mailgun/__manifest__.py index e607daac..51e92ce5 100644 --- a/mail_tracking_mailgun/__manifest__.py +++ b/mail_tracking_mailgun/__manifest__.py @@ -4,14 +4,14 @@ { "name": "Mail tracking for Mailgun", "summary": "Mail tracking and Mailgun webhooks integration", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "category": "Social Network", "website": "https://odoo-community.org/", "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - 'installable': False, + 'installable': True, "depends": [ "mail_tracking", ], diff --git a/mail_tracking_mailgun/models/ir_mail_server.py b/mail_tracking_mailgun/models/ir_mail_server.py index 2ebb4ce6..0fe89063 100644 --- a/mail_tracking_mailgun/models/ir_mail_server.py +++ b/mail_tracking_mailgun/models/ir_mail_server.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import json -from openerp import models +from odoo import models class IrMailServer(models.Model): @@ -14,9 +14,7 @@ class IrMailServer(models.Model): tracking_email_id, headers) headers = headers or {} metadata = { - # NOTE: We can not use 'self.env.cr.dbname' because self is - # ir.mail_server object in old API (osv.osv) - 'odoo_db': self.pool.db_name, + 'odoo_db': self.env.cr.dbname, 'tracking_email_id': tracking_email_id, } headers['X-Mailgun-Variables'] = json.dumps(metadata) diff --git a/mail_tracking_mailgun/models/mail_tracking_email.py b/mail_tracking_mailgun/models/mail_tracking_email.py index f7008ed7..69a96ad1 100644 --- a/mail_tracking_mailgun/models/mail_tracking_email.py +++ b/mail_tracking_mailgun/models/mail_tracking_email.py @@ -5,7 +5,7 @@ import hashlib import hmac from datetime import datetime -from openerp import models, api, fields +from odoo import models, api, fields import logging _logger = logging.getLogger(__name__) diff --git a/mail_tracking_mailgun/tests/test_mailgun.py b/mail_tracking_mailgun/tests/test_mailgun.py index f4ecf16c..f00a0674 100644 --- a/mail_tracking_mailgun/tests/test_mailgun.py +++ b/mail_tracking_mailgun/tests/test_mailgun.py @@ -2,7 +2,7 @@ # Copyright 2016 Antonio Espinosa - # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase class TestMailgun(TransactionCase):