{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/event/pulls/comments/189536698","pull_request_review_id":121730235,"id":189536698,"diff_hunk":"@@ -0,0 +1,124 @@\n+# -*- coding: utf-8 -*-\n+# Copyright 2017 Tecnativa - David Vidal\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).\n+\n+from odoo.tests import common\n+\n+\n+class EventSale(common.SavepointCase):\n+\n+    @classmethod\n+    def setUpClass(cls):\n+        super(EventSale, cls).setUpClass()\n+        cls.product_category = cls.env['product.category'].create({\n+            'name': 'test_cat',\n+        })\n+        cls.product = cls.env['product.product'].create({\n+            'name': 'Test product event',\n+            'type': 'service',\n+            'event_ok': True,\n+            'lst_price': 10.0,\n+            'categ_id': cls.product_category.id,\n+        })\n+        cls.event_multi = cls.env['event.event'].create({\n+            'name': 'Test event multi',\n+            'date_begin': '2017-05-26 20:00:00',\n+            'date_end': '2017-05-30 22:00:00',\n+            'seats_availability': 'limited',\n+            'seats_max': '100',\n+            'seats_min': '1',\n+            'event_ticket_ids': [\n+                (0, 0, {'product_id': cls.product.id, 'name': 'test1'}),\n+            ],\n+            'registration_multi_qty': True,\n+        })\n+        cls.event_nomulti = cls.env['event.event'].create({\n+            'name': 'Test event no multi',\n+            'date_begin': '2017-05-26 20:00:00',\n+            'date_end': '2017-05-30 22:00:00',\n+            'seats_availability': 'limited',\n+            'seats_max': '100',\n+            'seats_min': '1',\n+            'event_ticket_ids': [\n+                (0, 0, {'product_id': cls.product.id, 'name': 'test1'}),\n+            ],\n+            'registration_multi_qty': False,\n+        })\n+        cls.partner = cls.env['res.partner'].create({\n+            'name': 'Test partner',\n+        })\n+        cls.so_line_e_multi = (0, 0, {\n+            'product_id': cls.product.id,\n+            'event_id': cls.event_multi.id,\n+            'product_uom_qty': 5.0,\n+            'event_ticket_id': cls.event_multi.event_ticket_ids[0].id,\n+        })\n+        cls.so_line_e_nomulti = (0, 0, {\n+            'product_id': cls.product.id,\n+            'event_id': cls.event_nomulti.id,\n+            'product_uom_qty': 5.0,\n+            'event_ticket_id': cls.event_nomulti.event_ticket_ids[0].id,\n+        })\n+\n+    def test_sale_multi(self):\n+        sale = self.env['sale.order'].create({\n+            'partner_id': self.partner.id,\n+            'order_line': [self.so_line_e_multi]\n+        })\n+        sale.action_confirm()\n+        reg = self.env['event.registration'].search([\n+            ('sale_order_id', '=', sale.id)\n+        ])\n+        self.assertEqual(len(reg),  1)\n+        self.assertEqual(reg.qty, 5)\n+        self.assertEqual(reg.event_id, self.event_multi)\n+        self.assertEqual(reg.state, 'draft')\n+\n+    def test_sale_registration_editor(self):\n+        sale = self.env['sale.order'].create({\n+            'partner_id': self.partner.id,\n+            'order_line': [self.so_line_e_multi]\n+        })\n+        sale.action_confirm()\n+        reg = self.env['event.registration'].search([\n+            ('sale_order_id', '=', sale.id)\n+        ])\n+        editor = self.env['registration.editor'].create({\n+            'sale_order_id': sale.id,\n+            'event_registration_ids': reg,\n+        })\n+        editor.action_make_registration()\n+        # self.assertEqual(reg.state, 'open')","path":"event_sale_registration_multi_qty/tests/test_event_sale_registration_multi_qty.py","position":91,"original_position":91,"commit_id":"7892df5237c9baaa49c5589b3955181b19fa45c5","original_commit_id":"7892df5237c9baaa49c5589b3955181b19fa45c5","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars0.githubusercontent.com/u/973709?v=4","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"body":":fire: \r\n","created_at":"2018-05-21T09:19:06Z","updated_at":"2018-05-21T09:28:07Z","html_url":"https://github.com/OCA/event/pull/81#discussion_r189536698","pull_request_url":"https://api.github.com/repos/OCA/event/pulls/81","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/comments/189536698"},"html":{"href":"https://github.com/OCA/event/pull/81#discussion_r189536698"},"pull_request":{"href":"https://api.github.com/repos/OCA/event/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/event/pulls/81","id":126946705,"html_url":"https://github.com/OCA/event/pull/81","diff_url":"https://github.com/OCA/event/pull/81.diff","patch_url":"https://github.com/OCA/event/pull/81.patch","issue_url":"https://api.github.com/repos/OCA/event/issues/81","number":81,"state":"open","locked":false,"title":"[10.0][ADD] event_sale_registration_multy_qty: New module","user":{"login":"chienandalu","id":5040182,"avatar_url":"https://avatars0.githubusercontent.com/u/5040182?v=4","gravatar_id":"","url":"https://api.github.com/users/chienandalu","html_url":"https://github.com/chienandalu","followers_url":"https://api.github.com/users/chienandalu/followers","following_url":"https://api.github.com/users/chienandalu/following{/other_user}","gists_url":"https://api.github.com/users/chienandalu/gists{/gist_id}","starred_url":"https://api.github.com/users/chienandalu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chienandalu/subscriptions","organizations_url":"https://api.github.com/users/chienandalu/orgs","repos_url":"https://api.github.com/users/chienandalu/repos","events_url":"https://api.github.com/users/chienandalu/events{/privacy}","received_events_url":"https://api.github.com/users/chienandalu/received_events","type":"User","site_admin":false},"body":"Event Sale Registration Multi Qty\r\n=================================\r\n\r\nThis module extends Event Session Registration Multi Qty so it can be used on\r\nevent session sales.\r\n\r\n**Depends on:**\r\n\r\n- [x] event_registration_multi_qty: https://github.com/OCA/event/pull/78\r\n\r\ncc @Tecnativa\r\n\r\n","created_at":"2017-06-22T09:25:34Z","updated_at":"2018-05-21T09:28:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9946d91cc4d1c1a64251803d7c55ed69147218e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sergio-teruel","id":7689807,"avatar_url":"https://avatars3.githubusercontent.com/u/7689807?v=4","gravatar_id":"","url":"https://api.github.com/users/sergio-teruel","html_url":"https://github.com/sergio-teruel","followers_url":"https://api.github.com/users/sergio-teruel/followers","following_url":"https://api.github.com/users/sergio-teruel/following{/other_user}","gists_url":"https://api.github.com/users/sergio-teruel/gists{/gist_id}","starred_url":"https://api.github.com/users/sergio-teruel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergio-teruel/subscriptions","organizations_url":"https://api.github.com/users/sergio-teruel/orgs","repos_url":"https://api.github.com/users/sergio-teruel/repos","events_url":"https://api.github.com/users/sergio-teruel/events{/privacy}","received_events_url":"https://api.github.com/users/sergio-teruel/received_events","type":"User","site_admin":false},{"login":"rafaelbn","id":8736623,"avatar_url":"https://avatars0.githubusercontent.com/u/8736623?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaelbn","html_url":"https://github.com/rafaelbn","followers_url":"https://api.github.com/users/rafaelbn/followers","following_url":"https://api.github.com/users/rafaelbn/following{/other_user}","gists_url":"https://api.github.com/users/rafaelbn/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelbn/subscriptions","organizations_url":"https://api.github.com/users/rafaelbn/orgs","repos_url":"https://api.github.com/users/rafaelbn/repos","events_url":"https://api.github.com/users/rafaelbn/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelbn/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":254401671,"url":"https://api.github.com/repos/OCA/event/labels/needs%20review","name":"needs review","color":"fbca04","default":false}],"milestone":{"url":"https://api.github.com/repos/OCA/event/milestones/3","html_url":"https://github.com/OCA/event/milestone/3","labels_url":"https://api.github.com/repos/OCA/event/milestones/3/labels","id":2052111,"number":3,"title":"10.0","description":null,"creator":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars2.githubusercontent.com/u/7165771?v=4","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},"open_issues":3,"closed_issues":17,"state":"open","created_at":"2016-10-06T12:51:40Z","updated_at":"2018-05-15T19:11:01Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/event/pulls/81/commits","review_comments_url":"https://api.github.com/repos/OCA/event/pulls/81/comments","review_comment_url":"https://api.github.com/repos/OCA/event/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/event/issues/81/comments","statuses_url":"https://api.github.com/repos/OCA/event/statuses/7892df5237c9baaa49c5589b3955181b19fa45c5","head":{"label":"Tecnativa:10.0-PR-event_sale_registration_multi_qty","ref":"10.0-PR-event_sale_registration_multi_qty","sha":"7892df5237c9baaa49c5589b3955181b19fa45c5","user":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars2.githubusercontent.com/u/18120193?v=4","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"repo":{"id":57138181,"name":"event","full_name":"Tecnativa/event","owner":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars2.githubusercontent.com/u/18120193?v=4","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tecnativa/event","description":"Event Management addons","fork":true,"url":"https://api.github.com/repos/Tecnativa/event","forks_url":"https://api.github.com/repos/Tecnativa/event/forks","keys_url":"https://api.github.com/repos/Tecnativa/event/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/event/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/event/teams","hooks_url":"https://api.github.com/repos/Tecnativa/event/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/event/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/event/events","assignees_url":"https://api.github.com/repos/Tecnativa/event/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/event/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/event/tags","blobs_url":"https://api.github.com/repos/Tecnativa/event/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/event/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/event/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/event/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/event/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/event/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/event/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/event/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/event/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/event/subscription","commits_url":"https://api.github.com/repos/Tecnativa/event/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/event/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/event/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/event/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/event/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/event/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/event/merges","archive_url":"https://api.github.com/repos/Tecnativa/event/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/event/downloads","issues_url":"https://api.github.com/repos/Tecnativa/event/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/event/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/event/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/event/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/event/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/event/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/event/deployments","created_at":"2016-04-26T15:08:07Z","updated_at":"2018-03-26T11:46:47Z","pushed_at":"2018-05-16T09:16:15Z","git_url":"git://github.com/Tecnativa/event.git","ssh_url":"git@github.com:Tecnativa/event.git","clone_url":"https://github.com/Tecnativa/event.git","svn_url":"https://github.com/Tecnativa/event","homepage":null,"size":1486,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":2,"open_issues":0,"watchers":0,"default_branch":"9.0"}},"base":{"label":"OCA:10.0","ref":"10.0","sha":"280036a70d6a690b7b3373da615dd61a5c6d82bb","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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":38101394,"name":"event","full_name":"OCA/event","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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/event","description":"Event Management addons","fork":false,"url":"https://api.github.com/repos/OCA/event","forks_url":"https://api.github.com/repos/OCA/event/forks","keys_url":"https://api.github.com/repos/OCA/event/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/event/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/event/teams","hooks_url":"https://api.github.com/repos/OCA/event/hooks","issue_events_url":"https://api.github.com/repos/OCA/event/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/event/events","assignees_url":"https://api.github.com/repos/OCA/event/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/event/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/event/tags","blobs_url":"https://api.github.com/repos/OCA/event/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/event/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/event/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/event/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/event/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/event/languages","stargazers_url":"https://api.github.com/repos/OCA/event/stargazers","contributors_url":"https://api.github.com/repos/OCA/event/contributors","subscribers_url":"https://api.github.com/repos/OCA/event/subscribers","subscription_url":"https://api.github.com/repos/OCA/event/subscription","commits_url":"https://api.github.com/repos/OCA/event/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/event/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/event/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/event/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/event/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/event/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/event/merges","archive_url":"https://api.github.com/repos/OCA/event/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/event/downloads","issues_url":"https://api.github.com/repos/OCA/event/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/event/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/event/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/event/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/event/labels{/name}","releases_url":"https://api.github.com/repos/OCA/event/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/event/deployments","created_at":"2015-06-26T08:59:06Z","updated_at":"2018-05-16T02:50:37Z","pushed_at":"2018-05-16T22:05:24Z","git_url":"git://github.com/OCA/event.git","ssh_url":"git@github.com:OCA/event.git","clone_url":"https://github.com/OCA/event.git","svn_url":"https://github.com/OCA/event","homepage":null,"size":1784,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":51,"open_issues":16,"watchers":10,"default_branch":"11.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/81"},"html":{"href":"https://github.com/OCA/event/pull/81"},"issue":{"href":"https://api.github.com/repos/OCA/event/issues/81"},"comments":{"href":"https://api.github.com/repos/OCA/event/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/event/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/event/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/event/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/event/statuses/7892df5237c9baaa49c5589b3955181b19fa45c5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Yajo"}}