{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/product-variant/pulls/comments/76237520","id":76237520,"diff_hunk":"@@ -0,0 +1,21 @@\n+# -*- coding: utf-8 -*-\n+# © 2016 Sergio Teruel <sergio.teruel@tecnativa.com>\n+# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n+\n+\n+def set_sale_price_on_variant(cr, registry, template_id=None):\n+    sql = \"\"\"\n+        UPDATE product_product pp\n+        SET fix_price = pt.list_price + (\n+            SELECT COALESCE(SUM(pap.price_extra), 0)\n+            FROM product_attribute_value_product_product_rel pav_pp_rel\n+            LEFT JOIN product_attribute_price pap ON\n+                pap.value_id = pav_pp_rel.att_id\n+            WHERE pav_pp_rel.prod_id = pp.id\n+            AND pap.product_tmpl_id = pt.id\n+        )\n+        FROM product_template pt\n+        WHERE %s;\n+    \"\"\" % ('pt.id = %s AND ' % (template_id if template_id else '') +","path":"product_variant_sale_price/hooks.py","position":19,"original_position":19,"commit_id":"49109fac874863e2abf7b5c524e80c512c13eb8a","original_commit_id":"49109fac874863e2abf7b5c524e80c512c13eb8a","user":{"login":"tafaRU","id":3512779,"avatar_url":"https://avatars.githubusercontent.com/u/3512779?v=3","gravatar_id":"","url":"https://api.github.com/users/tafaRU","html_url":"https://github.com/tafaRU","followers_url":"https://api.github.com/users/tafaRU/followers","following_url":"https://api.github.com/users/tafaRU/following{/other_user}","gists_url":"https://api.github.com/users/tafaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/tafaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafaRU/subscriptions","organizations_url":"https://api.github.com/users/tafaRU/orgs","repos_url":"https://api.github.com/users/tafaRU/repos","events_url":"https://api.github.com/users/tafaRU/events{/privacy}","received_events_url":"https://api.github.com/users/tafaRU/received_events","type":"User","site_admin":false},"body":"@pedrobaeza, I believe that the syntax error happens when template_id is None. In this case it should be used something like ```('p.it is NULL) +```\r\nCoul you please check it again?\r\n\r\nThank you in advance.","created_at":"2016-08-25T13:00:37Z","updated_at":"2016-08-25T13:00:37Z","html_url":"https://github.com/OCA/product-variant/pull/30#discussion_r76237520","pull_request_url":"https://api.github.com/repos/OCA/product-variant/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/comments/76237520"},"html":{"href":"https://github.com/OCA/product-variant/pull/30#discussion_r76237520"},"pull_request":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/product-variant/pulls/30","id":77083109,"html_url":"https://github.com/OCA/product-variant/pull/30","diff_url":"https://github.com/OCA/product-variant/pull/30.diff","patch_url":"https://github.com/OCA/product-variant/pull/30.patch","issue_url":"https://api.github.com/repos/OCA/product-variant/issues/30","number":30,"state":"open","locked":false,"title":"[8.0] Add product_variant_sale_price module","user":{"login":"tafaRU","id":3512779,"avatar_url":"https://avatars.githubusercontent.com/u/3512779?v=3","gravatar_id":"","url":"https://api.github.com/users/tafaRU","html_url":"https://github.com/tafaRU","followers_url":"https://api.github.com/users/tafaRU/followers","following_url":"https://api.github.com/users/tafaRU/following{/other_user}","gists_url":"https://api.github.com/users/tafaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/tafaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafaRU/subscriptions","organizations_url":"https://api.github.com/users/tafaRU/orgs","repos_url":"https://api.github.com/users/tafaRU/repos","events_url":"https://api.github.com/users/tafaRU/events{/privacy}","received_events_url":"https://api.github.com/users/tafaRU/received_events","type":"User","site_admin":false},"body":"The test still needs to be completed, so please set the current PR as WorkInProgress.","created_at":"2016-07-12T08:54:27Z","updated_at":"2016-08-25T13:00:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00b7cbb080de79c89c4a7533f92c945db1e20092","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/product-variant/pulls/30/commits","review_comments_url":"https://api.github.com/repos/OCA/product-variant/pulls/30/comments","review_comment_url":"https://api.github.com/repos/OCA/product-variant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/product-variant/issues/30/comments","statuses_url":"https://api.github.com/repos/OCA/product-variant/statuses/49109fac874863e2abf7b5c524e80c512c13eb8a","head":{"label":"tafaRU:8.0-product_variant_sale_price-add","ref":"8.0-product_variant_sale_price-add","sha":"49109fac874863e2abf7b5c524e80c512c13eb8a","user":{"login":"tafaRU","id":3512779,"avatar_url":"https://avatars.githubusercontent.com/u/3512779?v=3","gravatar_id":"","url":"https://api.github.com/users/tafaRU","html_url":"https://github.com/tafaRU","followers_url":"https://api.github.com/users/tafaRU/followers","following_url":"https://api.github.com/users/tafaRU/following{/other_user}","gists_url":"https://api.github.com/users/tafaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/tafaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafaRU/subscriptions","organizations_url":"https://api.github.com/users/tafaRU/orgs","repos_url":"https://api.github.com/users/tafaRU/repos","events_url":"https://api.github.com/users/tafaRU/events{/privacy}","received_events_url":"https://api.github.com/users/tafaRU/received_events","type":"User","site_admin":false},"repo":{"id":50116663,"name":"product-variant","full_name":"tafaRU/product-variant","owner":{"login":"tafaRU","id":3512779,"avatar_url":"https://avatars.githubusercontent.com/u/3512779?v=3","gravatar_id":"","url":"https://api.github.com/users/tafaRU","html_url":"https://github.com/tafaRU","followers_url":"https://api.github.com/users/tafaRU/followers","following_url":"https://api.github.com/users/tafaRU/following{/other_user}","gists_url":"https://api.github.com/users/tafaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/tafaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tafaRU/subscriptions","organizations_url":"https://api.github.com/users/tafaRU/orgs","repos_url":"https://api.github.com/users/tafaRU/repos","events_url":"https://api.github.com/users/tafaRU/events{/privacy}","received_events_url":"https://api.github.com/users/tafaRU/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tafaRU/product-variant","description":"","fork":true,"url":"https://api.github.com/repos/tafaRU/product-variant","forks_url":"https://api.github.com/repos/tafaRU/product-variant/forks","keys_url":"https://api.github.com/repos/tafaRU/product-variant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tafaRU/product-variant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tafaRU/product-variant/teams","hooks_url":"https://api.github.com/repos/tafaRU/product-variant/hooks","issue_events_url":"https://api.github.com/repos/tafaRU/product-variant/issues/events{/number}","events_url":"https://api.github.com/repos/tafaRU/product-variant/events","assignees_url":"https://api.github.com/repos/tafaRU/product-variant/assignees{/user}","branches_url":"https://api.github.com/repos/tafaRU/product-variant/branches{/branch}","tags_url":"https://api.github.com/repos/tafaRU/product-variant/tags","blobs_url":"https://api.github.com/repos/tafaRU/product-variant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tafaRU/product-variant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tafaRU/product-variant/git/refs{/sha}","trees_url":"https://api.github.com/repos/tafaRU/product-variant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tafaRU/product-variant/statuses/{sha}","languages_url":"https://api.github.com/repos/tafaRU/product-variant/languages","stargazers_url":"https://api.github.com/repos/tafaRU/product-variant/stargazers","contributors_url":"https://api.github.com/repos/tafaRU/product-variant/contributors","subscribers_url":"https://api.github.com/repos/tafaRU/product-variant/subscribers","subscription_url":"https://api.github.com/repos/tafaRU/product-variant/subscription","commits_url":"https://api.github.com/repos/tafaRU/product-variant/commits{/sha}","git_commits_url":"https://api.github.com/repos/tafaRU/product-variant/git/commits{/sha}","comments_url":"https://api.github.com/repos/tafaRU/product-variant/comments{/number}","issue_comment_url":"https://api.github.com/repos/tafaRU/product-variant/issues/comments{/number}","contents_url":"https://api.github.com/repos/tafaRU/product-variant/contents/{+path}","compare_url":"https://api.github.com/repos/tafaRU/product-variant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tafaRU/product-variant/merges","archive_url":"https://api.github.com/repos/tafaRU/product-variant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tafaRU/product-variant/downloads","issues_url":"https://api.github.com/repos/tafaRU/product-variant/issues{/number}","pulls_url":"https://api.github.com/repos/tafaRU/product-variant/pulls{/number}","milestones_url":"https://api.github.com/repos/tafaRU/product-variant/milestones{/number}","notifications_url":"https://api.github.com/repos/tafaRU/product-variant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tafaRU/product-variant/labels{/name}","releases_url":"https://api.github.com/repos/tafaRU/product-variant/releases{/id}","deployments_url":"https://api.github.com/repos/tafaRU/product-variant/deployments","created_at":"2016-01-21T15:30:07Z","updated_at":"2016-01-21T15:30:08Z","pushed_at":"2016-08-23T14:43:20Z","git_url":"git://github.com/tafaRU/product-variant.git","ssh_url":"git@github.com:tafaRU/product-variant.git","clone_url":"https://github.com/tafaRU/product-variant.git","svn_url":"https://github.com/tafaRU/product-variant","homepage":null,"size":1166,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"9.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"d6fb6f0f989e981b4330a85c7b373dc577c3a8bc","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":20894678,"name":"product-variant","full_name":"OCA/product-variant","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/product-variant","description":"","fork":false,"url":"https://api.github.com/repos/OCA/product-variant","forks_url":"https://api.github.com/repos/OCA/product-variant/forks","keys_url":"https://api.github.com/repos/OCA/product-variant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/product-variant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/product-variant/teams","hooks_url":"https://api.github.com/repos/OCA/product-variant/hooks","issue_events_url":"https://api.github.com/repos/OCA/product-variant/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/product-variant/events","assignees_url":"https://api.github.com/repos/OCA/product-variant/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/product-variant/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/product-variant/tags","blobs_url":"https://api.github.com/repos/OCA/product-variant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/product-variant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/product-variant/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/product-variant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/product-variant/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/product-variant/languages","stargazers_url":"https://api.github.com/repos/OCA/product-variant/stargazers","contributors_url":"https://api.github.com/repos/OCA/product-variant/contributors","subscribers_url":"https://api.github.com/repos/OCA/product-variant/subscribers","subscription_url":"https://api.github.com/repos/OCA/product-variant/subscription","commits_url":"https://api.github.com/repos/OCA/product-variant/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/product-variant/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/product-variant/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/product-variant/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/product-variant/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/product-variant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/product-variant/merges","archive_url":"https://api.github.com/repos/OCA/product-variant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/product-variant/downloads","issues_url":"https://api.github.com/repos/OCA/product-variant/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/product-variant/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/product-variant/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/product-variant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/product-variant/labels{/name}","releases_url":"https://api.github.com/repos/OCA/product-variant/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/product-variant/deployments","created_at":"2014-06-16T17:58:25Z","updated_at":"2016-02-24T05:30:38Z","pushed_at":"2016-08-23T14:43:20Z","git_url":"git://github.com/OCA/product-variant.git","ssh_url":"git@github.com:OCA/product-variant.git","clone_url":"https://github.com/OCA/product-variant.git","svn_url":"https://github.com/OCA/product-variant","homepage":null,"size":1885,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":12,"forks":40,"open_issues":12,"watchers":6,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/30"},"html":{"href":"https://github.com/OCA/product-variant/pull/30"},"issue":{"href":"https://api.github.com/repos/OCA/product-variant/issues/30"},"comments":{"href":"https://api.github.com/repos/OCA/product-variant/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/product-variant/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/product-variant/statuses/49109fac874863e2abf7b5c524e80c512c13eb8a"}}}}
{"actor":{"display_login":"tafaRU"}}