{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/hr/pulls/comments/72768748","id":72768748,"diff_hunk":"@@ -4,6 +4,7 @@\n \n from openerp import api, fields, models\n from openerp.tools import ustr\n+from openerp.exceptions import Warning as UserWarning","path":"hr_expense_product_policy/models/hr_expense.py","position":null,"original_position":4,"commit_id":"881980a1e1880ead6dcc57b1c417fff2078dd981","original_commit_id":"881980a1e1880ead6dcc57b1c417fff2078dd981","user":{"login":"dreispt","id":1246629,"avatar_url":"https://avatars.githubusercontent.com/u/1246629?v=3","gravatar_id":"","url":"https://api.github.com/users/dreispt","html_url":"https://github.com/dreispt","followers_url":"https://api.github.com/users/dreispt/followers","following_url":"https://api.github.com/users/dreispt/following{/other_user}","gists_url":"https://api.github.com/users/dreispt/gists{/gist_id}","starred_url":"https://api.github.com/users/dreispt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreispt/subscriptions","organizations_url":"https://api.github.com/users/dreispt/orgs","repos_url":"https://api.github.com/users/dreispt/repos","events_url":"https://api.github.com/users/dreispt/events{/privacy}","received_events_url":"https://api.github.com/users/dreispt/received_events","type":"User","site_admin":false},"body":"AFAIK `Warning`is deprecated. Use `ValidationError` or  `UserError` instead.\r\nI believe that you can avoid an extra import and use `raise models.ValidationError`","created_at":"2016-07-29T09:55:03Z","updated_at":"2016-07-29T09:55:03Z","html_url":"https://github.com/OCA/hr/pull/243#discussion_r72768748","pull_request_url":"https://api.github.com/repos/OCA/hr/pulls/243","_links":{"self":{"href":"https://api.github.com/repos/OCA/hr/pulls/comments/72768748"},"html":{"href":"https://github.com/OCA/hr/pull/243#discussion_r72768748"},"pull_request":{"href":"https://api.github.com/repos/OCA/hr/pulls/243"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/hr/pulls/243","id":76198549,"html_url":"https://github.com/OCA/hr/pull/243","diff_url":"https://github.com/OCA/hr/pull/243.diff","patch_url":"https://github.com/OCA/hr/pull/243.patch","issue_url":"https://api.github.com/repos/OCA/hr/issues/243","number":243,"state":"open","locked":false,"title":"[ADD][8.0] hr_expense_product_policy","user":{"login":"andhit-r","id":1947376,"avatar_url":"https://avatars.githubusercontent.com/u/1947376?v=3","gravatar_id":"","url":"https://api.github.com/users/andhit-r","html_url":"https://github.com/andhit-r","followers_url":"https://api.github.com/users/andhit-r/followers","following_url":"https://api.github.com/users/andhit-r/following{/other_user}","gists_url":"https://api.github.com/users/andhit-r/gists{/gist_id}","starred_url":"https://api.github.com/users/andhit-r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andhit-r/subscriptions","organizations_url":"https://api.github.com/users/andhit-r/orgs","repos_url":"https://api.github.com/users/andhit-r/repos","events_url":"https://api.github.com/users/andhit-r/events{/privacy}","received_events_url":"https://api.github.com/users/andhit-r/received_events","type":"User","site_admin":false},"body":"Revision todo list:\r\n- [x] change mapped(\"id\") into .ids\r\n- [x] assign recordset instead of list IDs on m2m computed field\r\n- [ ] domain on inherited view instead override fields_view_get\r\n- [ ] store or not field required_expense_product on hr.expense?\r\n- [ ] hard enforce policy on create and write method\r\n\r\n\r\n=========================\r\nHR Expense Product Policy\r\n=========================\r\n\r\nThis module add feature to set up policy regarding product on expense. Product\r\npolicy that ruled by this module are:\r\n\r\n1. Force use of product on Expense\r\n2. Allowed product that can be used based on employee's department\r\n3. Allowed product that can be used based on employee's job\r\n4. Allowed product that can be used based on employee himself\r\n\r\nConfiguration\r\n=============\r\n\r\n**Force Product Usage**\r\nTo force product usage on expense, you need to:\r\n\r\n1. Open employee data\r\n2. Open *HR Setting* tab\r\n3. Activate *Required Expense Product*\r\n\r\nHint:\r\nYou can use mass editing module to apply this rule\r\n\r\n**Department's Expense Product Policy**\r\nTo set up department's allowed product policy based on product category, you need to:\r\n\r\n1. Open department data\r\n2. Select product category on *Allowed Expense Product Category*\r\n\r\nTo set up department's allowed product policy based on specific product, you need to:\r\n\r\n1. Open department data\r\n2. Select product on *Allowed Expense Product*\r\n\r\nNote:\r\n* Only product with *Can be expense* flag turn on can be used, even if that product belong to category specified on *Allowed Expense Product Category*\r\n* Only product with *Can be expense* flag turn on can be selected on *Allowed Expense Product*\r\n* Final result of allowed product can be seen on *All Allowed Expense Products*\r\n\r\n**Job's Expense Product Policy**\r\nTo set up job's allowed product policy based on product category, you need to:\r\n\r\n1. Open job data\r\n2. Select product category on *Allowed Expense Product Category*\r\n\r\nTo set up job's allowed product policy based on specific product, you need to:\r\n\r\n1. Open job data\r\n2. Select product on *Allowed Expense Product*\r\n\r\nNote:\r\n* Only product with *Can be expense* flag turn on can be used, even if that product belong to category specified on *Allowed Expense Product Category*\r\n* Only product with *Can be expense* flag turn on can be selected on *Allowed Expense Product*\r\n* Final result of allowed product can be seen on *All Allowed Expense Products*\r\n\r\n**Employee's Expense Product Policy**\r\nTo set up employee's allowed product policy based on product category, you need to:\r\n\r\n1. Open employee data\r\n2. Select product category on *Allowed Expense Product Category*\r\n\r\nTo set up employee's allowed product policy based on specific product, you need to:\r\n\r\n1. Open employee data\r\n2. Select product on *Allowed Expense Product*\r\n\r\nNote:\r\n* Only product with *Can be expense* flag turn on can be used, even if that product belong to category specified on *Allowed Expense Product Category*\r\n* Only product with *Can be expense* flag turn on can be selected on *Allowed Expense Product*\r\n* Final result of allowed product can be seen on *All Allowed Expense Products*. The list will be the aggregation of (1) department's product policy, (2) job's product policy, and (3) employee's product policy","created_at":"2016-07-04T20:32:57Z","updated_at":"2016-07-29T09:55:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0481bfd59f40175d144144808b90727dc5a0983","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OCA/hr/milestones/1","html_url":"https://github.com/OCA/hr/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/hr/milestones/1/labels","id":832892,"number":1,"title":"8.0","description":null,"creator":{"login":"bwrsandman","id":1013356,"avatar_url":"https://avatars.githubusercontent.com/u/1013356?v=3","gravatar_id":"","url":"https://api.github.com/users/bwrsandman","html_url":"https://github.com/bwrsandman","followers_url":"https://api.github.com/users/bwrsandman/followers","following_url":"https://api.github.com/users/bwrsandman/following{/other_user}","gists_url":"https://api.github.com/users/bwrsandman/gists{/gist_id}","starred_url":"https://api.github.com/users/bwrsandman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwrsandman/subscriptions","organizations_url":"https://api.github.com/users/bwrsandman/orgs","repos_url":"https://api.github.com/users/bwrsandman/repos","events_url":"https://api.github.com/users/bwrsandman/events{/privacy}","received_events_url":"https://api.github.com/users/bwrsandman/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":50,"state":"open","created_at":"2014-10-20T15:33:04Z","updated_at":"2016-07-27T13:15:46Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/hr/pulls/243/commits","review_comments_url":"https://api.github.com/repos/OCA/hr/pulls/243/comments","review_comment_url":"https://api.github.com/repos/OCA/hr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/hr/issues/243/comments","statuses_url":"https://api.github.com/repos/OCA/hr/statuses/881980a1e1880ead6dcc57b1c417fff2078dd981","head":{"label":"andhit-r:8.0-hr_expense_product_policy","ref":"8.0-hr_expense_product_policy","sha":"881980a1e1880ead6dcc57b1c417fff2078dd981","user":{"login":"andhit-r","id":1947376,"avatar_url":"https://avatars.githubusercontent.com/u/1947376?v=3","gravatar_id":"","url":"https://api.github.com/users/andhit-r","html_url":"https://github.com/andhit-r","followers_url":"https://api.github.com/users/andhit-r/followers","following_url":"https://api.github.com/users/andhit-r/following{/other_user}","gists_url":"https://api.github.com/users/andhit-r/gists{/gist_id}","starred_url":"https://api.github.com/users/andhit-r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andhit-r/subscriptions","organizations_url":"https://api.github.com/users/andhit-r/orgs","repos_url":"https://api.github.com/users/andhit-r/repos","events_url":"https://api.github.com/users/andhit-r/events{/privacy}","received_events_url":"https://api.github.com/users/andhit-r/received_events","type":"User","site_admin":false},"repo":{"id":50908184,"name":"hr","full_name":"andhit-r/hr","owner":{"login":"andhit-r","id":1947376,"avatar_url":"https://avatars.githubusercontent.com/u/1947376?v=3","gravatar_id":"","url":"https://api.github.com/users/andhit-r","html_url":"https://github.com/andhit-r","followers_url":"https://api.github.com/users/andhit-r/followers","following_url":"https://api.github.com/users/andhit-r/following{/other_user}","gists_url":"https://api.github.com/users/andhit-r/gists{/gist_id}","starred_url":"https://api.github.com/users/andhit-r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andhit-r/subscriptions","organizations_url":"https://api.github.com/users/andhit-r/orgs","repos_url":"https://api.github.com/users/andhit-r/repos","events_url":"https://api.github.com/users/andhit-r/events{/privacy}","received_events_url":"https://api.github.com/users/andhit-r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andhit-r/hr","description":"Odoo Human Ressources Addons","fork":true,"url":"https://api.github.com/repos/andhit-r/hr","forks_url":"https://api.github.com/repos/andhit-r/hr/forks","keys_url":"https://api.github.com/repos/andhit-r/hr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andhit-r/hr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andhit-r/hr/teams","hooks_url":"https://api.github.com/repos/andhit-r/hr/hooks","issue_events_url":"https://api.github.com/repos/andhit-r/hr/issues/events{/number}","events_url":"https://api.github.com/repos/andhit-r/hr/events","assignees_url":"https://api.github.com/repos/andhit-r/hr/assignees{/user}","branches_url":"https://api.github.com/repos/andhit-r/hr/branches{/branch}","tags_url":"https://api.github.com/repos/andhit-r/hr/tags","blobs_url":"https://api.github.com/repos/andhit-r/hr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andhit-r/hr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andhit-r/hr/git/refs{/sha}","trees_url":"https://api.github.com/repos/andhit-r/hr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andhit-r/hr/statuses/{sha}","languages_url":"https://api.github.com/repos/andhit-r/hr/languages","stargazers_url":"https://api.github.com/repos/andhit-r/hr/stargazers","contributors_url":"https://api.github.com/repos/andhit-r/hr/contributors","subscribers_url":"https://api.github.com/repos/andhit-r/hr/subscribers","subscription_url":"https://api.github.com/repos/andhit-r/hr/subscription","commits_url":"https://api.github.com/repos/andhit-r/hr/commits{/sha}","git_commits_url":"https://api.github.com/repos/andhit-r/hr/git/commits{/sha}","comments_url":"https://api.github.com/repos/andhit-r/hr/comments{/number}","issue_comment_url":"https://api.github.com/repos/andhit-r/hr/issues/comments{/number}","contents_url":"https://api.github.com/repos/andhit-r/hr/contents/{+path}","compare_url":"https://api.github.com/repos/andhit-r/hr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andhit-r/hr/merges","archive_url":"https://api.github.com/repos/andhit-r/hr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andhit-r/hr/downloads","issues_url":"https://api.github.com/repos/andhit-r/hr/issues{/number}","pulls_url":"https://api.github.com/repos/andhit-r/hr/pulls{/number}","milestones_url":"https://api.github.com/repos/andhit-r/hr/milestones{/number}","notifications_url":"https://api.github.com/repos/andhit-r/hr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andhit-r/hr/labels{/name}","releases_url":"https://api.github.com/repos/andhit-r/hr/releases{/id}","deployments_url":"https://api.github.com/repos/andhit-r/hr/deployments","created_at":"2016-02-02T09:10:35Z","updated_at":"2016-02-02T09:10:37Z","pushed_at":"2016-07-29T09:40:21Z","git_url":"git://github.com/andhit-r/hr.git","ssh_url":"git@github.com:andhit-r/hr.git","clone_url":"https://github.com/andhit-r/hr.git","svn_url":"https://github.com/andhit-r/hr","homepage":"","size":4812,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"9.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"cbe599c4b2892f2a26abdf0b6cbc2ba2551c30cc","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":20891607,"name":"hr","full_name":"OCA/hr","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/hr","description":"Odoo Human Ressources Addons","fork":false,"url":"https://api.github.com/repos/OCA/hr","forks_url":"https://api.github.com/repos/OCA/hr/forks","keys_url":"https://api.github.com/repos/OCA/hr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/hr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/hr/teams","hooks_url":"https://api.github.com/repos/OCA/hr/hooks","issue_events_url":"https://api.github.com/repos/OCA/hr/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/hr/events","assignees_url":"https://api.github.com/repos/OCA/hr/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/hr/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/hr/tags","blobs_url":"https://api.github.com/repos/OCA/hr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/hr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/hr/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/hr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/hr/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/hr/languages","stargazers_url":"https://api.github.com/repos/OCA/hr/stargazers","contributors_url":"https://api.github.com/repos/OCA/hr/contributors","subscribers_url":"https://api.github.com/repos/OCA/hr/subscribers","subscription_url":"https://api.github.com/repos/OCA/hr/subscription","commits_url":"https://api.github.com/repos/OCA/hr/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/hr/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/hr/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/hr/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/hr/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/hr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/hr/merges","archive_url":"https://api.github.com/repos/OCA/hr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/hr/downloads","issues_url":"https://api.github.com/repos/OCA/hr/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/hr/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/hr/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/hr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/hr/labels{/name}","releases_url":"https://api.github.com/repos/OCA/hr/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/hr/deployments","created_at":"2014-06-16T16:15:34Z","updated_at":"2016-07-08T16:26:22Z","pushed_at":"2016-07-29T09:40:22Z","git_url":"git://github.com/OCA/hr.git","ssh_url":"git@github.com:OCA/hr.git","clone_url":"https://github.com/OCA/hr.git","svn_url":"https://github.com/OCA/hr","homepage":"","size":6026,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":108,"mirror_url":null,"open_issues_count":55,"forks":108,"open_issues":55,"watchers":28,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/hr/pulls/243"},"html":{"href":"https://github.com/OCA/hr/pull/243"},"issue":{"href":"https://api.github.com/repos/OCA/hr/issues/243"},"comments":{"href":"https://api.github.com/repos/OCA/hr/issues/243/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/hr/pulls/243/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/hr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/hr/pulls/243/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/hr/statuses/881980a1e1880ead6dcc57b1c417fff2078dd981"}}}}
{"actor":{"display_login":"dreispt"}}