{"action":"created","comment":{"url":"https://api.github.com/repos/xtuple/qt-client/pulls/comments/90712866","pull_request_review_id":11233183,"id":90712866,"diff_hunk":"@@ -527,16 +527,26 @@ void purchaseOrderItem::populate()\n     }\n \n     purchasepopulate.prepare( \"SELECT DISTINCT char_id, char_name,\"\n-               \"       COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='I') AND (c.charass_target_id=:item_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value\"\n-               \"  FROM charass a, char \"\n-               \"    LEFT OUTER JOIN charass b\"\n-               \"      ON (b.charass_target_type='PI'\"\n-               \"      AND b.charass_target_id=:poitem_id\"\n-               \"      AND b.charass_char_id=char_id) \"\n-               \" WHERE ( (a.charass_char_id=char_id)\"\n-               \"   AND   (a.charass_target_type='I')\"\n-               \"   AND   (a.charass_target_id=:item_id) ) \"\n-               \" ORDER BY char_name;\" );\n+                   \"       COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='I') AND (c.charass_target_id=:item_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value\"\n+                   \"   FROM (SELECT DISTINCT char_id, char_type, char_name, char_order \"\n+                   \"         FROM charass, char, charuse\"\n+                   \"         WHERE ((charass_char_id=char_id)\"\n+                   \"         AND (charuse_char_id=char_id AND charuse_target_type = 'PI') \"\n+                   \"         AND (charass_target_type='I') \"\n+                   \"         AND (charass_target_id=:item_id) ) \"\n+                   \"         UNION SELECT char_id, char_type, char_name, char_order\"\n+                   \"         FROM charass, char \"\n+                   \"         WHERE ((charass_char_id=char_id)\"\n+                   \"         AND  (charass_target_type = 'PI' AND charass_target_id=:poitem_id))   ) AS data \"\n+                   \"   LEFT OUTER JOIN charass b ON ((:poitem_id=b.charass_target_id)\"\n+                   \"                                  AND ('PI'=b.charass_target_type)\"\n+                   \"                                  AND (b.charass_char_id=char_id))\"\n+                   \"   LEFT OUTER JOIN item     i1 ON (i1.item_id=:item_id)\"\n+                   \"   LEFT OUTER JOIN charass  i2 ON ((i1.item_id=i2.charass_target_id)\"\n+                   \"                                   AND ('I'=i2.charass_target_type)\"\n+                   \"                                   AND (i2.charass_char_id=char_id)\"\n+                   \"                                   AND (i2.charass_default))\"","path":"guiclient/purchaseOrderItem.cpp","position":32,"original_position":32,"commit_id":"7bf0de5de04c90ac310b258fa7c7791452e6111d","original_commit_id":"7bf0de5de04c90ac310b258fa7c7791452e6111d","user":{"login":"andersdd","id":4682742,"avatar_url":"https://avatars.githubusercontent.com/u/4682742?v=3","gravatar_id":"","url":"https://api.github.com/users/andersdd","html_url":"https://github.com/andersdd","followers_url":"https://api.github.com/users/andersdd/followers","following_url":"https://api.github.com/users/andersdd/following{/other_user}","gists_url":"https://api.github.com/users/andersdd/gists{/gist_id}","starred_url":"https://api.github.com/users/andersdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersdd/subscriptions","organizations_url":"https://api.github.com/users/andersdd/orgs","repos_url":"https://api.github.com/users/andersdd/repos","events_url":"https://api.github.com/users/andersdd/events{/privacy}","received_events_url":"https://api.github.com/users/andersdd/received_events","type":"User","site_admin":false},"body":"This query pulls in Item characteristics also assigned to the PO Item even if they have not yet been assigned to the PO (default item characteristics).  So the second set of joins is required to bring in their potential values.  The change made here is to restrict those characteristics to only those actually pegged against the PO Item.  Also the UNION brings in assigned characteristics even if they are no longer pegged against PO Items.","created_at":"2016-12-02T20:19:28Z","updated_at":"2016-12-02T20:19:28Z","html_url":"https://github.com/xtuple/qt-client/pull/1476#discussion_r90712866","pull_request_url":"https://api.github.com/repos/xtuple/qt-client/pulls/1476","_links":{"self":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/comments/90712866"},"html":{"href":"https://github.com/xtuple/qt-client/pull/1476#discussion_r90712866"},"pull_request":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/1476"}}},"pull_request":{"url":"https://api.github.com/repos/xtuple/qt-client/pulls/1476","id":95617816,"html_url":"https://github.com/xtuple/qt-client/pull/1476","diff_url":"https://github.com/xtuple/qt-client/pull/1476.diff","patch_url":"https://github.com/xtuple/qt-client/pull/1476.patch","issue_url":"https://api.github.com/repos/xtuple/qt-client/issues/1476","number":1476,"state":"open","locked":false,"title":"Issue #27705: Resolve Item characteristic propagation to order documents","user":{"login":"andersdd","id":4682742,"avatar_url":"https://avatars.githubusercontent.com/u/4682742?v=3","gravatar_id":"","url":"https://api.github.com/users/andersdd","html_url":"https://github.com/andersdd","followers_url":"https://api.github.com/users/andersdd/followers","following_url":"https://api.github.com/users/andersdd/following{/other_user}","gists_url":"https://api.github.com/users/andersdd/gists{/gist_id}","starred_url":"https://api.github.com/users/andersdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersdd/subscriptions","organizations_url":"https://api.github.com/users/andersdd/orgs","repos_url":"https://api.github.com/users/andersdd/repos","events_url":"https://api.github.com/users/andersdd/events{/privacy}","received_events_url":"https://api.github.com/users/andersdd/received_events","type":"User","site_admin":false},"body":"Only propagate to order item chars if selected in characteristic setup.\r\n\r\nThis change imports Item characteristics set to default into the order item, plus also displays existing assignments to the order item even if the setting was subsequently turned off.\r\n\r\nconsider in conjunction with xtuple/xtuple#2910","created_at":"2016-11-29T02:57:12Z","updated_at":"2016-12-02T20:19:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ebbfd708d0d60bb809e7ec66de2a86a7502543f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xtuple/qt-client/pulls/1476/commits","review_comments_url":"https://api.github.com/repos/xtuple/qt-client/pulls/1476/comments","review_comment_url":"https://api.github.com/repos/xtuple/qt-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xtuple/qt-client/issues/1476/comments","statuses_url":"https://api.github.com/repos/xtuple/qt-client/statuses/7bf0de5de04c90ac310b258fa7c7791452e6111d","head":{"label":"andersdd:27705_item_characteristic_propagation","ref":"27705_item_characteristic_propagation","sha":"7bf0de5de04c90ac310b258fa7c7791452e6111d","user":{"login":"andersdd","id":4682742,"avatar_url":"https://avatars.githubusercontent.com/u/4682742?v=3","gravatar_id":"","url":"https://api.github.com/users/andersdd","html_url":"https://github.com/andersdd","followers_url":"https://api.github.com/users/andersdd/followers","following_url":"https://api.github.com/users/andersdd/following{/other_user}","gists_url":"https://api.github.com/users/andersdd/gists{/gist_id}","starred_url":"https://api.github.com/users/andersdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersdd/subscriptions","organizations_url":"https://api.github.com/users/andersdd/orgs","repos_url":"https://api.github.com/users/andersdd/repos","events_url":"https://api.github.com/users/andersdd/events{/privacy}","received_events_url":"https://api.github.com/users/andersdd/received_events","type":"User","site_admin":false},"repo":{"id":11227389,"name":"qt-client","full_name":"andersdd/qt-client","owner":{"login":"andersdd","id":4682742,"avatar_url":"https://avatars.githubusercontent.com/u/4682742?v=3","gravatar_id":"","url":"https://api.github.com/users/andersdd","html_url":"https://github.com/andersdd","followers_url":"https://api.github.com/users/andersdd/followers","following_url":"https://api.github.com/users/andersdd/following{/other_user}","gists_url":"https://api.github.com/users/andersdd/gists{/gist_id}","starred_url":"https://api.github.com/users/andersdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersdd/subscriptions","organizations_url":"https://api.github.com/users/andersdd/orgs","repos_url":"https://api.github.com/users/andersdd/repos","events_url":"https://api.github.com/users/andersdd/events{/privacy}","received_events_url":"https://api.github.com/users/andersdd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andersdd/qt-client","description":"Desktop Client and Database","fork":true,"url":"https://api.github.com/repos/andersdd/qt-client","forks_url":"https://api.github.com/repos/andersdd/qt-client/forks","keys_url":"https://api.github.com/repos/andersdd/qt-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andersdd/qt-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andersdd/qt-client/teams","hooks_url":"https://api.github.com/repos/andersdd/qt-client/hooks","issue_events_url":"https://api.github.com/repos/andersdd/qt-client/issues/events{/number}","events_url":"https://api.github.com/repos/andersdd/qt-client/events","assignees_url":"https://api.github.com/repos/andersdd/qt-client/assignees{/user}","branches_url":"https://api.github.com/repos/andersdd/qt-client/branches{/branch}","tags_url":"https://api.github.com/repos/andersdd/qt-client/tags","blobs_url":"https://api.github.com/repos/andersdd/qt-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andersdd/qt-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andersdd/qt-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/andersdd/qt-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andersdd/qt-client/statuses/{sha}","languages_url":"https://api.github.com/repos/andersdd/qt-client/languages","stargazers_url":"https://api.github.com/repos/andersdd/qt-client/stargazers","contributors_url":"https://api.github.com/repos/andersdd/qt-client/contributors","subscribers_url":"https://api.github.com/repos/andersdd/qt-client/subscribers","subscription_url":"https://api.github.com/repos/andersdd/qt-client/subscription","commits_url":"https://api.github.com/repos/andersdd/qt-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/andersdd/qt-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/andersdd/qt-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/andersdd/qt-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/andersdd/qt-client/contents/{+path}","compare_url":"https://api.github.com/repos/andersdd/qt-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andersdd/qt-client/merges","archive_url":"https://api.github.com/repos/andersdd/qt-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andersdd/qt-client/downloads","issues_url":"https://api.github.com/repos/andersdd/qt-client/issues{/number}","pulls_url":"https://api.github.com/repos/andersdd/qt-client/pulls{/number}","milestones_url":"https://api.github.com/repos/andersdd/qt-client/milestones{/number}","notifications_url":"https://api.github.com/repos/andersdd/qt-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andersdd/qt-client/labels{/name}","releases_url":"https://api.github.com/repos/andersdd/qt-client/releases{/id}","deployments_url":"https://api.github.com/repos/andersdd/qt-client/deployments","created_at":"2013-07-07T02:27:25Z","updated_at":"2014-08-11T22:38:17Z","pushed_at":"2016-11-29T02:53:55Z","git_url":"git://github.com/andersdd/qt-client.git","ssh_url":"git@github.com:andersdd/qt-client.git","clone_url":"https://github.com/andersdd/qt-client.git","svn_url":"https://github.com/andersdd/qt-client","homepage":null,"size":110196,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"master"}},"base":{"label":"xtuple:4_11_x","ref":"4_11_x","sha":"0897ca20f3ee8e3e38ed92b3031d3376b1c166ed","user":{"login":"xtuple","id":703922,"avatar_url":"https://avatars.githubusercontent.com/u/703922?v=3","gravatar_id":"","url":"https://api.github.com/users/xtuple","html_url":"https://github.com/xtuple","followers_url":"https://api.github.com/users/xtuple/followers","following_url":"https://api.github.com/users/xtuple/following{/other_user}","gists_url":"https://api.github.com/users/xtuple/gists{/gist_id}","starred_url":"https://api.github.com/users/xtuple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtuple/subscriptions","organizations_url":"https://api.github.com/users/xtuple/orgs","repos_url":"https://api.github.com/users/xtuple/repos","events_url":"https://api.github.com/users/xtuple/events{/privacy}","received_events_url":"https://api.github.com/users/xtuple/received_events","type":"Organization","site_admin":false},"repo":{"id":10383821,"name":"qt-client","full_name":"xtuple/qt-client","owner":{"login":"xtuple","id":703922,"avatar_url":"https://avatars.githubusercontent.com/u/703922?v=3","gravatar_id":"","url":"https://api.github.com/users/xtuple","html_url":"https://github.com/xtuple","followers_url":"https://api.github.com/users/xtuple/followers","following_url":"https://api.github.com/users/xtuple/following{/other_user}","gists_url":"https://api.github.com/users/xtuple/gists{/gist_id}","starred_url":"https://api.github.com/users/xtuple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtuple/subscriptions","organizations_url":"https://api.github.com/users/xtuple/orgs","repos_url":"https://api.github.com/users/xtuple/repos","events_url":"https://api.github.com/users/xtuple/events{/privacy}","received_events_url":"https://api.github.com/users/xtuple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xtuple/qt-client","description":"This repository contains the source code for the Desktop client. The Desktop client is built using the Qt framework for C++. The client can be extended or customized using JavaScript. This client is used by all editions of xTuple ERP.","fork":false,"url":"https://api.github.com/repos/xtuple/qt-client","forks_url":"https://api.github.com/repos/xtuple/qt-client/forks","keys_url":"https://api.github.com/repos/xtuple/qt-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xtuple/qt-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xtuple/qt-client/teams","hooks_url":"https://api.github.com/repos/xtuple/qt-client/hooks","issue_events_url":"https://api.github.com/repos/xtuple/qt-client/issues/events{/number}","events_url":"https://api.github.com/repos/xtuple/qt-client/events","assignees_url":"https://api.github.com/repos/xtuple/qt-client/assignees{/user}","branches_url":"https://api.github.com/repos/xtuple/qt-client/branches{/branch}","tags_url":"https://api.github.com/repos/xtuple/qt-client/tags","blobs_url":"https://api.github.com/repos/xtuple/qt-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xtuple/qt-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xtuple/qt-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/xtuple/qt-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xtuple/qt-client/statuses/{sha}","languages_url":"https://api.github.com/repos/xtuple/qt-client/languages","stargazers_url":"https://api.github.com/repos/xtuple/qt-client/stargazers","contributors_url":"https://api.github.com/repos/xtuple/qt-client/contributors","subscribers_url":"https://api.github.com/repos/xtuple/qt-client/subscribers","subscription_url":"https://api.github.com/repos/xtuple/qt-client/subscription","commits_url":"https://api.github.com/repos/xtuple/qt-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/xtuple/qt-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/xtuple/qt-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/xtuple/qt-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/xtuple/qt-client/contents/{+path}","compare_url":"https://api.github.com/repos/xtuple/qt-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xtuple/qt-client/merges","archive_url":"https://api.github.com/repos/xtuple/qt-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xtuple/qt-client/downloads","issues_url":"https://api.github.com/repos/xtuple/qt-client/issues{/number}","pulls_url":"https://api.github.com/repos/xtuple/qt-client/pulls{/number}","milestones_url":"https://api.github.com/repos/xtuple/qt-client/milestones{/number}","notifications_url":"https://api.github.com/repos/xtuple/qt-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xtuple/qt-client/labels{/name}","releases_url":"https://api.github.com/repos/xtuple/qt-client/releases{/id}","deployments_url":"https://api.github.com/repos/xtuple/qt-client/deployments","created_at":"2013-05-30T13:54:04Z","updated_at":"2016-10-27T17:08:21Z","pushed_at":"2016-12-02T16:59:50Z","git_url":"git://github.com/xtuple/qt-client.git","ssh_url":"git@github.com:xtuple/qt-client.git","clone_url":"https://github.com/xtuple/qt-client.git","svn_url":"https://github.com/xtuple/qt-client","homepage":"","size":131821,"stargazers_count":54,"watchers_count":54,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":136,"mirror_url":null,"open_issues_count":11,"forks":136,"open_issues":11,"watchers":54,"default_branch":"4_11_x"}},"_links":{"self":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/1476"},"html":{"href":"https://github.com/xtuple/qt-client/pull/1476"},"issue":{"href":"https://api.github.com/repos/xtuple/qt-client/issues/1476"},"comments":{"href":"https://api.github.com/repos/xtuple/qt-client/issues/1476/comments"},"review_comments":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/1476/comments"},"review_comment":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xtuple/qt-client/pulls/1476/commits"},"statuses":{"href":"https://api.github.com/repos/xtuple/qt-client/statuses/7bf0de5de04c90ac310b258fa7c7791452e6111d"}}}}
{"actor":{"display_login":"andersdd"}}