{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/social/pulls/comments/66581005","id":66581005,"diff_hunk":"@@ -0,0 +1,165 @@\n+# -*- coding: utf-8 -*-\n+# © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+import logging\n+import urlparse\n+import time\n+from datetime import datetime\n+\n+from openerp import models, api, fields, tools\n+import openerp.addons.decimal_precision as dp\n+\n+_logger = logging.getLogger(__name__)\n+\n+\n+class MailTrackingEmail(models.Model):\n+    _name = \"mail.tracking.email\"\n+    _order = 'time desc'\n+    _rec_name = 'name'\n+    _description = 'MailTracking email'\n+\n+    name = fields.Char(string=\"Subject\", readonly=True)\n+    timestamp = fields.Float(\n+        string='UTC timestamp', readonly=True,\n+        digits=dp.get_precision('MailTracking Timestamp'))\n+    time = fields.Datetime(string=\"Time\", readonly=True)\n+    date = fields.Date(string=\"Date\", readonly=True)\n+    mail_message_id = fields.Many2one(\n+        string=\"Message\", comodel_name='mail.message', readonly=True)\n+    mail_id = fields.Many2one(\n+        string=\"Email\", comodel_name='mail.mail', readonly=True)\n+    partner_id = fields.Many2one(\n+        string=\"Partner\", comodel_name='res.partner', readonly=True)\n+    recipient = fields.Char(string='Recipient email', readonly=True)\n+    sender = fields.Char(string='Sender email', readonly=True)\n+    state = fields.Selection([\n+        ('error', 'Error'),\n+        ('deferred', 'Deferred'),\n+        ('sent', 'Sent'),\n+        ('delivered', 'Delivered'),\n+        ('opened', 'Opened'),\n+        ('rejected', 'Rejected'),\n+        ('spam', 'Spam'),\n+        ('unsub', 'Unsubscribed'),\n+        ('bounced', 'Bounced'),\n+        ('soft-bounced', 'Soft bounced'),\n+    ], string='State', index=True, readonly=True, default=False,\n+        help=\" * The 'Error' status indicates that there was an error \"\n+             \"when try to sent the email, for example, 'No valid recipient'\\n\"\n+             \" * The 'Sent' status indicates that message was succesfully \"\n+             \"sent via outgoing email server (SMTP).\\n\"\n+             \" * The 'Delivered' status indicates that message was \"\n+             \"succesfully delivered to recipient Mail Exchange (MX) server.\\n\"\n+             \" * The 'Opened' status indicates that message was opened or \"\n+             \"clicked by recipient.\\n\"\n+             \" * The 'Rejected' status indicates that recipient email \"\n+             \"address is blacklisted by outgoing email server (SMTP). \"\n+             \"It is recomended to delete this email address.\\n\"\n+             \" * The 'Spam' status indicates that outgoing email \"\n+             \"server (SMTP) consider this message as spam.\\n\"\n+             \" * The 'Unsubscribed' status indicates that recipient has \"\n+             \"requested to be unsubscribed from this message.\\n\"\n+             \" * The 'Bounced' status indicates that message was bounced \"\n+             \"by recipient Mail Exchange (MX) server.\\n\"\n+             \" * The 'Soft bounced' status indicates that message was soft \"\n+             \"bounced by recipient Mail Exchange (MX) server.\\n\")\n+    error_smtp_server = fields.Char(string='Error SMTP server', readonly=True)\n+    error_type = fields.Char(string='Error type', readonly=True)\n+    error_description = fields.Char(\n+        string='Error description', readonly=True)\n+    bounce_type = fields.Char(string='Bounce type', readonly=True)\n+    bounce_description = fields.Char(\n+        string='Bounce description', readonly=True)","path":"mail_tracking/models/mail_tracking_email.py","position":73,"original_position":73,"commit_id":"129ed1ba89cff54fcee0ab538f2c20093031cea5","original_commit_id":"129ed1ba89cff54fcee0ab538f2c20093031cea5","user":{"login":"antespi","id":1881111,"avatar_url":"https://avatars.githubusercontent.com/u/1881111?v=3","gravatar_id":"","url":"https://api.github.com/users/antespi","html_url":"https://github.com/antespi","followers_url":"https://api.github.com/users/antespi/followers","following_url":"https://api.github.com/users/antespi/following{/other_user}","gists_url":"https://api.github.com/users/antespi/gists{/gist_id}","starred_url":"https://api.github.com/users/antespi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antespi/subscriptions","organizations_url":"https://api.github.com/users/antespi/orgs","repos_url":"https://api.github.com/users/antespi/repos","events_url":"https://api.github.com/users/antespi/events{/privacy}","received_events_url":"https://api.github.com/users/antespi/received_events","type":"User","site_admin":false},"body":"I write it as a good practice","created_at":"2016-06-10T08:51:49Z","updated_at":"2016-06-10T08:51:49Z","html_url":"https://github.com/OCA/social/pull/67#discussion_r66581005","pull_request_url":"https://api.github.com/repos/OCA/social/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/OCA/social/pulls/comments/66581005"},"html":{"href":"https://github.com/OCA/social/pull/67#discussion_r66581005"},"pull_request":{"href":"https://api.github.com/repos/OCA/social/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/social/pulls/67","id":72532684,"html_url":"https://github.com/OCA/social/pull/67","diff_url":"https://github.com/OCA/social/pull/67.diff","patch_url":"https://github.com/OCA/social/pull/67.patch","issue_url":"https://api.github.com/repos/OCA/social/issues/67","number":67,"state":"open","locked":false,"title":"[8.0][ADD] mail_tracking addon","user":{"login":"antespi","id":1881111,"avatar_url":"https://avatars.githubusercontent.com/u/1881111?v=3","gravatar_id":"","url":"https://api.github.com/users/antespi","html_url":"https://github.com/antespi","followers_url":"https://api.github.com/users/antespi/followers","following_url":"https://api.github.com/users/antespi/following{/other_user}","gists_url":"https://api.github.com/users/antespi/gists{/gist_id}","starred_url":"https://api.github.com/users/antespi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antespi/subscriptions","organizations_url":"https://api.github.com/users/antespi/orgs","repos_url":"https://api.github.com/users/antespi/repos","events_url":"https://api.github.com/users/antespi/events{/privacy}","received_events_url":"https://api.github.com/users/antespi/received_events","type":"User","site_admin":false},"body":"Mail tracking\r\n=============\r\n\r\nThis module shows email notification tracking status for any messages in\r\nmail thread (chatter). Each notified partner will have an intuitive icon just\r\nright to his name.\r\n\r\n\r\nConfiguration\r\n=============\r\n\r\nIf you're using a multi-database installation (with or without dbfilter option)\r\nwhere /web/databse/selector returns a list of more than one database, then\r\nyou need to add ``mail_tracking`` addon to wide load addons list\r\n(by default, only ``web`` addon), setting ``--load`` option.\r\nFor example, ``--load=web,mail_tracking``\r\n\r\n\r\nUsage\r\n=====\r\n\r\nWhen user sends a message in mail_thread (chatter), for instance in partner\r\nform, then an email tracking is created for each email notification. Then a\r\nstatus icon will appear just right to name of notified partner.\r\n\r\n\r\n**NOTE**: It is not possible to test functionally this addon because runbot do not send any email. So no email tracking object are created too. \r\n  \r\n@Tecnativa","created_at":"2016-06-03T16:16:44Z","updated_at":"2016-06-10T08:51:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a82065031d0f2315f1b1acf9688d66564de21ae3","assignee":null,"milestone":{"url":"https://api.github.com/repos/OCA/social/milestones/2","html_url":"https://github.com/OCA/social/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/social/milestones/2/labels","id":1421730,"number":2,"title":"8.0","description":"","creator":{"login":"hbrunn","id":2563186,"avatar_url":"https://avatars.githubusercontent.com/u/2563186?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrunn","html_url":"https://github.com/hbrunn","followers_url":"https://api.github.com/users/hbrunn/followers","following_url":"https://api.github.com/users/hbrunn/following{/other_user}","gists_url":"https://api.github.com/users/hbrunn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrunn/subscriptions","organizations_url":"https://api.github.com/users/hbrunn/orgs","repos_url":"https://api.github.com/users/hbrunn/repos","events_url":"https://api.github.com/users/hbrunn/events{/privacy}","received_events_url":"https://api.github.com/users/hbrunn/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":21,"state":"open","created_at":"2015-11-20T13:43:12Z","updated_at":"2016-06-03T16:21:24Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/social/pulls/67/commits","review_comments_url":"https://api.github.com/repos/OCA/social/pulls/67/comments","review_comment_url":"https://api.github.com/repos/OCA/social/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/social/issues/67/comments","statuses_url":"https://api.github.com/repos/OCA/social/statuses/129ed1ba89cff54fcee0ab538f2c20093031cea5","head":{"label":"Tecnativa:8.0-mail_tracking","ref":"8.0-mail_tracking","sha":"129ed1ba89cff54fcee0ab538f2c20093031cea5","user":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars.githubusercontent.com/u/18120193?v=3","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"repo":{"id":57903102,"name":"social","full_name":"Tecnativa/social","owner":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars.githubusercontent.com/u/18120193?v=3","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tecnativa/social","description":"Addons concerning odoo's social ERP features and messaging in general","fork":true,"url":"https://api.github.com/repos/Tecnativa/social","forks_url":"https://api.github.com/repos/Tecnativa/social/forks","keys_url":"https://api.github.com/repos/Tecnativa/social/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/social/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/social/teams","hooks_url":"https://api.github.com/repos/Tecnativa/social/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/social/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/social/events","assignees_url":"https://api.github.com/repos/Tecnativa/social/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/social/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/social/tags","blobs_url":"https://api.github.com/repos/Tecnativa/social/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/social/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/social/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/social/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/social/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/social/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/social/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/social/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/social/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/social/subscription","commits_url":"https://api.github.com/repos/Tecnativa/social/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/social/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/social/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/social/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/social/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/social/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/social/merges","archive_url":"https://api.github.com/repos/Tecnativa/social/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/social/downloads","issues_url":"https://api.github.com/repos/Tecnativa/social/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/social/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/social/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/social/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/social/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/social/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/social/deployments","created_at":"2016-05-02T16:15:37Z","updated_at":"2016-05-02T16:15:38Z","pushed_at":"2016-06-09T13:20:08Z","git_url":"git://github.com/Tecnativa/social.git","ssh_url":"git@github.com:Tecnativa/social.git","clone_url":"https://github.com/Tecnativa/social.git","svn_url":"https://github.com/Tecnativa/social","homepage":"https://odoo-community.org/project/99","size":1293,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"9.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"58f4d929afe344724765fd258b34d5e8d95e29d9","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"repo":{"id":39009740,"name":"social","full_name":"OCA/social","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OCA/social","description":"Addons concerning odoo's social ERP features and messaging in general","fork":false,"url":"https://api.github.com/repos/OCA/social","forks_url":"https://api.github.com/repos/OCA/social/forks","keys_url":"https://api.github.com/repos/OCA/social/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/social/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/social/teams","hooks_url":"https://api.github.com/repos/OCA/social/hooks","issue_events_url":"https://api.github.com/repos/OCA/social/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/social/events","assignees_url":"https://api.github.com/repos/OCA/social/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/social/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/social/tags","blobs_url":"https://api.github.com/repos/OCA/social/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/social/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/social/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/social/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/social/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/social/languages","stargazers_url":"https://api.github.com/repos/OCA/social/stargazers","contributors_url":"https://api.github.com/repos/OCA/social/contributors","subscribers_url":"https://api.github.com/repos/OCA/social/subscribers","subscription_url":"https://api.github.com/repos/OCA/social/subscription","commits_url":"https://api.github.com/repos/OCA/social/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/social/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/social/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/social/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/social/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/social/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/social/merges","archive_url":"https://api.github.com/repos/OCA/social/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/social/downloads","issues_url":"https://api.github.com/repos/OCA/social/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/social/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/social/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/social/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/social/labels{/name}","releases_url":"https://api.github.com/repos/OCA/social/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/social/deployments","created_at":"2015-07-13T12:06:47Z","updated_at":"2016-05-29T21:57:04Z","pushed_at":"2016-06-09T13:20:08Z","git_url":"git://github.com/OCA/social.git","ssh_url":"git@github.com:OCA/social.git","clone_url":"https://github.com/OCA/social.git","svn_url":"https://github.com/OCA/social","homepage":"https://odoo-community.org/project/99","size":1580,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":12,"forks":43,"open_issues":12,"watchers":9,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/social/pulls/67"},"html":{"href":"https://github.com/OCA/social/pull/67"},"issue":{"href":"https://api.github.com/repos/OCA/social/issues/67"},"comments":{"href":"https://api.github.com/repos/OCA/social/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/social/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/social/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/social/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/social/statuses/129ed1ba89cff54fcee0ab538f2c20093031cea5"}}}}
{"actor":{"display_login":"antespi"}}