{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/comments/28974644","id":28974644,"diff_hunk":"@@ -0,0 +1,112 @@\n+# -*- coding: utf-8 -*-\n+##############################################################################\n+#\n+#    Copyright (C) 2014 initOS GmbH & Co. KG (<http://www.initos.com>).\n+#\n+#    This program is free software: you can redistribute it and/or modify\n+#    it under the terms of the GNU Affero General Public License as\n+#    published by the Free Software Foundation, either version 3 of the\n+#    License, or (at your option) any later version.\n+#\n+#    This program is distributed in the hope that it will be useful,\n+#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+#    GNU Affero General Public License for more details.\n+#\n+#    You should have received a copy of the GNU Affero General Public License\n+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+##############################################################################\n+\n+\n+from openerp.osv import orm\n+from openerp.netsvc import LocalService\n+\n+\n+class StockInternalTransfer(orm.TransientModel):\n+    _inherit = 'stock.internal.transfer'\n+\n+    def _prepare_picking(self, cr, uid, ids, context=None):\n+        assert len(ids) == 1,\\\n+            'This function should only be used for a single id at a time.'\n+\n+        picking_data = super(StockInternalTransfer, self).\\\n+            _prepare_picking(cr, uid, ids, context=context)\n+        wiz = self.browse(cr, uid, ids[0], context=context)\n+\n+        no_transit = context and \\\n+            context.get('stock_internal_transfer_no_transit', False)\n+        if wiz.mode == 'force' or no_transit:\n+            return picking_data\n+\n+        # update destination location to transfer using\n+        # intermediate transit stock location\n+        model_data_obj = self.pool['ir.model.data']\n+        stock_loc_transit_id = model_data_obj.\\\n+            get_object_reference(cr, uid, 'stock_internal_transfer_transit',\n+                                 'stock_location_transit')[1]","path":"stock_internal_transfer_transit/stock_internal_transfer.py","position":45,"original_position":47,"commit_id":"dec569907df3e341e53060f1a71177ed02c78816","original_commit_id":"1f29fd70529b0024a84b7d317e5e7280e1d3d55f","user":{"login":"codingforfun","id":1388003,"avatar_url":"https://avatars.githubusercontent.com/u/1388003?v=3","gravatar_id":"","url":"https://api.github.com/users/codingforfun","html_url":"https://github.com/codingforfun","followers_url":"https://api.github.com/users/codingforfun/followers","following_url":"https://api.github.com/users/codingforfun/following{/other_user}","gists_url":"https://api.github.com/users/codingforfun/gists{/gist_id}","starred_url":"https://api.github.com/users/codingforfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingforfun/subscriptions","organizations_url":"https://api.github.com/users/codingforfun/orgs","repos_url":"https://api.github.com/users/codingforfun/repos","events_url":"https://api.github.com/users/codingforfun/events{/privacy}","received_events_url":"https://api.github.com/users/codingforfun/received_events","type":"User","site_admin":false},"body":"Ok. I'm not experienced with multi-company setup. Why do you think it won't work and would be the problem?\r\nOf course it uses the same transfer location for all companies in this case but I think the basic behaviour should work. Any idea how I could solve this in a more clean way i.e. on a by company basis? ","created_at":"2015-04-23T15:41:15Z","updated_at":"2015-04-23T15:41:15Z","html_url":"https://github.com/OCA/stock-logistics-warehouse/pull/28#discussion_r28974644","pull_request_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/comments/28974644"},"html":{"href":"https://github.com/OCA/stock-logistics-warehouse/pull/28#discussion_r28974644"},"pull_request":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28","id":25985923,"html_url":"https://github.com/OCA/stock-logistics-warehouse/pull/28","diff_url":"https://github.com/OCA/stock-logistics-warehouse/pull/28.diff","patch_url":"https://github.com/OCA/stock-logistics-warehouse/pull/28.patch","issue_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/28","number":28,"state":"open","locked":false,"title":"Add new modules for simplified transfer of goods between stock locations...","user":{"login":"codingforfun","id":1388003,"avatar_url":"https://avatars.githubusercontent.com/u/1388003?v=3","gravatar_id":"","url":"https://api.github.com/users/codingforfun","html_url":"https://github.com/codingforfun","followers_url":"https://api.github.com/users/codingforfun/followers","following_url":"https://api.github.com/users/codingforfun/following{/other_user}","gists_url":"https://api.github.com/users/codingforfun/gists{/gist_id}","starred_url":"https://api.github.com/users/codingforfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingforfun/subscriptions","organizations_url":"https://api.github.com/users/codingforfun/orgs","repos_url":"https://api.github.com/users/codingforfun/repos","events_url":"https://api.github.com/users/codingforfun/events{/privacy}","received_events_url":"https://api.github.com/users/codingforfun/received_events","type":"User","site_admin":false},"body":"Add two new modules to ease creation of pickings and corresponding stock moves for transfer of goods between stock locations.\r\n1. Wizard to select source and destination module and goods to transfer\r\n2. Customization: Model the \r\ntransfer of goods via a dedicated transit stock location (ship, truck etc.). This creates 2 separate pickings per transfer. One to move goods from source location to transit location and another one to receive goods from transit location into destination.\r\n\r\n![bildschirmfoto vom 2014-12-12 17 40 37](https://cloud.githubusercontent.com/assets/1388003/5415235/0a204908-8226-11e4-9fb5-a59526bbcb43.png)","created_at":"2014-12-12T16:41:38Z","updated_at":"2015-04-23T15:41:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a2a5901706862b74056a23b1330097951757542","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28/commits","review_comments_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28/comments","review_comment_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/28/comments","statuses_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/statuses/dec569907df3e341e53060f1a71177ed02c78816","head":{"label":"initOS:stock-internal-transfer","ref":"stock-internal-transfer","sha":"dec569907df3e341e53060f1a71177ed02c78816","user":{"login":"initOS","id":4948110,"avatar_url":"https://avatars.githubusercontent.com/u/4948110?v=3","gravatar_id":"","url":"https://api.github.com/users/initOS","html_url":"https://github.com/initOS","followers_url":"https://api.github.com/users/initOS/followers","following_url":"https://api.github.com/users/initOS/following{/other_user}","gists_url":"https://api.github.com/users/initOS/gists{/gist_id}","starred_url":"https://api.github.com/users/initOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initOS/subscriptions","organizations_url":"https://api.github.com/users/initOS/orgs","repos_url":"https://api.github.com/users/initOS/repos","events_url":"https://api.github.com/users/initOS/events{/privacy}","received_events_url":"https://api.github.com/users/initOS/received_events","type":"Organization","site_admin":false},"repo":{"id":27913953,"name":"stock-logistics-warehouse","full_name":"initOS/stock-logistics-warehouse","owner":{"login":"initOS","id":4948110,"avatar_url":"https://avatars.githubusercontent.com/u/4948110?v=3","gravatar_id":"","url":"https://api.github.com/users/initOS","html_url":"https://github.com/initOS","followers_url":"https://api.github.com/users/initOS/followers","following_url":"https://api.github.com/users/initOS/following{/other_user}","gists_url":"https://api.github.com/users/initOS/gists{/gist_id}","starred_url":"https://api.github.com/users/initOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initOS/subscriptions","organizations_url":"https://api.github.com/users/initOS/orgs","repos_url":"https://api.github.com/users/initOS/repos","events_url":"https://api.github.com/users/initOS/events{/privacy}","received_events_url":"https://api.github.com/users/initOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/initOS/stock-logistics-warehouse","description":"","fork":true,"url":"https://api.github.com/repos/initOS/stock-logistics-warehouse","forks_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/forks","keys_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/teams","hooks_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/hooks","issue_events_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/issues/events{/number}","events_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/events","assignees_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/assignees{/user}","branches_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/branches{/branch}","tags_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/tags","blobs_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/statuses/{sha}","languages_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/languages","stargazers_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/stargazers","contributors_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/contributors","subscribers_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/subscribers","subscription_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/subscription","commits_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/contents/{+path}","compare_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/merges","archive_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/downloads","issues_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/issues{/number}","pulls_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/pulls{/number}","milestones_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/milestones{/number}","notifications_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/labels{/name}","releases_url":"https://api.github.com/repos/initOS/stock-logistics-warehouse/releases{/id}","created_at":"2014-12-12T09:30:09Z","updated_at":"2014-12-12T09:30:10Z","pushed_at":"2015-04-23T15:34:04Z","git_url":"git://github.com/initOS/stock-logistics-warehouse.git","ssh_url":"git@github.com:initOS/stock-logistics-warehouse.git","clone_url":"https://github.com/initOS/stock-logistics-warehouse.git","svn_url":"https://github.com/initOS/stock-logistics-warehouse","homepage":null,"size":1146,"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:7.0","ref":"7.0","sha":"ed06c738ec7bfef3a17f5c5da97d5b026ea1d93d","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":20891354,"name":"stock-logistics-warehouse","full_name":"OCA/stock-logistics-warehouse","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/stock-logistics-warehouse","description":"Odoo Warehouse Management Addons","fork":false,"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse","forks_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/forks","keys_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/teams","hooks_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/hooks","issue_events_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/events","assignees_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/tags","blobs_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/languages","stargazers_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/stargazers","contributors_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/contributors","subscribers_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/subscribers","subscription_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/subscription","commits_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/merges","archive_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/downloads","issues_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/labels{/name}","releases_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/releases{/id}","created_at":"2014-06-16T16:08:03Z","updated_at":"2015-04-12T05:53:32Z","pushed_at":"2015-04-23T15:34:05Z","git_url":"git://github.com/OCA/stock-logistics-warehouse.git","ssh_url":"git@github.com:OCA/stock-logistics-warehouse.git","clone_url":"https://github.com/OCA/stock-logistics-warehouse.git","svn_url":"https://github.com/OCA/stock-logistics-warehouse","homepage":"","size":2127,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":20,"forks":24,"open_issues":20,"watchers":12,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28"},"html":{"href":"https://github.com/OCA/stock-logistics-warehouse/pull/28"},"issue":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/28"},"comments":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/stock-logistics-warehouse/statuses/dec569907df3e341e53060f1a71177ed02c78816"}}}}