{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/web/pulls/comments/70757589","id":70757589,"diff_hunk":"@@ -104,4 +103,67 @@ openerp.web_widget_mail_send_odoo = function(instance) {\n \n     instance.web.form.widgets.add('email_mailto', 'instance.web.form.FieldEmail')\n     instance.web.form.widgets.add('email', 'instance.web.form.FieldEmailIntern')\n+\n+    instance.web_kanban.FieldEmailInternKanban = instance.web_kanban.AbstractField.extend({\n+        init: function(parent, field, $node) {\n+            this.parent = parent;\n+            this._super.apply(this, arguments);\n+            this.format_descriptor = _.extend({}, this.field, {'widget': this.$node.attr('widget')});\n+        },\n+        is_syntax_valid: function(){\n+            var self = this;\n+            var value = self.get('value');\n+            if (value) {\n+                try {\n+                    var parsed_email = instance.mail.ChatterUtils.parse_email(value);\n+                    if(!parsed_email[1])\n+                        return false;\n+                    return true;\n+                } catch(e) {\n+                    return false;\n+                }\n+            }\n+            return true;\n+        },\n+        on_clicked: function() {\n+            console.log(\"Kanban Email Widget ---- Click\");\n+            var self = this;\n+            if (!self.is_syntax_valid()) {\n+                self.do_warn(_t(\"E-mail Error\"), _t(\"Can't send email to invalid e-mail address\"));\n+            } else {\n+                // find partner id for email\n+                var res_partner = new openerp.Model('res.partner');\n+                var parsed_email = instance.mail.ChatterUtils.parse_email(self.get('value'));\n+                res_partner.query(['id'])\n+                    .filter([['email', '=', parsed_email[1]]])\n+                    .first().then(function(partner){\n+                        if(partner){\n+                            self.do_action(\n+                                'mail.action_email_compose_message_wizard', {\n+                                    additional_context: {\n+                                        default_partner_ids: [partner.id],\n+                                        default_composition_mode: 'comment',\n+                                        // write to active model:\n+                                        default_model: self.parent.view.dataset.model,\n+                                        default_res_id: self.parent.id,\n+                                    },\n+                                }\n+                            );\n+                        } else {\n+                            self.do_warn(_t(\"E-mail Error\"),\n+                            _t(\"Can't send email:  No partner configured for email address.\"));\n+                        }\n+                    })\n+            }\n+        },\n+        renderElement: function() {","path":"web_widget_mail_send_odoo/static/src/js/web_widget_mail_send_odoo.js","position":65,"original_position":65,"commit_id":"b51c675a60539b4cfef410540b2b5a5ad49aa928","original_commit_id":"b51c675a60539b4cfef410540b2b5a5ad49aa928","user":{"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},"body":"better use a qweb template and attach your handler in the events dictionary as in https://github.com/OCA/server-tools/pull/480/files#diff-9de652377e95844f51139004242e0cfcR10 - then the framework takes care of this, you can remove the whole function and make the addon simpler to customize","created_at":"2016-07-14T07:06:37Z","updated_at":"2016-07-14T07:06:37Z","html_url":"https://github.com/OCA/web/pull/363#discussion_r70757589","pull_request_url":"https://api.github.com/repos/OCA/web/pulls/363","_links":{"self":{"href":"https://api.github.com/repos/OCA/web/pulls/comments/70757589"},"html":{"href":"https://github.com/OCA/web/pull/363#discussion_r70757589"},"pull_request":{"href":"https://api.github.com/repos/OCA/web/pulls/363"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/web/pulls/363","id":71369219,"html_url":"https://github.com/OCA/web/pull/363","diff_url":"https://github.com/OCA/web/pull/363.diff","patch_url":"https://github.com/OCA/web/pull/363.patch","issue_url":"https://api.github.com/repos/OCA/web/issues/363","number":363,"state":"open","locked":false,"title":"[IMP] Send mail internally for email links in kanban records","user":{"login":"codingforfun","id":1388003,"avatar_url":"https://avatars.githubusercontent.com/u/1388003?v=3","gravatar_id":"","url":"https://api.github.com/users/codingforfun","html_url":"https://github.com/codingforfun","followers_url":"https://api.github.com/users/codingforfun/followers","following_url":"https://api.github.com/users/codingforfun/following{/other_user}","gists_url":"https://api.github.com/users/codingforfun/gists{/gist_id}","starred_url":"https://api.github.com/users/codingforfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingforfun/subscriptions","organizations_url":"https://api.github.com/users/codingforfun/orgs","repos_url":"https://api.github.com/users/codingforfun/repos","events_url":"https://api.github.com/users/codingforfun/events{/privacy}","received_events_url":"https://api.github.com/users/codingforfun/received_events","type":"User","site_admin":false},"body":"Extend for email fields in kanban records (especially for res.partner)","created_at":"2016-05-25T10:48:35Z","updated_at":"2016-07-14T07:06:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2328578af062d9355aec1c933ea886c78bc08691","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OCA/web/milestones/3","html_url":"https://github.com/OCA/web/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/web/milestones/3/labels","id":819641,"number":3,"title":"8.0","description":"","creator":{"login":"legalsylvain","id":3407482,"avatar_url":"https://avatars.githubusercontent.com/u/3407482?v=3","gravatar_id":"","url":"https://api.github.com/users/legalsylvain","html_url":"https://github.com/legalsylvain","followers_url":"https://api.github.com/users/legalsylvain/followers","following_url":"https://api.github.com/users/legalsylvain/following{/other_user}","gists_url":"https://api.github.com/users/legalsylvain/gists{/gist_id}","starred_url":"https://api.github.com/users/legalsylvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legalsylvain/subscriptions","organizations_url":"https://api.github.com/users/legalsylvain/orgs","repos_url":"https://api.github.com/users/legalsylvain/repos","events_url":"https://api.github.com/users/legalsylvain/events{/privacy}","received_events_url":"https://api.github.com/users/legalsylvain/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":101,"state":"open","created_at":"2014-10-09T10:16:30Z","updated_at":"2016-07-04T10:24:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/web/pulls/363/commits","review_comments_url":"https://api.github.com/repos/OCA/web/pulls/363/comments","review_comment_url":"https://api.github.com/repos/OCA/web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/web/issues/363/comments","statuses_url":"https://api.github.com/repos/OCA/web/statuses/b51c675a60539b4cfef410540b2b5a5ad49aa928","head":{"label":"initOS:8.0-web-mail-send-intern-kanban","ref":"8.0-web-mail-send-intern-kanban","sha":"b51c675a60539b4cfef410540b2b5a5ad49aa928","user":{"login":"initOS","id":4948110,"avatar_url":"https://avatars.githubusercontent.com/u/4948110?v=3","gravatar_id":"","url":"https://api.github.com/users/initOS","html_url":"https://github.com/initOS","followers_url":"https://api.github.com/users/initOS/followers","following_url":"https://api.github.com/users/initOS/following{/other_user}","gists_url":"https://api.github.com/users/initOS/gists{/gist_id}","starred_url":"https://api.github.com/users/initOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initOS/subscriptions","organizations_url":"https://api.github.com/users/initOS/orgs","repos_url":"https://api.github.com/users/initOS/repos","events_url":"https://api.github.com/users/initOS/events{/privacy}","received_events_url":"https://api.github.com/users/initOS/received_events","type":"Organization","site_admin":false},"repo":{"id":24058779,"name":"web","full_name":"initOS/web","owner":{"login":"initOS","id":4948110,"avatar_url":"https://avatars.githubusercontent.com/u/4948110?v=3","gravatar_id":"","url":"https://api.github.com/users/initOS","html_url":"https://github.com/initOS","followers_url":"https://api.github.com/users/initOS/followers","following_url":"https://api.github.com/users/initOS/following{/other_user}","gists_url":"https://api.github.com/users/initOS/gists{/gist_id}","starred_url":"https://api.github.com/users/initOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initOS/subscriptions","organizations_url":"https://api.github.com/users/initOS/orgs","repos_url":"https://api.github.com/users/initOS/repos","events_url":"https://api.github.com/users/initOS/events{/privacy}","received_events_url":"https://api.github.com/users/initOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/initOS/web","description":"","fork":true,"url":"https://api.github.com/repos/initOS/web","forks_url":"https://api.github.com/repos/initOS/web/forks","keys_url":"https://api.github.com/repos/initOS/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/initOS/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/initOS/web/teams","hooks_url":"https://api.github.com/repos/initOS/web/hooks","issue_events_url":"https://api.github.com/repos/initOS/web/issues/events{/number}","events_url":"https://api.github.com/repos/initOS/web/events","assignees_url":"https://api.github.com/repos/initOS/web/assignees{/user}","branches_url":"https://api.github.com/repos/initOS/web/branches{/branch}","tags_url":"https://api.github.com/repos/initOS/web/tags","blobs_url":"https://api.github.com/repos/initOS/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/initOS/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/initOS/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/initOS/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/initOS/web/statuses/{sha}","languages_url":"https://api.github.com/repos/initOS/web/languages","stargazers_url":"https://api.github.com/repos/initOS/web/stargazers","contributors_url":"https://api.github.com/repos/initOS/web/contributors","subscribers_url":"https://api.github.com/repos/initOS/web/subscribers","subscription_url":"https://api.github.com/repos/initOS/web/subscription","commits_url":"https://api.github.com/repos/initOS/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/initOS/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/initOS/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/initOS/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/initOS/web/contents/{+path}","compare_url":"https://api.github.com/repos/initOS/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/initOS/web/merges","archive_url":"https://api.github.com/repos/initOS/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/initOS/web/downloads","issues_url":"https://api.github.com/repos/initOS/web/issues{/number}","pulls_url":"https://api.github.com/repos/initOS/web/pulls{/number}","milestones_url":"https://api.github.com/repos/initOS/web/milestones{/number}","notifications_url":"https://api.github.com/repos/initOS/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/initOS/web/labels{/name}","releases_url":"https://api.github.com/repos/initOS/web/releases{/id}","deployments_url":"https://api.github.com/repos/initOS/web/deployments","created_at":"2014-09-15T14:08:34Z","updated_at":"2015-06-04T22:33:44Z","pushed_at":"2016-06-24T10:05:39Z","git_url":"git://github.com/initOS/web.git","ssh_url":"git@github.com:initOS/web.git","clone_url":"https://github.com/initOS/web.git","svn_url":"https://github.com/initOS/web","homepage":null,"size":7266,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"8.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"3f947ac8c5a60e2f6fa9641c2f72faf69ab9d987","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":20895915,"name":"web","full_name":"OCA/web","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/web","description":"Odoo web client UI related addons","fork":false,"url":"https://api.github.com/repos/OCA/web","forks_url":"https://api.github.com/repos/OCA/web/forks","keys_url":"https://api.github.com/repos/OCA/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/web/teams","hooks_url":"https://api.github.com/repos/OCA/web/hooks","issue_events_url":"https://api.github.com/repos/OCA/web/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/web/events","assignees_url":"https://api.github.com/repos/OCA/web/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/web/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/web/tags","blobs_url":"https://api.github.com/repos/OCA/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/web/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/web/languages","stargazers_url":"https://api.github.com/repos/OCA/web/stargazers","contributors_url":"https://api.github.com/repos/OCA/web/contributors","subscribers_url":"https://api.github.com/repos/OCA/web/subscribers","subscription_url":"https://api.github.com/repos/OCA/web/subscription","commits_url":"https://api.github.com/repos/OCA/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/web/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/web/merges","archive_url":"https://api.github.com/repos/OCA/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/web/downloads","issues_url":"https://api.github.com/repos/OCA/web/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/web/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/web/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/web/labels{/name}","releases_url":"https://api.github.com/repos/OCA/web/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/web/deployments","created_at":"2014-06-16T18:34:12Z","updated_at":"2016-07-11T22:48:47Z","pushed_at":"2016-07-14T06:31:13Z","git_url":"git://github.com/OCA/web.git","ssh_url":"git@github.com:OCA/web.git","clone_url":"https://github.com/OCA/web.git","svn_url":"https://github.com/OCA/web","homepage":"","size":14498,"stargazers_count":102,"watchers_count":102,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"open_issues_count":91,"forks":291,"open_issues":91,"watchers":102,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/web/pulls/363"},"html":{"href":"https://github.com/OCA/web/pull/363"},"issue":{"href":"https://api.github.com/repos/OCA/web/issues/363"},"comments":{"href":"https://api.github.com/repos/OCA/web/issues/363/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/web/pulls/363/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/web/pulls/363/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/web/statuses/b51c675a60539b4cfef410540b2b5a5ad49aa928"}}}}
{"actor":{"display_login":"hbrunn"}}