{"action":"opened","number":103,"pull_request":{"url":"https://api.github.com/repos/rfhk/cip-custom/pulls/103","id":178982170,"html_url":"https://github.com/rfhk/cip-custom/pull/103","diff_url":"https://github.com/rfhk/cip-custom/pull/103.diff","patch_url":"https://github.com/rfhk/cip-custom/pull/103.patch","issue_url":"https://api.github.com/repos/rfhk/cip-custom/issues/103","number":103,"state":"open","locked":false,"title":"[FIX] Cancel a previous year sales record","user":{"login":"TimLai125","id":27185427,"avatar_url":"https://avatars2.githubusercontent.com/u/27185427?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLai125","html_url":"https://github.com/TimLai125","followers_url":"https://api.github.com/users/TimLai125/followers","following_url":"https://api.github.com/users/TimLai125/following{/other_user}","gists_url":"https://api.github.com/users/TimLai125/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLai125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLai125/subscriptions","organizations_url":"https://api.github.com/users/TimLai125/orgs","repos_url":"https://api.github.com/users/TimLai125/repos","events_url":"https://api.github.com/users/TimLai125/events{/privacy}","received_events_url":"https://api.github.com/users/TimLai125/received_events","type":"User","site_admin":false},"body":"@yostashiro This PR will handle the following situation:\r\n\r\nBackground:\r\n1. The customer has only 1 sales order in 2016.\r\n2. The user tries to cancel that sales order.\r\n\r\nExpected output:\r\n1. The pricelist should be reset to default (if it is not).\r\n2. A yearly sales record of 2016 should be created.\r\n\r\nCurrent behavior:\r\n1. A yearly sales record of 2016 is created.\r\n2. When the following line attempts to get the yearly sales record of either last year or this year, `hist_recs` returns empty therefore the `[-1]` will give error. \r\n```\r\nhist_recs = self.yearly_sales_history_ids.filtered(\r\n\tlambda x: (x.start_date <= today and x.end_date >= today) or\r\n\t\t\t  (x.start_date <= last_year and x.end_date >= last_year)\r\n)\r\n```\r\n\r\nFix:\r\nIf there is no yearly sales record, the amount should be set to 0.","created_at":"2018-04-03T03:04:08Z","updated_at":"2018-04-03T03:04:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rfhk/cip-custom/pulls/103/commits","review_comments_url":"https://api.github.com/repos/rfhk/cip-custom/pulls/103/comments","review_comment_url":"https://api.github.com/repos/rfhk/cip-custom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rfhk/cip-custom/issues/103/comments","statuses_url":"https://api.github.com/repos/rfhk/cip-custom/statuses/d7b648c0394c7e06a4b0c2645d7531e2789036bd","head":{"label":"TimLai125:pricelist_update_fix","ref":"pricelist_update_fix","sha":"d7b648c0394c7e06a4b0c2645d7531e2789036bd","user":{"login":"TimLai125","id":27185427,"avatar_url":"https://avatars2.githubusercontent.com/u/27185427?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLai125","html_url":"https://github.com/TimLai125","followers_url":"https://api.github.com/users/TimLai125/followers","following_url":"https://api.github.com/users/TimLai125/following{/other_user}","gists_url":"https://api.github.com/users/TimLai125/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLai125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLai125/subscriptions","organizations_url":"https://api.github.com/users/TimLai125/orgs","repos_url":"https://api.github.com/users/TimLai125/repos","events_url":"https://api.github.com/users/TimLai125/events{/privacy}","received_events_url":"https://api.github.com/users/TimLai125/received_events","type":"User","site_admin":false},"repo":{"id":92907670,"name":"cip-custom","full_name":"TimLai125/cip-custom","owner":{"login":"TimLai125","id":27185427,"avatar_url":"https://avatars2.githubusercontent.com/u/27185427?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLai125","html_url":"https://github.com/TimLai125","followers_url":"https://api.github.com/users/TimLai125/followers","following_url":"https://api.github.com/users/TimLai125/following{/other_user}","gists_url":"https://api.github.com/users/TimLai125/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLai125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLai125/subscriptions","organizations_url":"https://api.github.com/users/TimLai125/orgs","repos_url":"https://api.github.com/users/TimLai125/repos","events_url":"https://api.github.com/users/TimLai125/events{/privacy}","received_events_url":"https://api.github.com/users/TimLai125/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TimLai125/cip-custom","description":null,"fork":true,"url":"https://api.github.com/repos/TimLai125/cip-custom","forks_url":"https://api.github.com/repos/TimLai125/cip-custom/forks","keys_url":"https://api.github.com/repos/TimLai125/cip-custom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TimLai125/cip-custom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TimLai125/cip-custom/teams","hooks_url":"https://api.github.com/repos/TimLai125/cip-custom/hooks","issue_events_url":"https://api.github.com/repos/TimLai125/cip-custom/issues/events{/number}","events_url":"https://api.github.com/repos/TimLai125/cip-custom/events","assignees_url":"https://api.github.com/repos/TimLai125/cip-custom/assignees{/user}","branches_url":"https://api.github.com/repos/TimLai125/cip-custom/branches{/branch}","tags_url":"https://api.github.com/repos/TimLai125/cip-custom/tags","blobs_url":"https://api.github.com/repos/TimLai125/cip-custom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TimLai125/cip-custom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TimLai125/cip-custom/git/refs{/sha}","trees_url":"https://api.github.com/repos/TimLai125/cip-custom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TimLai125/cip-custom/statuses/{sha}","languages_url":"https://api.github.com/repos/TimLai125/cip-custom/languages","stargazers_url":"https://api.github.com/repos/TimLai125/cip-custom/stargazers","contributors_url":"https://api.github.com/repos/TimLai125/cip-custom/contributors","subscribers_url":"https://api.github.com/repos/TimLai125/cip-custom/subscribers","subscription_url":"https://api.github.com/repos/TimLai125/cip-custom/subscription","commits_url":"https://api.github.com/repos/TimLai125/cip-custom/commits{/sha}","git_commits_url":"https://api.github.com/repos/TimLai125/cip-custom/git/commits{/sha}","comments_url":"https://api.github.com/repos/TimLai125/cip-custom/comments{/number}","issue_comment_url":"https://api.github.com/repos/TimLai125/cip-custom/issues/comments{/number}","contents_url":"https://api.github.com/repos/TimLai125/cip-custom/contents/{+path}","compare_url":"https://api.github.com/repos/TimLai125/cip-custom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TimLai125/cip-custom/merges","archive_url":"https://api.github.com/repos/TimLai125/cip-custom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TimLai125/cip-custom/downloads","issues_url":"https://api.github.com/repos/TimLai125/cip-custom/issues{/number}","pulls_url":"https://api.github.com/repos/TimLai125/cip-custom/pulls{/number}","milestones_url":"https://api.github.com/repos/TimLai125/cip-custom/milestones{/number}","notifications_url":"https://api.github.com/repos/TimLai125/cip-custom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TimLai125/cip-custom/labels{/name}","releases_url":"https://api.github.com/repos/TimLai125/cip-custom/releases{/id}","deployments_url":"https://api.github.com/repos/TimLai125/cip-custom/deployments","created_at":"2017-05-31T05:26:01Z","updated_at":"2017-05-31T05:26:03Z","pushed_at":"2018-04-03T02:56:07Z","git_url":"git://github.com/TimLai125/cip-custom.git","ssh_url":"git@github.com:TimLai125/cip-custom.git","clone_url":"https://github.com/TimLai125/cip-custom.git","svn_url":"https://github.com/TimLai125/cip-custom","homepage":null,"size":5353,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"7.0"}},"base":{"label":"rfhk:10.0","ref":"10.0","sha":"668acfe6802b4c43f6ef62496f1e9de8b5133aba","user":{"login":"rfhk","id":8349056,"avatar_url":"https://avatars1.githubusercontent.com/u/8349056?v=4","gravatar_id":"","url":"https://api.github.com/users/rfhk","html_url":"https://github.com/rfhk","followers_url":"https://api.github.com/users/rfhk/followers","following_url":"https://api.github.com/users/rfhk/following{/other_user}","gists_url":"https://api.github.com/users/rfhk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfhk/subscriptions","organizations_url":"https://api.github.com/users/rfhk/orgs","repos_url":"https://api.github.com/users/rfhk/repos","events_url":"https://api.github.com/users/rfhk/events{/privacy}","received_events_url":"https://api.github.com/users/rfhk/received_events","type":"Organization","site_admin":false},"repo":{"id":22596732,"name":"cip-custom","full_name":"rfhk/cip-custom","owner":{"login":"rfhk","id":8349056,"avatar_url":"https://avatars1.githubusercontent.com/u/8349056?v=4","gravatar_id":"","url":"https://api.github.com/users/rfhk","html_url":"https://github.com/rfhk","followers_url":"https://api.github.com/users/rfhk/followers","following_url":"https://api.github.com/users/rfhk/following{/other_user}","gists_url":"https://api.github.com/users/rfhk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfhk/subscriptions","organizations_url":"https://api.github.com/users/rfhk/orgs","repos_url":"https://api.github.com/users/rfhk/repos","events_url":"https://api.github.com/users/rfhk/events{/privacy}","received_events_url":"https://api.github.com/users/rfhk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rfhk/cip-custom","description":null,"fork":false,"url":"https://api.github.com/repos/rfhk/cip-custom","forks_url":"https://api.github.com/repos/rfhk/cip-custom/forks","keys_url":"https://api.github.com/repos/rfhk/cip-custom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rfhk/cip-custom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rfhk/cip-custom/teams","hooks_url":"https://api.github.com/repos/rfhk/cip-custom/hooks","issue_events_url":"https://api.github.com/repos/rfhk/cip-custom/issues/events{/number}","events_url":"https://api.github.com/repos/rfhk/cip-custom/events","assignees_url":"https://api.github.com/repos/rfhk/cip-custom/assignees{/user}","branches_url":"https://api.github.com/repos/rfhk/cip-custom/branches{/branch}","tags_url":"https://api.github.com/repos/rfhk/cip-custom/tags","blobs_url":"https://api.github.com/repos/rfhk/cip-custom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rfhk/cip-custom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rfhk/cip-custom/git/refs{/sha}","trees_url":"https://api.github.com/repos/rfhk/cip-custom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rfhk/cip-custom/statuses/{sha}","languages_url":"https://api.github.com/repos/rfhk/cip-custom/languages","stargazers_url":"https://api.github.com/repos/rfhk/cip-custom/stargazers","contributors_url":"https://api.github.com/repos/rfhk/cip-custom/contributors","subscribers_url":"https://api.github.com/repos/rfhk/cip-custom/subscribers","subscription_url":"https://api.github.com/repos/rfhk/cip-custom/subscription","commits_url":"https://api.github.com/repos/rfhk/cip-custom/commits{/sha}","git_commits_url":"https://api.github.com/repos/rfhk/cip-custom/git/commits{/sha}","comments_url":"https://api.github.com/repos/rfhk/cip-custom/comments{/number}","issue_comment_url":"https://api.github.com/repos/rfhk/cip-custom/issues/comments{/number}","contents_url":"https://api.github.com/repos/rfhk/cip-custom/contents/{+path}","compare_url":"https://api.github.com/repos/rfhk/cip-custom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rfhk/cip-custom/merges","archive_url":"https://api.github.com/repos/rfhk/cip-custom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rfhk/cip-custom/downloads","issues_url":"https://api.github.com/repos/rfhk/cip-custom/issues{/number}","pulls_url":"https://api.github.com/repos/rfhk/cip-custom/pulls{/number}","milestones_url":"https://api.github.com/repos/rfhk/cip-custom/milestones{/number}","notifications_url":"https://api.github.com/repos/rfhk/cip-custom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rfhk/cip-custom/labels{/name}","releases_url":"https://api.github.com/repos/rfhk/cip-custom/releases{/id}","deployments_url":"https://api.github.com/repos/rfhk/cip-custom/deployments","created_at":"2014-08-04T08:15:30Z","updated_at":"2018-03-15T13:12:48Z","pushed_at":"2018-03-15T13:12:47Z","git_url":"git://github.com/rfhk/cip-custom.git","ssh_url":"git@github.com:rfhk/cip-custom.git","clone_url":"https://github.com/rfhk/cip-custom.git","svn_url":"https://github.com/rfhk/cip-custom","homepage":null,"size":4824,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":6,"open_issues":1,"watchers":3,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/rfhk/cip-custom/pulls/103"},"html":{"href":"https://github.com/rfhk/cip-custom/pull/103"},"issue":{"href":"https://api.github.com/repos/rfhk/cip-custom/issues/103"},"comments":{"href":"https://api.github.com/repos/rfhk/cip-custom/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/rfhk/cip-custom/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/rfhk/cip-custom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rfhk/cip-custom/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/rfhk/cip-custom/statuses/d7b648c0394c7e06a4b0c2645d7531e2789036bd"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":2,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"TimLai125"}}