{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/66396462","id":66396462,"diff_hunk":"@@ -50,26 +50,23 @@ def _prepare_interest_line(self, interest_amount):\n \n     @api.multi\n     def get_interest_value(self):\n+        current_total = 0.\n         self.ensure_one()\n         term = self.payment_term\n         if not term:\n             return 0.\n         if not any(line.interest_rate for line in term.line_ids):\n             return 0.\n-        line = self._get_interest_line()\n-        if line:\n+        for line in [line for line in self.order_line\n+                     if not line.interest_line]:","path":"sale_payment_term_interest/model/sale_order.py","position":14,"original_position":14,"commit_id":"0eab6ba0e64d6a59ccd66c48b3b70f9612e93269","original_commit_id":"0eab6ba0e64d6a59ccd66c48b3b70f9612e93269","user":{"login":"guewen","id":417223,"avatar_url":"https://avatars.githubusercontent.com/u/417223?v=3","gravatar_id":"","url":"https://api.github.com/users/guewen","html_url":"https://github.com/guewen","followers_url":"https://api.github.com/users/guewen/followers","following_url":"https://api.github.com/users/guewen/following{/other_user}","gists_url":"https://api.github.com/users/guewen/gists{/gist_id}","starred_url":"https://api.github.com/users/guewen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guewen/subscriptions","organizations_url":"https://api.github.com/users/guewen/orgs","repos_url":"https://api.github.com/users/guewen/repos","events_url":"https://api.github.com/users/guewen/events{/privacy}","received_events_url":"https://api.github.com/users/guewen/received_events","type":"User","site_admin":false},"body":"To keep the modularity you could change the condition to `if not line ==  self._get_interest_line()`","created_at":"2016-06-09T07:52:19Z","updated_at":"2016-06-09T07:52:19Z","html_url":"https://github.com/OCA/sale-workflow/pull/309#discussion_r66396462","pull_request_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/66396462"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/309#discussion_r66396462"},"pull_request":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/309","id":73169150,"html_url":"https://github.com/OCA/sale-workflow/pull/309","diff_url":"https://github.com/OCA/sale-workflow/pull/309.diff","patch_url":"https://github.com/OCA/sale-workflow/pull/309.patch","issue_url":"https://api.github.com/repos/OCA/sale-workflow/issues/309","number":309,"state":"open","locked":false,"title":"Do not use computed value for new computation","user":{"login":"mdietrichc2c","id":7628281,"avatar_url":"https://avatars.githubusercontent.com/u/7628281?v=3","gravatar_id":"","url":"https://api.github.com/users/mdietrichc2c","html_url":"https://github.com/mdietrichc2c","followers_url":"https://api.github.com/users/mdietrichc2c/followers","following_url":"https://api.github.com/users/mdietrichc2c/following{/other_user}","gists_url":"https://api.github.com/users/mdietrichc2c/gists{/gist_id}","starred_url":"https://api.github.com/users/mdietrichc2c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdietrichc2c/subscriptions","organizations_url":"https://api.github.com/users/mdietrichc2c/orgs","repos_url":"https://api.github.com/users/mdietrichc2c/repos","events_url":"https://api.github.com/users/mdietrichc2c/events{/privacy}","received_events_url":"https://api.github.com/users/mdietrichc2c/received_events","type":"User","site_admin":false},"body":"This PR is to fix a small \"edge case\" I had with a customer : basically, the line's old value was used to recompute the value itself.\r\nIn that particular case, the taxes and total amount made it so that the small amount variation was over/under 3.815, which meant that:\r\n* if the line had a value of 3.81, the computed value was 3.82,\r\n* then, when the line had a value of 3.81, the computed value was 3.81.\r\n\r\nThat means, in the method https://github.com/OCA/sale-workflow/blob/8.0/sale_payment_term_interest/model/sale_order.py#L99 , the 2 values were always different by 0.01.\r\n\r\nThe fix is straight-forward : instead of substracting the interest line's amount to the total amount, all non-interest lines are added (meaning the value used as a basis remains constant).","created_at":"2016-06-09T07:38:18Z","updated_at":"2016-06-09T07:52:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"153c41b3fb39809cf6429c53b111fb85a07fdf9a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/309/commits","review_comments_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/309/comments","review_comment_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/sale-workflow/issues/309/comments","statuses_url":"https://api.github.com/repos/OCA/sale-workflow/statuses/0eab6ba0e64d6a59ccd66c48b3b70f9612e93269","head":{"label":"mdietrichc2c:8.0-fix-payment-term-interest","ref":"8.0-fix-payment-term-interest","sha":"0eab6ba0e64d6a59ccd66c48b3b70f9612e93269","user":{"login":"mdietrichc2c","id":7628281,"avatar_url":"https://avatars.githubusercontent.com/u/7628281?v=3","gravatar_id":"","url":"https://api.github.com/users/mdietrichc2c","html_url":"https://github.com/mdietrichc2c","followers_url":"https://api.github.com/users/mdietrichc2c/followers","following_url":"https://api.github.com/users/mdietrichc2c/following{/other_user}","gists_url":"https://api.github.com/users/mdietrichc2c/gists{/gist_id}","starred_url":"https://api.github.com/users/mdietrichc2c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdietrichc2c/subscriptions","organizations_url":"https://api.github.com/users/mdietrichc2c/orgs","repos_url":"https://api.github.com/users/mdietrichc2c/repos","events_url":"https://api.github.com/users/mdietrichc2c/events{/privacy}","received_events_url":"https://api.github.com/users/mdietrichc2c/received_events","type":"User","site_admin":false},"repo":{"id":35956338,"name":"sale-workflow","full_name":"mdietrichc2c/sale-workflow","owner":{"login":"mdietrichc2c","id":7628281,"avatar_url":"https://avatars.githubusercontent.com/u/7628281?v=3","gravatar_id":"","url":"https://api.github.com/users/mdietrichc2c","html_url":"https://github.com/mdietrichc2c","followers_url":"https://api.github.com/users/mdietrichc2c/followers","following_url":"https://api.github.com/users/mdietrichc2c/following{/other_user}","gists_url":"https://api.github.com/users/mdietrichc2c/gists{/gist_id}","starred_url":"https://api.github.com/users/mdietrichc2c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdietrichc2c/subscriptions","organizations_url":"https://api.github.com/users/mdietrichc2c/orgs","repos_url":"https://api.github.com/users/mdietrichc2c/repos","events_url":"https://api.github.com/users/mdietrichc2c/events{/privacy}","received_events_url":"https://api.github.com/users/mdietrichc2c/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mdietrichc2c/sale-workflow","description":"Odoo Sales, Workflow and Organization","fork":true,"url":"https://api.github.com/repos/mdietrichc2c/sale-workflow","forks_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/forks","keys_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/teams","hooks_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/events","assignees_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/tags","blobs_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/subscription","commits_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/merges","archive_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/downloads","issues_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/releases{/id}","deployments_url":"https://api.github.com/repos/mdietrichc2c/sale-workflow/deployments","created_at":"2015-05-20T15:21:57Z","updated_at":"2015-05-20T15:21:58Z","pushed_at":"2016-06-09T07:33:25Z","git_url":"git://github.com/mdietrichc2c/sale-workflow.git","ssh_url":"git@github.com:mdietrichc2c/sale-workflow.git","clone_url":"https://github.com/mdietrichc2c/sale-workflow.git","svn_url":"https://github.com/mdietrichc2c/sale-workflow","homepage":"","size":2721,"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":"8.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"fd6ab01cf944d62bf392c7ff32e9cbcd163dff9b","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":20882412,"name":"sale-workflow","full_name":"OCA/sale-workflow","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/sale-workflow","description":"Odoo Sales, Workflow and Organization","fork":false,"url":"https://api.github.com/repos/OCA/sale-workflow","forks_url":"https://api.github.com/repos/OCA/sale-workflow/forks","keys_url":"https://api.github.com/repos/OCA/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/sale-workflow/teams","hooks_url":"https://api.github.com/repos/OCA/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/OCA/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/sale-workflow/events","assignees_url":"https://api.github.com/repos/OCA/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/sale-workflow/tags","blobs_url":"https://api.github.com/repos/OCA/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/OCA/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/OCA/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/OCA/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/OCA/sale-workflow/subscription","commits_url":"https://api.github.com/repos/OCA/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/sale-workflow/merges","archive_url":"https://api.github.com/repos/OCA/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/sale-workflow/downloads","issues_url":"https://api.github.com/repos/OCA/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/OCA/sale-workflow/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/sale-workflow/deployments","created_at":"2014-06-16T11:26:39Z","updated_at":"2016-04-08T21:52:48Z","pushed_at":"2016-06-09T07:38:18Z","git_url":"git://github.com/OCA/sale-workflow.git","ssh_url":"git@github.com:OCA/sale-workflow.git","clone_url":"https://github.com/OCA/sale-workflow.git","svn_url":"https://github.com/OCA/sale-workflow","homepage":"","size":4809,"stargazers_count":32,"watchers_count":32,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":85,"forks":156,"open_issues":85,"watchers":32,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/309"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/309"},"issue":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/309"},"comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/sale-workflow/statuses/0eab6ba0e64d6a59ccd66c48b3b70f9612e93269"}}}}
{"actor":{"display_login":"guewen"}}