{"action":"created","comment":{"url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/24079077","id":24079077,"diff_hunk":"@@ -0,0 +1,40 @@\n+# -*- coding: utf-8 -*-\n+##############################################################################\n+# For copyright and license notices, see __openerp__.py file in root directory\n+##############################################################################\n+from openerp import models, fields, api, exceptions, _\n+\n+\n+class StockProductionLot(models.Model):\n+    _inherit = 'stock.production.lot'\n+\n+    def _get_locked_value(self):\n+        settings_obj = self.env['stock.config.settings']\n+        config = settings_obj.search([], limit=1, order='id DESC')\n+        return config.group_lot_default_locked\n+\n+    locked = fields.Boolean(string='Locked', default=_get_locked_value,\n+                            readonly=True)\n+\n+    @api.multi\n+    def button_lock(self):\n+        stock_quant_obj = self.env['stock.quant']\n+        for lot in self:\n+            cond = [('lot_id', '=', lot.id),\n+                    ('reservation_id', '!=', False)]\n+            for quant in stock_quant_obj.search(cond):\n+                usage = False\n+                if quant.reservation_id.location_dest_id:\n+                    usage = quant.reservation_id.location_dest_id.usage\n+                if (usage and usage in ('view', 'internal') and\n+                        quant.reservation_id.state == 'done'):","path":"mrp_lock_lot/models/mrp_production_lot.py","position":30,"original_position":30,"commit_id":"951dbef44b882f5b4a25a992d41445633c57aa0a","original_commit_id":"951dbef44b882f5b4a25a992d41445633c57aa0a","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":"Debe ser distinto de done. De nada sirve que ya esté hecho. Son los que están aún por hacer.","created_at":"2015-02-04T12:17:54Z","updated_at":"2015-02-04T12:17:54Z","html_url":"https://github.com/odoomrp/odoomrp-wip/pull/609#discussion_r24079077","pull_request_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609","_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/24079077"},"html":{"href":"https://github.com/odoomrp/odoomrp-wip/pull/609#discussion_r24079077"},"pull_request":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609"}}},"pull_request":{"url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609","id":28024277,"html_url":"https://github.com/odoomrp/odoomrp-wip/pull/609","diff_url":"https://github.com/odoomrp/odoomrp-wip/pull/609.diff","patch_url":"https://github.com/odoomrp/odoomrp-wip/pull/609.patch","issue_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/609","number":609,"state":"open","locked":false,"title":"[NEW mrp_lock_lot]","user":{"login":"alfredoavanzosc","id":8257820,"avatar_url":"https://avatars.githubusercontent.com/u/8257820?v=3","gravatar_id":"","url":"https://api.github.com/users/alfredoavanzosc","html_url":"https://github.com/alfredoavanzosc","followers_url":"https://api.github.com/users/alfredoavanzosc/followers","following_url":"https://api.github.com/users/alfredoavanzosc/following{/other_user}","gists_url":"https://api.github.com/users/alfredoavanzosc/gists{/gist_id}","starred_url":"https://api.github.com/users/alfredoavanzosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfredoavanzosc/subscriptions","organizations_url":"https://api.github.com/users/alfredoavanzosc/orgs","repos_url":"https://api.github.com/users/alfredoavanzosc/repos","events_url":"https://api.github.com/users/alfredoavanzosc/events{/privacy}","received_events_url":"https://api.github.com/users/alfredoavanzosc/received_events","type":"User","site_admin":false},"body":"Nuevo módulo para cubrir los nuevos quererimientos de Ana, en issue https://github.com/odoomrp/odoomrp-wip/pull/376#issuecomment-71268412","created_at":"2015-01-26T12:52:32Z","updated_at":"2015-02-04T12:17:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b84b999d30c3d04524ab190ef07e03aa183bdf51","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609/commits","review_comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609/comments","review_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/{number}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/609/comments","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/951dbef44b882f5b4a25a992d41445633c57aa0a","head":{"label":"alfredoavanzosc:odoomrp-mrp_lock_lot","ref":"odoomrp-mrp_lock_lot","sha":"951dbef44b882f5b4a25a992d41445633c57aa0a","user":{"login":"alfredoavanzosc","id":8257820,"avatar_url":"https://avatars.githubusercontent.com/u/8257820?v=3","gravatar_id":"","url":"https://api.github.com/users/alfredoavanzosc","html_url":"https://github.com/alfredoavanzosc","followers_url":"https://api.github.com/users/alfredoavanzosc/followers","following_url":"https://api.github.com/users/alfredoavanzosc/following{/other_user}","gists_url":"https://api.github.com/users/alfredoavanzosc/gists{/gist_id}","starred_url":"https://api.github.com/users/alfredoavanzosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfredoavanzosc/subscriptions","organizations_url":"https://api.github.com/users/alfredoavanzosc/orgs","repos_url":"https://api.github.com/users/alfredoavanzosc/repos","events_url":"https://api.github.com/users/alfredoavanzosc/events{/privacy}","received_events_url":"https://api.github.com/users/alfredoavanzosc/received_events","type":"User","site_admin":false},"repo":{"id":24589331,"name":"odoomrp-wip-1","full_name":"alfredoavanzosc/odoomrp-wip-1","owner":{"login":"alfredoavanzosc","id":8257820,"avatar_url":"https://avatars.githubusercontent.com/u/8257820?v=3","gravatar_id":"","url":"https://api.github.com/users/alfredoavanzosc","html_url":"https://github.com/alfredoavanzosc","followers_url":"https://api.github.com/users/alfredoavanzosc/followers","following_url":"https://api.github.com/users/alfredoavanzosc/following{/other_user}","gists_url":"https://api.github.com/users/alfredoavanzosc/gists{/gist_id}","starred_url":"https://api.github.com/users/alfredoavanzosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfredoavanzosc/subscriptions","organizations_url":"https://api.github.com/users/alfredoavanzosc/orgs","repos_url":"https://api.github.com/users/alfredoavanzosc/repos","events_url":"https://api.github.com/users/alfredoavanzosc/events{/privacy}","received_events_url":"https://api.github.com/users/alfredoavanzosc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alfredoavanzosc/odoomrp-wip-1","description":"WIP of OdooMRP","fork":true,"url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1","forks_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/forks","keys_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/teams","hooks_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/hooks","issue_events_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/issues/events{/number}","events_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/events","assignees_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/assignees{/user}","branches_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/branches{/branch}","tags_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/tags","blobs_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/statuses/{sha}","languages_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/languages","stargazers_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/stargazers","contributors_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/contributors","subscribers_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/subscribers","subscription_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/subscription","commits_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/issues/comments/{number}","contents_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/contents/{+path}","compare_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/merges","archive_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/downloads","issues_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/issues{/number}","pulls_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/pulls{/number}","milestones_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/milestones{/number}","notifications_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/labels{/name}","releases_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-wip-1/releases{/id}","created_at":"2014-09-29T10:00:12Z","updated_at":"2014-09-29T06:45:10Z","pushed_at":"2015-02-04T08:47:36Z","git_url":"git://github.com/alfredoavanzosc/odoomrp-wip-1.git","ssh_url":"git@github.com:alfredoavanzosc/odoomrp-wip-1.git","clone_url":"https://github.com/alfredoavanzosc/odoomrp-wip-1.git","svn_url":"https://github.com/alfredoavanzosc/odoomrp-wip-1","homepage":"http://www.odoomrp.com","size":3196,"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":"8.0"}},"base":{"label":"odoomrp:8.0","ref":"8.0","sha":"0e8e0c20432a0b99e0d2ff09a7150569cfb8a6b9","user":{"login":"odoomrp","id":7858947,"avatar_url":"https://avatars.githubusercontent.com/u/7858947?v=3","gravatar_id":"","url":"https://api.github.com/users/odoomrp","html_url":"https://github.com/odoomrp","followers_url":"https://api.github.com/users/odoomrp/followers","following_url":"https://api.github.com/users/odoomrp/following{/other_user}","gists_url":"https://api.github.com/users/odoomrp/gists{/gist_id}","starred_url":"https://api.github.com/users/odoomrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoomrp/subscriptions","organizations_url":"https://api.github.com/users/odoomrp/orgs","repos_url":"https://api.github.com/users/odoomrp/repos","events_url":"https://api.github.com/users/odoomrp/events{/privacy}","received_events_url":"https://api.github.com/users/odoomrp/received_events","type":"Organization","site_admin":false},"repo":{"id":22124768,"name":"odoomrp-wip","full_name":"odoomrp/odoomrp-wip","owner":{"login":"odoomrp","id":7858947,"avatar_url":"https://avatars.githubusercontent.com/u/7858947?v=3","gravatar_id":"","url":"https://api.github.com/users/odoomrp","html_url":"https://github.com/odoomrp","followers_url":"https://api.github.com/users/odoomrp/followers","following_url":"https://api.github.com/users/odoomrp/following{/other_user}","gists_url":"https://api.github.com/users/odoomrp/gists{/gist_id}","starred_url":"https://api.github.com/users/odoomrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoomrp/subscriptions","organizations_url":"https://api.github.com/users/odoomrp/orgs","repos_url":"https://api.github.com/users/odoomrp/repos","events_url":"https://api.github.com/users/odoomrp/events{/privacy}","received_events_url":"https://api.github.com/users/odoomrp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoomrp/odoomrp-wip","description":"WIP of OdooMRP","fork":false,"url":"https://api.github.com/repos/odoomrp/odoomrp-wip","forks_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/forks","keys_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/teams","hooks_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/hooks","issue_events_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/events{/number}","events_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/events","assignees_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/assignees{/user}","branches_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/branches{/branch}","tags_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/tags","blobs_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/{sha}","languages_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/languages","stargazers_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/stargazers","contributors_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/contributors","subscribers_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/subscribers","subscription_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/subscription","commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/comments/{number}","contents_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/contents/{+path}","compare_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/merges","archive_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/downloads","issues_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues{/number}","pulls_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls{/number}","milestones_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/milestones{/number}","notifications_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/labels{/name}","releases_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/releases{/id}","created_at":"2014-07-22T23:29:59Z","updated_at":"2015-02-03T04:13:44Z","pushed_at":"2015-02-02T14:10:22Z","git_url":"git://github.com/odoomrp/odoomrp-wip.git","ssh_url":"git@github.com:odoomrp/odoomrp-wip.git","clone_url":"https://github.com/odoomrp/odoomrp-wip.git","svn_url":"https://github.com/odoomrp/odoomrp-wip","homepage":"http://www.odoomrp.com","size":6967,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":28,"forks":35,"open_issues":28,"watchers":22,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609"},"html":{"href":"https://github.com/odoomrp/odoomrp-wip/pull/609"},"issue":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/609"},"comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/609/comments"},"review_comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609/comments"},"review_comment":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/609/commits"},"statuses":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/951dbef44b882f5b4a25a992d41445633c57aa0a"}}}}