{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/apps-store/pulls/comments/217717568","pull_request_review_id":155485650,"id":217717568,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzcxNzU2OA==","diff_hunk":"@@ -0,0 +1,197 @@\n+# Copyright 2017-2018 BizzAppDev\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+import logging\n+import base64\n+\n+from odoo import http\n+from odoo.http import request\n+from odoo.addons.http_routing.models.ir_http import slug\n+from odoo.addons.website.controllers.main import QueryURL\n+from odoo.addons.website_sale.controllers.main import WebsiteSale, TableCompute\n+\n+_logger = logging.getLogger(__name__)\n+\n+PPG = 20  # Products Per Page\n+PPR = 4   # Products Per Row\n+\n+\n+class WebsiteSaleCustom(WebsiteSale):\n+\n+    def _get_search_domain(self, search, category, attrib_values):\n+        domain = request.website.sale_product_domain()\n+        if search:\n+            for srch in search.split(\" \"):\n+                domain += [\n+                    '|', '|', '|', '|', '|', '|', '|', ('name', 'ilike', srch),\n+                    ('description', 'ilike', srch),\n+                    ('description_sale', 'ilike', srch),\n+                    ('product_variant_ids.default_code', 'ilike', srch),\n+                    ('product_variant_ids.attribute_value_ids.name',\n+                     'ilike', srch),\n+                    ('product_variant_ids.app_description_rst_html',\n+                     'ilike', srch),\n+                    ('product_variant_ids.app_author_ids.name', 'ilike', srch),\n+                    ('product_variant_ids.app_summary', 'ilike', srch)]\n+        if category:\n+            domain += [('public_categ_ids', 'child_of', int(category))]\n+\n+        if attrib_values:\n+            attrib = None\n+            ids = []\n+            for value in attrib_values:\n+                if not attrib:\n+                    attrib = value[0]\n+                    ids.append(value[1])\n+                elif value[0] == attrib:\n+                    ids.append(value[1])\n+                else:\n+                    domain += [('attribute_line_ids.value_ids', 'in', ids)]\n+                    attrib = value[0]\n+                    ids = [value[1]]\n+            if attrib:\n+                domain += [('attribute_line_ids.value_ids', 'in', ids)]\n+\n+        return domain\n+\n+    @http.route([\n+        '/shop',\n+        '/shop/page/<int:page>',\n+        '/shop/category/<model(\"product.public.category\"):category>',\n+        '/shop/category/<model(\"product.public.category\"):category>\\\n+        /page/<int:page>'\n+    ], type='http', auth=\"public\", website=True)\n+    def shop(self, page=0, category=None, search='', ppg=False, **post):\n+        res = super(WebsiteSaleCustom, self).shop(\n+            page=page, category=category, search=search, ppg=ppg, **post)\n+\n+        if ppg:\n+            try:\n+                ppg = int(ppg)\n+            except ValueError:\n+                ppg = PPG\n+            post[\"ppg\"] = ppg\n+        else:\n+            ppg = PPG\n+\n+        attrib_list = request.httprequest.args.getlist('attrib')\n+        attrib_values = [\n+            [int(x) for x in v.split(\"-\")] for v in attrib_list if v]\n+        attributes_ids = {v[0] for v in attrib_values}\n+        attrib_set = {v[1] for v in attrib_values}\n+        domain = self._get_search_domain(search, category, attrib_values)\n+\n+        keep = QueryURL('/shop', category=category and int(category),\n+                        search=search, attrib=attrib_list,\n+                        order=post.get('order'),\n+                        version=post.get('version'), author=post.get('author'))\n+        if post.get('version'):\n+            domain += [('product_variant_ids.attribute_value_ids.id',\n+                        '=', post.get('version'))]\n+        if post.get('author'):\n+            domain += [('product_variant_ids.app_author_ids.id',\n+                        '=', post.get('author'))]\n+\n+        url = \"/shop\"\n+        if category:\n+            category = request.env['product.public.category'].browse(\n+                int(category))\n+            url = \"/shop/category/%s\" % slug(category)\n+\n+        category_all = request.env['product.public.category'].search([])\n+        versions = request.env['product.attribute.value'].search([])","path":"website_apps_store/controllers/main.py","position":102,"original_position":102,"commit_id":"1c9c8984e3def26c98b3fa226653aec60c159bf9","original_commit_id":"1c9c8984e3def26c98b3fa226653aec60c159bf9","user":{"login":"yvaucher","id":4158438,"node_id":"MDQ6VXNlcjQxNTg0Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4158438?v=4","gravatar_id":"","url":"https://api.github.com/users/yvaucher","html_url":"https://github.com/yvaucher","followers_url":"https://api.github.com/users/yvaucher/followers","following_url":"https://api.github.com/users/yvaucher/following{/other_user}","gists_url":"https://api.github.com/users/yvaucher/gists{/gist_id}","starred_url":"https://api.github.com/users/yvaucher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yvaucher/subscriptions","organizations_url":"https://api.github.com/users/yvaucher/orgs","repos_url":"https://api.github.com/users/yvaucher/repos","events_url":"https://api.github.com/users/yvaucher/events{/privacy}","received_events_url":"https://api.github.com/users/yvaucher/received_events","type":"User","site_admin":false},"body":"Shouldn't this be filtered by `attribute_id =  ref('apps_product_creator.attribute_odoo_version')` ? If an other `product.attribute` was created it would be confusing. `product.attribute` can be a lot of things.","created_at":"2018-09-14T13:44:49Z","updated_at":"2018-09-14T13:52:50Z","html_url":"https://github.com/OCA/apps-store/pull/12#discussion_r217717568","pull_request_url":"https://api.github.com/repos/OCA/apps-store/pulls/12","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/comments/217717568"},"html":{"href":"https://github.com/OCA/apps-store/pull/12#discussion_r217717568"},"pull_request":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/apps-store/pulls/12","id":213242377,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMjQyMzc3","html_url":"https://github.com/OCA/apps-store/pull/12","diff_url":"https://github.com/OCA/apps-store/pull/12.diff","patch_url":"https://github.com/OCA/apps-store/pull/12.patch","issue_url":"https://api.github.com/repos/OCA/apps-store/issues/12","number":12,"state":"open","locked":false,"title":"Migration to version 11.0","user":{"login":"bizzappdev","id":4273984,"node_id":"MDQ6VXNlcjQyNzM5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4273984?v=4","gravatar_id":"","url":"https://api.github.com/users/bizzappdev","html_url":"https://github.com/bizzappdev","followers_url":"https://api.github.com/users/bizzappdev/followers","following_url":"https://api.github.com/users/bizzappdev/following{/other_user}","gists_url":"https://api.github.com/users/bizzappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/bizzappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bizzappdev/subscriptions","organizations_url":"https://api.github.com/users/bizzappdev/orgs","repos_url":"https://api.github.com/users/bizzappdev/repos","events_url":"https://api.github.com/users/bizzappdev/events{/privacy}","received_events_url":"https://api.github.com/users/bizzappdev/received_events","type":"User","site_admin":false},"body":"Migration to version 11.0 as per the request at #4 ","created_at":"2018-09-05T10:22:52Z","updated_at":"2018-09-14T13:52:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c23e2dee3802f642b7d7cdebfbcad8343d9ca5f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":708667262,"node_id":"MDU6TGFiZWw3MDg2NjcyNjI=","url":"https://api.github.com/repos/OCA/apps-store/labels/needs%20review","name":"needs review","color":"fbca04","default":false}],"milestone":{"url":"https://api.github.com/repos/OCA/apps-store/milestones/1","html_url":"https://github.com/OCA/apps-store/milestone/1","labels_url":"https://api.github.com/repos/OCA/apps-store/milestones/1/labels","id":2810476,"node_id":"MDk6TWlsZXN0b25lMjgxMDQ3Ng==","number":1,"title":"11.0","description":null,"creator":{"login":"pedrobaeza","id":7165771,"node_id":"MDQ6VXNlcjcxNjU3NzE=","avatar_url":"https://avatars2.githubusercontent.com/u/7165771?v=4","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":2,"closed_issues":1,"state":"open","created_at":"2017-10-03T13:59:36Z","updated_at":"2018-09-05T10:29:51Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/apps-store/pulls/12/commits","review_comments_url":"https://api.github.com/repos/OCA/apps-store/pulls/12/comments","review_comment_url":"https://api.github.com/repos/OCA/apps-store/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/apps-store/issues/12/comments","statuses_url":"https://api.github.com/repos/OCA/apps-store/statuses/1c9c8984e3def26c98b3fa226653aec60c159bf9","head":{"label":"bizzappdev:11.0-migration-apps-store","ref":"11.0-migration-apps-store","sha":"1c9c8984e3def26c98b3fa226653aec60c159bf9","user":{"login":"bizzappdev","id":4273984,"node_id":"MDQ6VXNlcjQyNzM5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4273984?v=4","gravatar_id":"","url":"https://api.github.com/users/bizzappdev","html_url":"https://github.com/bizzappdev","followers_url":"https://api.github.com/users/bizzappdev/followers","following_url":"https://api.github.com/users/bizzappdev/following{/other_user}","gists_url":"https://api.github.com/users/bizzappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/bizzappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bizzappdev/subscriptions","organizations_url":"https://api.github.com/users/bizzappdev/orgs","repos_url":"https://api.github.com/users/bizzappdev/repos","events_url":"https://api.github.com/users/bizzappdev/events{/privacy}","received_events_url":"https://api.github.com/users/bizzappdev/received_events","type":"User","site_admin":false},"repo":{"id":105533472,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU1MzM0NzI=","name":"apps-store","full_name":"bizzappdev/apps-store","owner":{"login":"bizzappdev","id":4273984,"node_id":"MDQ6VXNlcjQyNzM5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4273984?v=4","gravatar_id":"","url":"https://api.github.com/users/bizzappdev","html_url":"https://github.com/bizzappdev","followers_url":"https://api.github.com/users/bizzappdev/followers","following_url":"https://api.github.com/users/bizzappdev/following{/other_user}","gists_url":"https://api.github.com/users/bizzappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/bizzappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bizzappdev/subscriptions","organizations_url":"https://api.github.com/users/bizzappdev/orgs","repos_url":"https://api.github.com/users/bizzappdev/repos","events_url":"https://api.github.com/users/bizzappdev/events{/privacy}","received_events_url":"https://api.github.com/users/bizzappdev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bizzappdev/apps-store","description":"OCA Apps store module repository","fork":true,"url":"https://api.github.com/repos/bizzappdev/apps-store","forks_url":"https://api.github.com/repos/bizzappdev/apps-store/forks","keys_url":"https://api.github.com/repos/bizzappdev/apps-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bizzappdev/apps-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bizzappdev/apps-store/teams","hooks_url":"https://api.github.com/repos/bizzappdev/apps-store/hooks","issue_events_url":"https://api.github.com/repos/bizzappdev/apps-store/issues/events{/number}","events_url":"https://api.github.com/repos/bizzappdev/apps-store/events","assignees_url":"https://api.github.com/repos/bizzappdev/apps-store/assignees{/user}","branches_url":"https://api.github.com/repos/bizzappdev/apps-store/branches{/branch}","tags_url":"https://api.github.com/repos/bizzappdev/apps-store/tags","blobs_url":"https://api.github.com/repos/bizzappdev/apps-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bizzappdev/apps-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bizzappdev/apps-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/bizzappdev/apps-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bizzappdev/apps-store/statuses/{sha}","languages_url":"https://api.github.com/repos/bizzappdev/apps-store/languages","stargazers_url":"https://api.github.com/repos/bizzappdev/apps-store/stargazers","contributors_url":"https://api.github.com/repos/bizzappdev/apps-store/contributors","subscribers_url":"https://api.github.com/repos/bizzappdev/apps-store/subscribers","subscription_url":"https://api.github.com/repos/bizzappdev/apps-store/subscription","commits_url":"https://api.github.com/repos/bizzappdev/apps-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/bizzappdev/apps-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/bizzappdev/apps-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/bizzappdev/apps-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/bizzappdev/apps-store/contents/{+path}","compare_url":"https://api.github.com/repos/bizzappdev/apps-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bizzappdev/apps-store/merges","archive_url":"https://api.github.com/repos/bizzappdev/apps-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bizzappdev/apps-store/downloads","issues_url":"https://api.github.com/repos/bizzappdev/apps-store/issues{/number}","pulls_url":"https://api.github.com/repos/bizzappdev/apps-store/pulls{/number}","milestones_url":"https://api.github.com/repos/bizzappdev/apps-store/milestones{/number}","notifications_url":"https://api.github.com/repos/bizzappdev/apps-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bizzappdev/apps-store/labels{/name}","releases_url":"https://api.github.com/repos/bizzappdev/apps-store/releases{/id}","deployments_url":"https://api.github.com/repos/bizzappdev/apps-store/deployments","created_at":"2017-10-02T12:48:50Z","updated_at":"2018-08-16T05:05:51Z","pushed_at":"2018-09-06T10:12:04Z","git_url":"git://github.com/bizzappdev/apps-store.git","ssh_url":"git@github.com:bizzappdev/apps-store.git","clone_url":"https://github.com/bizzappdev/apps-store.git","svn_url":"https://github.com/bizzappdev/apps-store","homepage":null,"size":1701,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":2,"open_issues":0,"watchers":1,"default_branch":"10.0"}},"base":{"label":"OCA:11.0","ref":"11.0","sha":"dfa5542a78acc985fd5e515f334562624e20047f","user":{"login":"OCA","id":7600578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MDA1Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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":105530654,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU1MzA2NTQ=","name":"apps-store","full_name":"OCA/apps-store","owner":{"login":"OCA","id":7600578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MDA1Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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/apps-store","description":"OCA Apps store module repository","fork":false,"url":"https://api.github.com/repos/OCA/apps-store","forks_url":"https://api.github.com/repos/OCA/apps-store/forks","keys_url":"https://api.github.com/repos/OCA/apps-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/apps-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/apps-store/teams","hooks_url":"https://api.github.com/repos/OCA/apps-store/hooks","issue_events_url":"https://api.github.com/repos/OCA/apps-store/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/apps-store/events","assignees_url":"https://api.github.com/repos/OCA/apps-store/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/apps-store/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/apps-store/tags","blobs_url":"https://api.github.com/repos/OCA/apps-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/apps-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/apps-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/apps-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/apps-store/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/apps-store/languages","stargazers_url":"https://api.github.com/repos/OCA/apps-store/stargazers","contributors_url":"https://api.github.com/repos/OCA/apps-store/contributors","subscribers_url":"https://api.github.com/repos/OCA/apps-store/subscribers","subscription_url":"https://api.github.com/repos/OCA/apps-store/subscription","commits_url":"https://api.github.com/repos/OCA/apps-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/apps-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/apps-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/apps-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/apps-store/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/apps-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/apps-store/merges","archive_url":"https://api.github.com/repos/OCA/apps-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/apps-store/downloads","issues_url":"https://api.github.com/repos/OCA/apps-store/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/apps-store/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/apps-store/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/apps-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/apps-store/labels{/name}","releases_url":"https://api.github.com/repos/OCA/apps-store/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/apps-store/deployments","created_at":"2017-10-02T12:17:26Z","updated_at":"2018-08-27T04:51:52Z","pushed_at":"2018-09-06T10:12:06Z","git_url":"git://github.com/OCA/apps-store.git","ssh_url":"git@github.com:OCA/apps-store.git","clone_url":"https://github.com/OCA/apps-store.git","svn_url":"https://github.com/OCA/apps-store","homepage":null,"size":156,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":15,"open_issues":4,"watchers":11,"default_branch":"11.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/12"},"html":{"href":"https://github.com/OCA/apps-store/pull/12"},"issue":{"href":"https://api.github.com/repos/OCA/apps-store/issues/12"},"comments":{"href":"https://api.github.com/repos/OCA/apps-store/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/apps-store/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/apps-store/statuses/1c9c8984e3def26c98b3fa226653aec60c159bf9"}},"author_association":"NONE"}}
{"actor":{"display_login":"yvaucher"}}