{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/account-analytic/pulls/comments/77589387","id":77589387,"diff_hunk":"@@ -0,0 +1,117 @@\n+# -*- coding: utf-8 -*-\n+# Copyright 2016 ACSONE SA/NV\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n+\n+from openerp.tests.common import SavepointCase\n+\n+\n+class TestAccountAnalyticNoLines(SavepointCase):\n+\n+    @classmethod\n+    def setUpClass(cls):\n+        super(TestAccountAnalyticNoLines, cls).setUpClass()\n+\n+        # ENVIRONEMENTS\n+\n+        cls.account_account = cls.env['account.account']\n+        cls.account_analytic_line = cls.env['account.analytic.line']\n+        cls.account_journal = cls.env['account.journal']\n+        cls.account_move_line = cls.env['account.move.line']\n+        cls.account_invoice = cls.env['account.invoice']\n+        cls.account_invoice_line = cls.env['account.invoice.line']\n+\n+        # INSTANCES\n+\n+        # Instance: user\n+        cls.user = cls.env.ref('base.res_partner_2')\n+\n+        # Instance: accounts\n+        cls.account_440000 = cls.account_account.create({\n+            'name': 'Entreprises liées',\n+            'code': '440000_demo',\n+            'user_type_id':\n+                cls.env.ref('account.data_account_type_payable').id,\n+            'reconcile': True})\n+        cls.account_550001 = cls.account_account.create({\n+            'name': 'Banque',\n+            'code': '550001_demo',\n+            'user_type_id':\n+                cls.env.ref('account.data_account_type_liquidity').id,\n+            'reconcile': False})\n+        cls.account_600000 = cls.account_account.create({\n+            'name': 'Achats de matières premières',\n+            'code': '600000_demo',\n+            'user_type_id':\n+                cls.env.ref('account.data_account_type_expenses').id,\n+            'reconcile': False})\n+\n+        # Journal\n+        cls.journal = cls.account_journal.create({\n+            'name': 'Bank Journal Test',\n+            'type': 'bank',\n+            'code': 'BKTEST',\n+            'default_debit_account_id': cls.account_550001.id,\n+            'default_credit_account_id': cls.account_550001.id})\n+\n+        # Invoice lines\n+        cls.invoice_line_1 = cls.account_invoice_line.create({\n+            'name': 'Test invoice line 1',\n+            'price_unit': 50,\n+            'quantity': 2,\n+            'account_id': cls.account_600000.id})\n+        cls.invoice_line_2 = cls.account_invoice_line.create({\n+            'name': 'Test invoice line 2',\n+            'price_unit': 25,\n+            'quantity': 2,\n+            'account_id': cls.account_600000.id})\n+        cls.invoice_line_3 = cls.account_invoice_line.create({\n+            'name': 'Test invoice line 3',\n+            'price_unit': 100,\n+            'quantity': 1,\n+            'account_id': cls.account_600000.id})\n+\n+        # Invoice\n+        cls.invoice = cls.account_invoice.create({\n+            'partner_id': cls.user.id,\n+            'account_id': cls.account_440000.id,\n+            'type': 'in_invoice',\n+            'invoice_line_ids': [(6, 0, [cls.invoice_line_1.id,\n+                                         cls.invoice_line_2.id,\n+                                         cls.invoice_line_3.id])]})\n+        cls.invoice.action_move_create()\n+\n+    def test_create_analytic_lines(self):\n+        '''\n+        Test the expected result when the method ´create_analytic_lines` is\n+        called on an invoice.\n+        The expected result is that no analytic line has been created\n+        for this invoice.\n+        '''\n+        move_lines = self.account_move_line.search([('invoice_id',","path":"account_analytic_no_lines/tests/test_account_analytic_no_lines.py","position":90,"original_position":90,"commit_id":"168b3e175d1358d7338cfeee859be366f28326b4","original_commit_id":"168b3e175d1358d7338cfeee859be366f28326b4","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":"For using less lines:\r\n```\r\nmove_lines = self.account_move_line.search([\r\n    ('invoice_id', '=', self.invoice.id)])\r\n```","created_at":"2016-09-06T08:08:07Z","updated_at":"2016-09-06T08:08:07Z","html_url":"https://github.com/OCA/account-analytic/pull/69#discussion_r77589387","pull_request_url":"https://api.github.com/repos/OCA/account-analytic/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/comments/77589387"},"html":{"href":"https://github.com/OCA/account-analytic/pull/69#discussion_r77589387"},"pull_request":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/account-analytic/pulls/69","id":84010862,"html_url":"https://github.com/OCA/account-analytic/pull/69","diff_url":"https://github.com/OCA/account-analytic/pull/69.diff","patch_url":"https://github.com/OCA/account-analytic/pull/69.patch","issue_url":"https://api.github.com/repos/OCA/account-analytic/issues/69","number":69,"state":"open","locked":false,"title":"[9.0][ADD] account_analytic_no_lines","user":{"login":"ThomasBinsfeld","id":16916103,"avatar_url":"https://avatars.githubusercontent.com/u/16916103?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBinsfeld","html_url":"https://github.com/ThomasBinsfeld","followers_url":"https://api.github.com/users/ThomasBinsfeld/followers","following_url":"https://api.github.com/users/ThomasBinsfeld/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBinsfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBinsfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBinsfeld/subscriptions","organizations_url":"https://api.github.com/users/ThomasBinsfeld/orgs","repos_url":"https://api.github.com/users/ThomasBinsfeld/repos","events_url":"https://api.github.com/users/ThomasBinsfeld/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBinsfeld/received_events","type":"User","site_admin":false},"body":"# Account Analytic No Lines\r\n\r\nThis module hides analytics lines from accounting menus and disable their generation from an invoice or a move line.","created_at":"2016-09-05T14:33:00Z","updated_at":"2016-09-06T08:08:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad1e21212c386f562a717121720b8006110de777","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/account-analytic/pulls/69/commits","review_comments_url":"https://api.github.com/repos/OCA/account-analytic/pulls/69/comments","review_comment_url":"https://api.github.com/repos/OCA/account-analytic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/account-analytic/issues/69/comments","statuses_url":"https://api.github.com/repos/OCA/account-analytic/statuses/168b3e175d1358d7338cfeee859be366f28326b4","head":{"label":"acsone:9.0-add_account_analytic_no_lines_tbi","ref":"9.0-add_account_analytic_no_lines_tbi","sha":"168b3e175d1358d7338cfeee859be366f28326b4","user":{"login":"acsone","id":7601056,"avatar_url":"https://avatars.githubusercontent.com/u/7601056?v=3","gravatar_id":"","url":"https://api.github.com/users/acsone","html_url":"https://github.com/acsone","followers_url":"https://api.github.com/users/acsone/followers","following_url":"https://api.github.com/users/acsone/following{/other_user}","gists_url":"https://api.github.com/users/acsone/gists{/gist_id}","starred_url":"https://api.github.com/users/acsone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acsone/subscriptions","organizations_url":"https://api.github.com/users/acsone/orgs","repos_url":"https://api.github.com/users/acsone/repos","events_url":"https://api.github.com/users/acsone/events{/privacy}","received_events_url":"https://api.github.com/users/acsone/received_events","type":"Organization","site_admin":false},"repo":{"id":23571432,"name":"account-analytic","full_name":"acsone/account-analytic","owner":{"login":"acsone","id":7601056,"avatar_url":"https://avatars.githubusercontent.com/u/7601056?v=3","gravatar_id":"","url":"https://api.github.com/users/acsone","html_url":"https://github.com/acsone","followers_url":"https://api.github.com/users/acsone/followers","following_url":"https://api.github.com/users/acsone/following{/other_user}","gists_url":"https://api.github.com/users/acsone/gists{/gist_id}","starred_url":"https://api.github.com/users/acsone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acsone/subscriptions","organizations_url":"https://api.github.com/users/acsone/orgs","repos_url":"https://api.github.com/users/acsone/repos","events_url":"https://api.github.com/users/acsone/events{/privacy}","received_events_url":"https://api.github.com/users/acsone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acsone/account-analytic","description":"","fork":true,"url":"https://api.github.com/repos/acsone/account-analytic","forks_url":"https://api.github.com/repos/acsone/account-analytic/forks","keys_url":"https://api.github.com/repos/acsone/account-analytic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acsone/account-analytic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acsone/account-analytic/teams","hooks_url":"https://api.github.com/repos/acsone/account-analytic/hooks","issue_events_url":"https://api.github.com/repos/acsone/account-analytic/issues/events{/number}","events_url":"https://api.github.com/repos/acsone/account-analytic/events","assignees_url":"https://api.github.com/repos/acsone/account-analytic/assignees{/user}","branches_url":"https://api.github.com/repos/acsone/account-analytic/branches{/branch}","tags_url":"https://api.github.com/repos/acsone/account-analytic/tags","blobs_url":"https://api.github.com/repos/acsone/account-analytic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acsone/account-analytic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acsone/account-analytic/git/refs{/sha}","trees_url":"https://api.github.com/repos/acsone/account-analytic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acsone/account-analytic/statuses/{sha}","languages_url":"https://api.github.com/repos/acsone/account-analytic/languages","stargazers_url":"https://api.github.com/repos/acsone/account-analytic/stargazers","contributors_url":"https://api.github.com/repos/acsone/account-analytic/contributors","subscribers_url":"https://api.github.com/repos/acsone/account-analytic/subscribers","subscription_url":"https://api.github.com/repos/acsone/account-analytic/subscription","commits_url":"https://api.github.com/repos/acsone/account-analytic/commits{/sha}","git_commits_url":"https://api.github.com/repos/acsone/account-analytic/git/commits{/sha}","comments_url":"https://api.github.com/repos/acsone/account-analytic/comments{/number}","issue_comment_url":"https://api.github.com/repos/acsone/account-analytic/issues/comments{/number}","contents_url":"https://api.github.com/repos/acsone/account-analytic/contents/{+path}","compare_url":"https://api.github.com/repos/acsone/account-analytic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acsone/account-analytic/merges","archive_url":"https://api.github.com/repos/acsone/account-analytic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acsone/account-analytic/downloads","issues_url":"https://api.github.com/repos/acsone/account-analytic/issues{/number}","pulls_url":"https://api.github.com/repos/acsone/account-analytic/pulls{/number}","milestones_url":"https://api.github.com/repos/acsone/account-analytic/milestones{/number}","notifications_url":"https://api.github.com/repos/acsone/account-analytic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acsone/account-analytic/labels{/name}","releases_url":"https://api.github.com/repos/acsone/account-analytic/releases{/id}","deployments_url":"https://api.github.com/repos/acsone/account-analytic/deployments","created_at":"2014-09-02T08:46:12Z","updated_at":"2016-01-20T00:00:15Z","pushed_at":"2016-09-06T07:29:57Z","git_url":"git://github.com/acsone/account-analytic.git","ssh_url":"git@github.com:acsone/account-analytic.git","clone_url":"https://github.com/acsone/account-analytic.git","svn_url":"https://github.com/acsone/account-analytic","homepage":null,"size":501,"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:9.0","ref":"9.0","sha":"4cb1f89cb8459aeeea75f3e3df0126e43812ed73","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":20881668,"name":"account-analytic","full_name":"OCA/account-analytic","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/account-analytic","description":"Odoo Account Analytic Related Addons","fork":false,"url":"https://api.github.com/repos/OCA/account-analytic","forks_url":"https://api.github.com/repos/OCA/account-analytic/forks","keys_url":"https://api.github.com/repos/OCA/account-analytic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/account-analytic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/account-analytic/teams","hooks_url":"https://api.github.com/repos/OCA/account-analytic/hooks","issue_events_url":"https://api.github.com/repos/OCA/account-analytic/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/account-analytic/events","assignees_url":"https://api.github.com/repos/OCA/account-analytic/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/account-analytic/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/account-analytic/tags","blobs_url":"https://api.github.com/repos/OCA/account-analytic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/account-analytic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/account-analytic/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/account-analytic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/account-analytic/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/account-analytic/languages","stargazers_url":"https://api.github.com/repos/OCA/account-analytic/stargazers","contributors_url":"https://api.github.com/repos/OCA/account-analytic/contributors","subscribers_url":"https://api.github.com/repos/OCA/account-analytic/subscribers","subscription_url":"https://api.github.com/repos/OCA/account-analytic/subscription","commits_url":"https://api.github.com/repos/OCA/account-analytic/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/account-analytic/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/account-analytic/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/account-analytic/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/account-analytic/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/account-analytic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/account-analytic/merges","archive_url":"https://api.github.com/repos/OCA/account-analytic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/account-analytic/downloads","issues_url":"https://api.github.com/repos/OCA/account-analytic/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/account-analytic/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/account-analytic/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/account-analytic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/account-analytic/labels{/name}","releases_url":"https://api.github.com/repos/OCA/account-analytic/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/account-analytic/deployments","created_at":"2014-06-16T10:55:18Z","updated_at":"2016-01-27T14:38:14Z","pushed_at":"2016-09-06T06:53:59Z","git_url":"git://github.com/OCA/account-analytic.git","ssh_url":"git@github.com:OCA/account-analytic.git","clone_url":"https://github.com/OCA/account-analytic.git","svn_url":"https://github.com/OCA/account-analytic","homepage":"","size":609,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":14,"forks":51,"open_issues":14,"watchers":6,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/69"},"html":{"href":"https://github.com/OCA/account-analytic/pull/69"},"issue":{"href":"https://api.github.com/repos/OCA/account-analytic/issues/69"},"comments":{"href":"https://api.github.com/repos/OCA/account-analytic/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/account-analytic/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/account-analytic/statuses/168b3e175d1358d7338cfeee859be366f28326b4"}}}}
{"actor":{"display_login":"pedrobaeza"}}