{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/38180829","id":38180829,"diff_hunk":"@@ -0,0 +1,25 @@\n+# -*- coding: utf-8 -*-\n+# (c) 2014 Carlos Sánchez Cifuentes <csanchez@grupovermon.com>\n+# (c) 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\n+# (c) 2015 Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>\n+# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n+\n+from openerp import models, api\n+\n+\n+class SaleOrder(models.Model):\n+    _inherit = 'sale.order'\n+\n+    @api.multi\n+    def recalculate_prices(self):\n+        for line in self.mapped('order_line'):\n+            order = line.order_id\n+            res = line.product_id_change(\n+                order.pricelist_id.id, line.product_id.id,\n+                qty=line.product_uom_qty, uom=False,\n+                qty_uos=line.product_uos_qty, uos=False, name=line.name,\n+                partner_id=order.partner_id.id, lang=False, update_tax=True,\n+                date_order=order.date_order, packaging=False,\n+                fiscal_position=order.fiscal_position.id, flag=False)","path":"sale_order_price_recalculation/models/sale_order.py","position":23,"original_position":23,"commit_id":"c801f40f405333d6479520be98a651da9b029c47","original_commit_id":"c801f40f405333d6479520be98a651da9b029c47","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"body":"I've just tested this on the runbot and I confirm it does not work\r\n\r\nSteps to reproduce:\r\n\r\n0. activate \"manage UoM\" in sales settings\r\n1. create a sale order\r\n2. add a sale order line for 2 dozens TONER\r\n3. click \"recalculate prices\"\r\n\r\nExpected result:\r\n\r\n* nothing changes\r\n\r\nActual result: \r\n\r\n* the sale order is updated to a sale of 2 Unites TONER\r\n\r\n\r\n==> needs fixing. ","created_at":"2015-08-28T08:45:24Z","updated_at":"2015-08-28T08:45:24Z","html_url":"https://github.com/OCA/sale-workflow/pull/54#discussion_r38180829","pull_request_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/38180829"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/54#discussion_r38180829"},"pull_request":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/54","id":23676441,"html_url":"https://github.com/OCA/sale-workflow/pull/54","diff_url":"https://github.com/OCA/sale-workflow/pull/54.diff","patch_url":"https://github.com/OCA/sale-workflow/pull/54.patch","issue_url":"https://api.github.com/repos/OCA/sale-workflow/issues/54","number":54,"state":"open","locked":false,"title":"[ADD] sale_order_price_recalculation: Module to allow to recalculate on demand sale order line prices","user":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"body":"==================================================\r\nRecalculation of sale order lines prices on demand\r\n==================================================\r\n\r\nThis module adds a button on sale orders below pricelist that recalculates the\r\nprices of the order lines that contain a product in them.\r\n\r\nIt is launched manually as a button to get the user decide if he/she wants to\r\nrecalculate prices when pricelist is changed.\r\n\r\nUsage\r\n=====\r\n\r\nInside a sale order, you can click in any moment a button called\r\n\"(Recalculate prices)\", that is next to the pricelist selection, to launch\r\na recalculation of all the prices of the lines, losing previous custom prices.\r\n\r\nKnown issues / Roadmap\r\n======================\r\n\r\n* In a sale order with lot of lines, the recalculation may slow down, because\r\n  sale general data (amount untaxed, amount taxed...) are recalculated for\r\n  each line.","created_at":"2014-10-31T13:42:12Z","updated_at":"2015-08-28T08:45:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1543d723fe846470644049ee2a1433a4cdf1b712","assignee":null,"milestone":{"url":"https://api.github.com/repos/OCA/sale-workflow/milestones/3","html_url":"https://github.com/OCA/sale-workflow/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/sale-workflow/milestones/3/labels","id":999334,"number":3,"title":"8.0","description":"","creator":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":12,"state":"open","created_at":"2015-02-27T20:13:18Z","updated_at":"2015-08-06T10:59:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/54/commits","review_comments_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/54/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/54/comments","statuses_url":"https://api.github.com/repos/OCA/sale-workflow/statuses/c801f40f405333d6479520be98a651da9b029c47","head":{"label":"pedrobaeza:8.0-sale_order_recalculate_prices","ref":"8.0-sale_order_recalculate_prices","sha":"c801f40f405333d6479520be98a651da9b029c47","user":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"repo":{"id":22740106,"name":"sale-workflow","full_name":"pedrobaeza/sale-workflow","owner":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pedrobaeza/sale-workflow","description":"","fork":true,"url":"https://api.github.com/repos/pedrobaeza/sale-workflow","forks_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/forks","keys_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/teams","hooks_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/events","assignees_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/tags","blobs_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/subscription","commits_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/merges","archive_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/downloads","issues_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/pedrobaeza/sale-workflow/releases{/id}","created_at":"2014-08-07T23:48:18Z","updated_at":"2014-06-30T13:17:50Z","pushed_at":"2015-08-28T06:52:57Z","git_url":"git://github.com/pedrobaeza/sale-workflow.git","ssh_url":"git@github.com:pedrobaeza/sale-workflow.git","clone_url":"https://github.com/pedrobaeza/sale-workflow.git","svn_url":"https://github.com/pedrobaeza/sale-workflow","homepage":null,"size":1003,"stargazers_count":0,"watchers_count":0,"language":null,"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":"master"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"4a8563ce676dc79ac365e4b19dc0f55286fd32f3","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}","created_at":"2014-06-16T11:26:39Z","updated_at":"2015-08-13T14:29:37Z","pushed_at":"2015-08-28T06:57:54Z","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":4173,"stargazers_count":18,"watchers_count":18,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":58,"forks":89,"open_issues":58,"watchers":18,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/54"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/54"},"issue":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/54"},"comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/54/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/54/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/sale-workflow/statuses/c801f40f405333d6479520be98a651da9b029c47"}}}}