{"action":"created","comment":{"url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/comments/91740767","pull_request_review_id":12251915,"id":91740767,"diff_hunk":"@@ -0,0 +1,102 @@\n+# coding: utf-8\n+#  @author Raphael Reverdy <raphael.reverdy@akretion.com>\n+#          David BEAL <david.beal@akretion.com>\n+#           EBII MonsieurB <monsieurb@saaslys.com>\n+#          Sébastien BEAU\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+from openerp import _, api, models\n+import logging\n+import json\n+\n+_logger = logging.getLogger(__name__)\n+\n+\n+class StockQuantPackage(models.Model):\n+    _inherit = 'stock.quant.package'\n+\n+    def _geodis_before_call(self, picking, request):\n+        def calc_package_price():\n+            return sum(\n+                [op.product_id.list_price * op.product_qty\n+                    for op in self.get_operations()]\n+            )\n+        # TODO _get_options is called fo each package by the result\n+        # is the same. Should be store after first call\n+        # chercher key chain\n+        account = self._geodis_get_account()\n+        service = json.loads(account.data)\n+        # import pdb\n+        # pdb.set_trace()\n+        request['service']['customerId'] = service['customerId']\n+        request['service']['agencyId'] = service['agencyId']\n+        sequence = self.env['ir.sequence'].next_by_code(\"geodis.nrecep.number\")\n+\n+        # this is prefixe by year_ so split it for use in shp: info\n+        shp = sequence.split('_')\n+        request['service']['shippingId'] = str(shp[1])\n+        # _logger.warning(\"request : %s\", (request) )\n+        return request\n+\n+    def _geodis_after_call(self, picking, response):\n+        # import pdb; pdb.set_trace()\n+        custom_response = {\n+            'name': response['barcode'],\n+            'data': response.get('label'),\n+        }\n+        if response.get('url'):\n+            custom_response['url'] = response['url']\n+            custom_response['type'] = 'url'\n+        self.parcel_tracking = response['barcode']\n+        return custom_response\n+\n+    @api.multi\n+    def _geodis_get_account(self):","path":"delivery_roulier_geodis/models/stock_package.py","position":54,"original_position":54,"commit_id":"29e092b31a04beb64146d6359ffc1e59be4aa236","original_commit_id":"29e092b31a04beb64146d6359ffc1e59be4aa236","user":{"login":"hparfr","id":8331206,"avatar_url":"https://avatars.githubusercontent.com/u/8331206?v=3","gravatar_id":"","url":"https://api.github.com/users/hparfr","html_url":"https://github.com/hparfr","followers_url":"https://api.github.com/users/hparfr/followers","following_url":"https://api.github.com/users/hparfr/following{/other_user}","gists_url":"https://api.github.com/users/hparfr/gists{/gist_id}","starred_url":"https://api.github.com/users/hparfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hparfr/subscriptions","organizations_url":"https://api.github.com/users/hparfr/orgs","repos_url":"https://api.github.com/users/hparfr/repos","events_url":"https://api.github.com/users/hparfr/events{/privacy}","received_events_url":"https://api.github.com/users/hparfr/received_events","type":"User","site_admin":false},"body":"à virer car déjà dans picking","created_at":"2016-12-09T15:52:59Z","updated_at":"2016-12-09T15:52:59Z","html_url":"https://github.com/akretion/delivery-carrier/pull/37#discussion_r91740767","pull_request_url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/comments/91740767"},"html":{"href":"https://github.com/akretion/delivery-carrier/pull/37#discussion_r91740767"},"pull_request":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37","id":96970137,"html_url":"https://github.com/akretion/delivery-carrier/pull/37","diff_url":"https://github.com/akretion/delivery-carrier/pull/37.diff","patch_url":"https://github.com/akretion/delivery-carrier/pull/37.patch","issue_url":"https://api.github.com/repos/akretion/delivery-carrier/issues/37","number":37,"state":"open","locked":false,"title":"V9 geodis","user":{"login":"EBII","id":4985100,"avatar_url":"https://avatars.githubusercontent.com/u/4985100?v=3","gravatar_id":"","url":"https://api.github.com/users/EBII","html_url":"https://github.com/EBII","followers_url":"https://api.github.com/users/EBII/followers","following_url":"https://api.github.com/users/EBII/following{/other_user}","gists_url":"https://api.github.com/users/EBII/gists{/gist_id}","starred_url":"https://api.github.com/users/EBII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBII/subscriptions","organizations_url":"https://api.github.com/users/EBII/orgs","repos_url":"https://api.github.com/users/EBII/repos","events_url":"https://api.github.com/users/EBII/events{/privacy}","received_events_url":"https://api.github.com/users/EBII/received_events","type":"User","site_admin":false},"body":"for one account only ","created_at":"2016-12-07T17:28:39Z","updated_at":"2016-12-09T15:54:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69c54c3bd1160dc6e53cd801145a87bb20678bfe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37/commits","review_comments_url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37/comments","review_comment_url":"https://api.github.com/repos/akretion/delivery-carrier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akretion/delivery-carrier/issues/37/comments","statuses_url":"https://api.github.com/repos/akretion/delivery-carrier/statuses/29e092b31a04beb64146d6359ffc1e59be4aa236","head":{"label":"EBII:V9-geodis","ref":"V9-geodis","sha":"29e092b31a04beb64146d6359ffc1e59be4aa236","user":{"login":"EBII","id":4985100,"avatar_url":"https://avatars.githubusercontent.com/u/4985100?v=3","gravatar_id":"","url":"https://api.github.com/users/EBII","html_url":"https://github.com/EBII","followers_url":"https://api.github.com/users/EBII/followers","following_url":"https://api.github.com/users/EBII/following{/other_user}","gists_url":"https://api.github.com/users/EBII/gists{/gist_id}","starred_url":"https://api.github.com/users/EBII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBII/subscriptions","organizations_url":"https://api.github.com/users/EBII/orgs","repos_url":"https://api.github.com/users/EBII/repos","events_url":"https://api.github.com/users/EBII/events{/privacy}","received_events_url":"https://api.github.com/users/EBII/received_events","type":"User","site_admin":false},"repo":{"id":75837810,"name":"delivery-carrier","full_name":"EBII/delivery-carrier","owner":{"login":"EBII","id":4985100,"avatar_url":"https://avatars.githubusercontent.com/u/4985100?v=3","gravatar_id":"","url":"https://api.github.com/users/EBII","html_url":"https://github.com/EBII","followers_url":"https://api.github.com/users/EBII/followers","following_url":"https://api.github.com/users/EBII/following{/other_user}","gists_url":"https://api.github.com/users/EBII/gists{/gist_id}","starred_url":"https://api.github.com/users/EBII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBII/subscriptions","organizations_url":"https://api.github.com/users/EBII/orgs","repos_url":"https://api.github.com/users/EBII/repos","events_url":"https://api.github.com/users/EBII/events{/privacy}","received_events_url":"https://api.github.com/users/EBII/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EBII/delivery-carrier","description":null,"fork":true,"url":"https://api.github.com/repos/EBII/delivery-carrier","forks_url":"https://api.github.com/repos/EBII/delivery-carrier/forks","keys_url":"https://api.github.com/repos/EBII/delivery-carrier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBII/delivery-carrier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBII/delivery-carrier/teams","hooks_url":"https://api.github.com/repos/EBII/delivery-carrier/hooks","issue_events_url":"https://api.github.com/repos/EBII/delivery-carrier/issues/events{/number}","events_url":"https://api.github.com/repos/EBII/delivery-carrier/events","assignees_url":"https://api.github.com/repos/EBII/delivery-carrier/assignees{/user}","branches_url":"https://api.github.com/repos/EBII/delivery-carrier/branches{/branch}","tags_url":"https://api.github.com/repos/EBII/delivery-carrier/tags","blobs_url":"https://api.github.com/repos/EBII/delivery-carrier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBII/delivery-carrier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBII/delivery-carrier/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBII/delivery-carrier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBII/delivery-carrier/statuses/{sha}","languages_url":"https://api.github.com/repos/EBII/delivery-carrier/languages","stargazers_url":"https://api.github.com/repos/EBII/delivery-carrier/stargazers","contributors_url":"https://api.github.com/repos/EBII/delivery-carrier/contributors","subscribers_url":"https://api.github.com/repos/EBII/delivery-carrier/subscribers","subscription_url":"https://api.github.com/repos/EBII/delivery-carrier/subscription","commits_url":"https://api.github.com/repos/EBII/delivery-carrier/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBII/delivery-carrier/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBII/delivery-carrier/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBII/delivery-carrier/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBII/delivery-carrier/contents/{+path}","compare_url":"https://api.github.com/repos/EBII/delivery-carrier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBII/delivery-carrier/merges","archive_url":"https://api.github.com/repos/EBII/delivery-carrier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBII/delivery-carrier/downloads","issues_url":"https://api.github.com/repos/EBII/delivery-carrier/issues{/number}","pulls_url":"https://api.github.com/repos/EBII/delivery-carrier/pulls{/number}","milestones_url":"https://api.github.com/repos/EBII/delivery-carrier/milestones{/number}","notifications_url":"https://api.github.com/repos/EBII/delivery-carrier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBII/delivery-carrier/labels{/name}","releases_url":"https://api.github.com/repos/EBII/delivery-carrier/releases{/id}","deployments_url":"https://api.github.com/repos/EBII/delivery-carrier/deployments","created_at":"2016-12-07T13:19:39Z","updated_at":"2016-12-07T13:19:42Z","pushed_at":"2016-12-07T17:26:53Z","git_url":"git://github.com/EBII/delivery-carrier.git","ssh_url":"git@github.com:EBII/delivery-carrier.git","clone_url":"https://github.com/EBII/delivery-carrier.git","svn_url":"https://github.com/EBII/delivery-carrier","homepage":null,"size":4056,"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-roulier"}},"base":{"label":"akretion:9-roulier","ref":"9-roulier","sha":"4c5b836a4cc30abe8a4d845dff89adad3add4fe0","user":{"login":"akretion","id":1853423,"avatar_url":"https://avatars.githubusercontent.com/u/1853423?v=3","gravatar_id":"","url":"https://api.github.com/users/akretion","html_url":"https://github.com/akretion","followers_url":"https://api.github.com/users/akretion/followers","following_url":"https://api.github.com/users/akretion/following{/other_user}","gists_url":"https://api.github.com/users/akretion/gists{/gist_id}","starred_url":"https://api.github.com/users/akretion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akretion/subscriptions","organizations_url":"https://api.github.com/users/akretion/orgs","repos_url":"https://api.github.com/users/akretion/repos","events_url":"https://api.github.com/users/akretion/events{/privacy}","received_events_url":"https://api.github.com/users/akretion/received_events","type":"Organization","site_admin":false},"repo":{"id":21564876,"name":"delivery-carrier","full_name":"akretion/delivery-carrier","owner":{"login":"akretion","id":1853423,"avatar_url":"https://avatars.githubusercontent.com/u/1853423?v=3","gravatar_id":"","url":"https://api.github.com/users/akretion","html_url":"https://github.com/akretion","followers_url":"https://api.github.com/users/akretion/followers","following_url":"https://api.github.com/users/akretion/following{/other_user}","gists_url":"https://api.github.com/users/akretion/gists{/gist_id}","starred_url":"https://api.github.com/users/akretion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akretion/subscriptions","organizations_url":"https://api.github.com/users/akretion/orgs","repos_url":"https://api.github.com/users/akretion/repos","events_url":"https://api.github.com/users/akretion/events{/privacy}","received_events_url":"https://api.github.com/users/akretion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akretion/delivery-carrier","description":null,"fork":true,"url":"https://api.github.com/repos/akretion/delivery-carrier","forks_url":"https://api.github.com/repos/akretion/delivery-carrier/forks","keys_url":"https://api.github.com/repos/akretion/delivery-carrier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akretion/delivery-carrier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akretion/delivery-carrier/teams","hooks_url":"https://api.github.com/repos/akretion/delivery-carrier/hooks","issue_events_url":"https://api.github.com/repos/akretion/delivery-carrier/issues/events{/number}","events_url":"https://api.github.com/repos/akretion/delivery-carrier/events","assignees_url":"https://api.github.com/repos/akretion/delivery-carrier/assignees{/user}","branches_url":"https://api.github.com/repos/akretion/delivery-carrier/branches{/branch}","tags_url":"https://api.github.com/repos/akretion/delivery-carrier/tags","blobs_url":"https://api.github.com/repos/akretion/delivery-carrier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akretion/delivery-carrier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akretion/delivery-carrier/git/refs{/sha}","trees_url":"https://api.github.com/repos/akretion/delivery-carrier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akretion/delivery-carrier/statuses/{sha}","languages_url":"https://api.github.com/repos/akretion/delivery-carrier/languages","stargazers_url":"https://api.github.com/repos/akretion/delivery-carrier/stargazers","contributors_url":"https://api.github.com/repos/akretion/delivery-carrier/contributors","subscribers_url":"https://api.github.com/repos/akretion/delivery-carrier/subscribers","subscription_url":"https://api.github.com/repos/akretion/delivery-carrier/subscription","commits_url":"https://api.github.com/repos/akretion/delivery-carrier/commits{/sha}","git_commits_url":"https://api.github.com/repos/akretion/delivery-carrier/git/commits{/sha}","comments_url":"https://api.github.com/repos/akretion/delivery-carrier/comments{/number}","issue_comment_url":"https://api.github.com/repos/akretion/delivery-carrier/issues/comments{/number}","contents_url":"https://api.github.com/repos/akretion/delivery-carrier/contents/{+path}","compare_url":"https://api.github.com/repos/akretion/delivery-carrier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akretion/delivery-carrier/merges","archive_url":"https://api.github.com/repos/akretion/delivery-carrier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akretion/delivery-carrier/downloads","issues_url":"https://api.github.com/repos/akretion/delivery-carrier/issues{/number}","pulls_url":"https://api.github.com/repos/akretion/delivery-carrier/pulls{/number}","milestones_url":"https://api.github.com/repos/akretion/delivery-carrier/milestones{/number}","notifications_url":"https://api.github.com/repos/akretion/delivery-carrier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akretion/delivery-carrier/labels{/name}","releases_url":"https://api.github.com/repos/akretion/delivery-carrier/releases{/id}","deployments_url":"https://api.github.com/repos/akretion/delivery-carrier/deployments","created_at":"2014-07-07T09:23:52Z","updated_at":"2016-11-01T09:07:10Z","pushed_at":"2016-12-07T17:28:39Z","git_url":"git://github.com/akretion/delivery-carrier.git","ssh_url":"git@github.com:akretion/delivery-carrier.git","clone_url":"https://github.com/akretion/delivery-carrier.git","svn_url":"https://github.com/akretion/delivery-carrier","homepage":null,"size":4051,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"8-roulier"}},"_links":{"self":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37"},"html":{"href":"https://github.com/akretion/delivery-carrier/pull/37"},"issue":{"href":"https://api.github.com/repos/akretion/delivery-carrier/issues/37"},"comments":{"href":"https://api.github.com/repos/akretion/delivery-carrier/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akretion/delivery-carrier/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/akretion/delivery-carrier/statuses/29e092b31a04beb64146d6359ffc1e59be4aa236"}}}}
{"actor":{"display_login":"hparfr"}}