{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/website/pulls/comments/87760123","pull_request_review_id":8358303,"id":87760123,"diff_hunk":"@@ -0,0 +1,35 @@\n+# -*- coding: utf-8 -*-\n+# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)\n+#        Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\n+# © 2015 Antiun Ingeniería S.L. - Jairo Llopis\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+import base64\n+from openerp import api, models\n+\n+\n+class Image(models.Model):\n+    _inherit = \"base_multi_image.image\"\n+\n+    @api.model\n+    def get_images_to_add(self, post, model_name):\n+        \"\"\"\n+        @param post: dict with images in format 'new_image_xxx'\n+        @param model_name: Model to store image\n+        @return: List of images to add\n+        \"\"\"\n+        images_to_add = []\n+        for key in post.keys():\n+            if 'new_image_' in key:\n+                if isinstance(post[key], list):\n+                    new_image = post[key][0]\n+                else:\n+                    new_image = post[key]\n+                images_to_add.append((0, 0, {\n+                    'storage': 'db',\n+                    'file_db_store': base64.encodestring(new_image.read()),\n+                    'owner_model': model_name,\n+                    'name': new_image.filename,\n+                    'extension': 'jpg',","path":"website_base_multi_image/models/image.py","position":31,"original_position":33,"commit_id":"67f1d369ba5c930528bb78dffbf9d9bbea3d6886","original_commit_id":"2ebdc95fede5f0dbeb9f72ba9c5c9b81af10360a","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"body":"I think @lasley means that you should guess the mimetype from the incoming bytes and then choose the right extension instead of hardcoding `jpg`, right?","created_at":"2016-11-14T09:08:42Z","updated_at":"2016-11-14T09:22:18Z","html_url":"https://github.com/OCA/website/pull/252#discussion_r87760123","pull_request_url":"https://api.github.com/repos/OCA/website/pulls/252","_links":{"self":{"href":"https://api.github.com/repos/OCA/website/pulls/comments/87760123"},"html":{"href":"https://github.com/OCA/website/pull/252#discussion_r87760123"},"pull_request":{"href":"https://api.github.com/repos/OCA/website/pulls/252"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/website/pulls/252","id":84281560,"html_url":"https://github.com/OCA/website/pull/252","diff_url":"https://github.com/OCA/website/pull/252.diff","patch_url":"https://github.com/OCA/website/pull/252.patch","issue_url":"https://api.github.com/repos/OCA/website/issues/252","number":252,"state":"open","locked":false,"title":"[WIP] 9.0 website_base_multi_image","user":{"login":"sergio-teruel","id":7689807,"avatar_url":"https://avatars.githubusercontent.com/u/7689807?v=3","gravatar_id":"","url":"https://api.github.com/users/sergio-teruel","html_url":"https://github.com/sergio-teruel","followers_url":"https://api.github.com/users/sergio-teruel/followers","following_url":"https://api.github.com/users/sergio-teruel/following{/other_user}","gists_url":"https://api.github.com/users/sergio-teruel/gists{/gist_id}","starred_url":"https://api.github.com/users/sergio-teruel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergio-teruel/subscriptions","organizations_url":"https://api.github.com/users/sergio-teruel/orgs","repos_url":"https://api.github.com/users/sergio-teruel/repos","events_url":"https://api.github.com/users/sergio-teruel/events{/privacy}","received_events_url":"https://api.github.com/users/sergio-teruel/received_events","type":"User","site_admin":false},"body":"This module extends the functionality of 'base_multi_image' module to show winery data in website\n\nPort from v8\n\n@Tecnativa\n","created_at":"2016-09-07T11:17:55Z","updated_at":"2016-11-14T09:22:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c197e7fcd8cd470ec36a27ce32989fec0d2dd685","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OCA/website/milestones/2","html_url":"https://github.com/OCA/website/milestones/9.0","labels_url":"https://api.github.com/repos/OCA/website/milestones/2/labels","id":1354424,"number":2,"title":"9.0","description":null,"creator":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":25,"state":"open","created_at":"2015-10-14T00:57:26Z","updated_at":"2016-11-12T01:01:50Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/website/pulls/252/commits","review_comments_url":"https://api.github.com/repos/OCA/website/pulls/252/comments","review_comment_url":"https://api.github.com/repos/OCA/website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/website/issues/252/comments","statuses_url":"https://api.github.com/repos/OCA/website/statuses/67f1d369ba5c930528bb78dffbf9d9bbea3d6886","head":{"label":"Tecnativa:9.0-PR-website_base_multi_image","ref":"9.0-PR-website_base_multi_image","sha":"67f1d369ba5c930528bb78dffbf9d9bbea3d6886","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":56678590,"name":"website","full_name":"Tecnativa/website","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/website","description":"Odoo website builder addons","fork":true,"url":"https://api.github.com/repos/Tecnativa/website","forks_url":"https://api.github.com/repos/Tecnativa/website/forks","keys_url":"https://api.github.com/repos/Tecnativa/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/website/teams","hooks_url":"https://api.github.com/repos/Tecnativa/website/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/website/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/website/events","assignees_url":"https://api.github.com/repos/Tecnativa/website/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/website/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/website/tags","blobs_url":"https://api.github.com/repos/Tecnativa/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/website/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/website/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/website/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/website/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/website/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/website/subscription","commits_url":"https://api.github.com/repos/Tecnativa/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/website/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/website/merges","archive_url":"https://api.github.com/repos/Tecnativa/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/website/downloads","issues_url":"https://api.github.com/repos/Tecnativa/website/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/website/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/website/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/website/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/website/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/website/deployments","created_at":"2016-04-20T10:40:00Z","updated_at":"2016-11-09T22:12:17Z","pushed_at":"2016-11-11T16:28:32Z","git_url":"git://github.com/Tecnativa/website.git","ssh_url":"git@github.com:Tecnativa/website.git","clone_url":"https://github.com/Tecnativa/website.git","svn_url":"https://github.com/Tecnativa/website","homepage":"","size":10277,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"9.0"}},"base":{"label":"OCA:9.0","ref":"9.0","sha":"4e90eab405c7350c35ca61ecd56a4968449394d8","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":21942491,"name":"website","full_name":"OCA/website","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/website","description":"Odoo website builder addons","fork":false,"url":"https://api.github.com/repos/OCA/website","forks_url":"https://api.github.com/repos/OCA/website/forks","keys_url":"https://api.github.com/repos/OCA/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/website/teams","hooks_url":"https://api.github.com/repos/OCA/website/hooks","issue_events_url":"https://api.github.com/repos/OCA/website/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/website/events","assignees_url":"https://api.github.com/repos/OCA/website/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/website/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/website/tags","blobs_url":"https://api.github.com/repos/OCA/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/website/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/website/languages","stargazers_url":"https://api.github.com/repos/OCA/website/stargazers","contributors_url":"https://api.github.com/repos/OCA/website/contributors","subscribers_url":"https://api.github.com/repos/OCA/website/subscribers","subscription_url":"https://api.github.com/repos/OCA/website/subscription","commits_url":"https://api.github.com/repos/OCA/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/website/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/website/merges","archive_url":"https://api.github.com/repos/OCA/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/website/downloads","issues_url":"https://api.github.com/repos/OCA/website/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/website/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/website/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/website/labels{/name}","releases_url":"https://api.github.com/repos/OCA/website/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/website/deployments","created_at":"2014-07-17T13:16:54Z","updated_at":"2016-11-12T23:29:49Z","pushed_at":"2016-11-14T09:13:02Z","git_url":"git://github.com/OCA/website.git","ssh_url":"git@github.com:OCA/website.git","clone_url":"https://github.com/OCA/website.git","svn_url":"https://github.com/OCA/website","homepage":"","size":20484,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":55,"forks":192,"open_issues":55,"watchers":51,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/website/pulls/252"},"html":{"href":"https://github.com/OCA/website/pull/252"},"issue":{"href":"https://api.github.com/repos/OCA/website/issues/252"},"comments":{"href":"https://api.github.com/repos/OCA/website/issues/252/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/website/pulls/252/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/website/pulls/252/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/website/statuses/67f1d369ba5c930528bb78dffbf9d9bbea3d6886"}}}}
{"actor":{"display_login":"Yajo"}}