{"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/56953600","id":56953600,"diff_hunk":"@@ -786,8 +792,14 @@ def _get_purchase_order_date(self, cr, uid, procurement, company, schedule_date,\n            :rtype: datetime\n            :return: the desired Order Date for the PO\n         \"\"\"\n-        seller_delay = int(procurement.product_id._select_seller(procurement.product_id).delay)\n-        return schedule_date - relativedelta(days=seller_delay)\n+\n+        seller = procurement.product_id._select_seller(\n+            procurement.product_id,\n+            quantity=procurement.product_qty,\n+            date=schedule_date.strftime(DEFAULT_SERVER_DATETIME_FORMAT)[:10],","path":"addons/purchase/purchase.py","position":27,"original_position":27,"commit_id":"fc9362c7e09e60c31c0123d52b2c7633f8fe0aaf","original_commit_id":"fc9362c7e09e60c31c0123d52b2c7633f8fe0aaf","user":{"login":"andreparames","id":206160,"avatar_url":"https://avatars.githubusercontent.com/u/206160?v=3","gravatar_id":"","url":"https://api.github.com/users/andreparames","html_url":"https://github.com/andreparames","followers_url":"https://api.github.com/users/andreparames/followers","following_url":"https://api.github.com/users/andreparames/following{/other_user}","gists_url":"https://api.github.com/users/andreparames/gists{/gist_id}","starred_url":"https://api.github.com/users/andreparames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreparames/subscriptions","organizations_url":"https://api.github.com/users/andreparames/orgs","repos_url":"https://api.github.com/users/andreparames/repos","events_url":"https://api.github.com/users/andreparames/events{/privacy}","received_events_url":"https://api.github.com/users/andreparames/received_events","type":"User","site_admin":false},"body":"Suggestion: if you just want the date part, use `schedule_date.strftime(DEFAULT_SERVER_DATE_FORMAT)` instead of cutting part of the string.","created_at":"2016-03-22T09:02:22Z","updated_at":"2016-03-22T09:02:22Z","html_url":"https://github.com/odoo/odoo/pull/11414#discussion_r56953600","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/11414","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/56953600"},"html":{"href":"https://github.com/odoo/odoo/pull/11414#discussion_r56953600"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/11414"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/11414","id":63456513,"html_url":"https://github.com/odoo/odoo/pull/11414","diff_url":"https://github.com/odoo/odoo/pull/11414.diff","patch_url":"https://github.com/odoo/odoo/pull/11414.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/11414","number":11414,"state":"open","locked":false,"title":"[FIX] _select_seller returns incorrect seller","user":{"login":"scosist","id":8325184,"avatar_url":"https://avatars.githubusercontent.com/u/8325184?v=3","gravatar_id":"","url":"https://api.github.com/users/scosist","html_url":"https://github.com/scosist","followers_url":"https://api.github.com/users/scosist/followers","following_url":"https://api.github.com/users/scosist/following{/other_user}","gists_url":"https://api.github.com/users/scosist/gists{/gist_id}","starred_url":"https://api.github.com/users/scosist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scosist/subscriptions","organizations_url":"https://api.github.com/users/scosist/orgs","repos_url":"https://api.github.com/users/scosist/repos","events_url":"https://api.github.com/users/scosist/events{/privacy}","received_events_url":"https://api.github.com/users/scosist/received_events","type":"User","site_admin":false},"body":"**Description of the issue/feature this PR addresses:**\r\nThe `_select_seller` method returns incorrect seller.\r\n\r\n**Current behavior before PR:**\r\nThe result of `_select_seller` is potentially inconsistent when dealing with multiple sellers (`product_supplierinfo`).\r\n\r\n**Desired behavior after PR is merged:**\r\nIf the data is available in the current context it should be passed to\r\n`_select_seller`. The parameters used to call `_select_seller` throughout the lifetime of a\r\npurchase should be consistent (as possible).\r\n\r\nThis is related to #11413.\r\n\r\n--\r\nI confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr","created_at":"2016-03-19T02:29:25Z","updated_at":"2016-03-22T09:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"483a7d5f338892f85a03a951d7513fddb94f7231","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/11414/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/11414/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/11414/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/fc9362c7e09e60c31c0123d52b2c7633f8fe0aaf","head":{"label":"asphaltzipper:master-product-select-seller","ref":"master-product-select-seller","sha":"fc9362c7e09e60c31c0123d52b2c7633f8fe0aaf","user":{"login":"asphaltzipper","id":8421545,"avatar_url":"https://avatars.githubusercontent.com/u/8421545?v=3","gravatar_id":"","url":"https://api.github.com/users/asphaltzipper","html_url":"https://github.com/asphaltzipper","followers_url":"https://api.github.com/users/asphaltzipper/followers","following_url":"https://api.github.com/users/asphaltzipper/following{/other_user}","gists_url":"https://api.github.com/users/asphaltzipper/gists{/gist_id}","starred_url":"https://api.github.com/users/asphaltzipper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asphaltzipper/subscriptions","organizations_url":"https://api.github.com/users/asphaltzipper/orgs","repos_url":"https://api.github.com/users/asphaltzipper/repos","events_url":"https://api.github.com/users/asphaltzipper/events{/privacy}","received_events_url":"https://api.github.com/users/asphaltzipper/received_events","type":"Organization","site_admin":false},"repo":{"id":23207627,"name":"odoo","full_name":"asphaltzipper/odoo","owner":{"login":"asphaltzipper","id":8421545,"avatar_url":"https://avatars.githubusercontent.com/u/8421545?v=3","gravatar_id":"","url":"https://api.github.com/users/asphaltzipper","html_url":"https://github.com/asphaltzipper","followers_url":"https://api.github.com/users/asphaltzipper/followers","following_url":"https://api.github.com/users/asphaltzipper/following{/other_user}","gists_url":"https://api.github.com/users/asphaltzipper/gists{/gist_id}","starred_url":"https://api.github.com/users/asphaltzipper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asphaltzipper/subscriptions","organizations_url":"https://api.github.com/users/asphaltzipper/orgs","repos_url":"https://api.github.com/users/asphaltzipper/repos","events_url":"https://api.github.com/users/asphaltzipper/events{/privacy}","received_events_url":"https://api.github.com/users/asphaltzipper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/asphaltzipper/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":true,"url":"https://api.github.com/repos/asphaltzipper/odoo","forks_url":"https://api.github.com/repos/asphaltzipper/odoo/forks","keys_url":"https://api.github.com/repos/asphaltzipper/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asphaltzipper/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asphaltzipper/odoo/teams","hooks_url":"https://api.github.com/repos/asphaltzipper/odoo/hooks","issue_events_url":"https://api.github.com/repos/asphaltzipper/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/asphaltzipper/odoo/events","assignees_url":"https://api.github.com/repos/asphaltzipper/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/asphaltzipper/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/asphaltzipper/odoo/tags","blobs_url":"https://api.github.com/repos/asphaltzipper/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asphaltzipper/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asphaltzipper/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/asphaltzipper/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asphaltzipper/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/asphaltzipper/odoo/languages","stargazers_url":"https://api.github.com/repos/asphaltzipper/odoo/stargazers","contributors_url":"https://api.github.com/repos/asphaltzipper/odoo/contributors","subscribers_url":"https://api.github.com/repos/asphaltzipper/odoo/subscribers","subscription_url":"https://api.github.com/repos/asphaltzipper/odoo/subscription","commits_url":"https://api.github.com/repos/asphaltzipper/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/asphaltzipper/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/asphaltzipper/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/asphaltzipper/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/asphaltzipper/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/asphaltzipper/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asphaltzipper/odoo/merges","archive_url":"https://api.github.com/repos/asphaltzipper/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asphaltzipper/odoo/downloads","issues_url":"https://api.github.com/repos/asphaltzipper/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/asphaltzipper/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/asphaltzipper/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/asphaltzipper/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asphaltzipper/odoo/labels{/name}","releases_url":"https://api.github.com/repos/asphaltzipper/odoo/releases{/id}","deployments_url":"https://api.github.com/repos/asphaltzipper/odoo/deployments","created_at":"2014-08-22T00:34:53Z","updated_at":"2015-04-23T14:35:29Z","pushed_at":"2016-03-19T02:21:14Z","git_url":"git://github.com/asphaltzipper/odoo.git","ssh_url":"git@github.com:asphaltzipper/odoo.git","clone_url":"https://github.com/asphaltzipper/odoo.git","svn_url":"https://github.com/asphaltzipper/odoo","homepage":"https://www.odoo.com","size":1254390,"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":"master"}},"base":{"label":"odoo:master","ref":"master","sha":"cdc26d14bd8e346fe054782e181310ae35072cdc","user":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"repo":{"id":19745004,"name":"odoo","full_name":"odoo/odoo","owner":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":false,"url":"https://api.github.com/repos/odoo/odoo","forks_url":"https://api.github.com/repos/odoo/odoo/forks","keys_url":"https://api.github.com/repos/odoo/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo/odoo/teams","hooks_url":"https://api.github.com/repos/odoo/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo/odoo/events","assignees_url":"https://api.github.com/repos/odoo/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo/odoo/tags","blobs_url":"https://api.github.com/repos/odoo/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo/odoo/subscription","commits_url":"https://api.github.com/repos/odoo/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoo/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo/odoo/merges","archive_url":"https://api.github.com/repos/odoo/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo/odoo/downloads","issues_url":"https://api.github.com/repos/odoo/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo/odoo/releases{/id}","deployments_url":"https://api.github.com/repos/odoo/odoo/deployments","created_at":"2014-05-13T15:38:58Z","updated_at":"2016-03-22T08:05:20Z","pushed_at":"2016-03-22T08:43:36Z","git_url":"git://github.com/odoo/odoo.git","ssh_url":"git@github.com:odoo/odoo.git","clone_url":"https://github.com/odoo/odoo.git","svn_url":"https://github.com/odoo/odoo","homepage":"https://www.odoo.com","size":1559570,"stargazers_count":3968,"watchers_count":3968,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3805,"mirror_url":null,"open_issues_count":3238,"forks":3805,"open_issues":3238,"watchers":3968,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/11414"},"html":{"href":"https://github.com/odoo/odoo/pull/11414"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/11414"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/11414/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/11414/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/11414/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/fc9362c7e09e60c31c0123d52b2c7633f8fe0aaf"}}}}