{"action":"created","comment":{"url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments/31609134","id":31609134,"diff_hunk":"@@ -18,26 +18,76 @@ def create(self, values):\n                 _(\"Template Name must contain at least a dot in it's name\"))\n         report_xml = super(IrActionsReport, self).create(values)\n         if values.get('report_type') in ['qweb-pdf', 'qweb-html']:\n-            qweb_view_data = {\n-                'name': values['report_name'].split('.')[1],\n-                'mode': 'primary',\n-                'type': 'qweb',\n-                'arch': '<?xml version=\"1.0\"?>\\n'\n-                        '<t t-name=\"%s\">\\n</t>' % values['report_name'],\n-            }\n-            qweb_view = self.env['ir.ui.view'].create(qweb_view_data)\n-            model_data_data = {\n-                'module': values['report_name'].split('.')[0],\n-                'name': values['report_name'].split('.')[1],\n-                'res_id': qweb_view.id,\n-                'model': 'ir.ui.view',\n-            }\n-            self.env['ir.model.data'].create(model_data_data)\n-            value_view_data = {\n-                'name': values['name'],\n-                'model': values['model'],\n-                'key2': 'client_print_multi',\n-                'value_unpickle': 'ir.actions.report.xml,%s' % report_xml.id,\n-            }\n-            self.env['ir.values'].create(value_view_data)\n+            report_view_ids = self.env.context.get('report_views', False)\n+            suffix = self.env.context.get('suffix', 'copy')\n+            report_name = values['report_name']\n+            module = report_name.split('.')[0]\n+            name = report_name.split('.')[1]\n+            for report_view in self.env['ir.ui.view'].browse(report_view_ids):\n+                origin_name = name.replace(('_%s' % suffix), '')\n+                new_report_name = '%s_%s' % (origin_name, suffix)\n+                qweb_view_data = {","path":"base_report_auto_create_qweb/models/report_xml.py","position":34,"original_position":34,"commit_id":"fb2d5936fed16768b036887679fb86f5a691e425","original_commit_id":"fb2d5936fed16768b036887679fb86f5a691e425","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":"Pon esto en métodos hook","created_at":"2015-06-03T10:03:33Z","updated_at":"2015-06-03T10:03:33Z","html_url":"https://github.com/odoomrp/odoomrp-utils/pull/55#discussion_r31609134","pull_request_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments/31609134"},"html":{"href":"https://github.com/odoomrp/odoomrp-utils/pull/55#discussion_r31609134"},"pull_request":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55","id":36726517,"html_url":"https://github.com/odoomrp/odoomrp-utils/pull/55","diff_url":"https://github.com/odoomrp/odoomrp-utils/pull/55.diff","patch_url":"https://github.com/odoomrp/odoomrp-utils/pull/55.patch","issue_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/55","number":55,"state":"open","locked":false,"title":"[IMP] <base_report_auto_create_qweb> Duplication of report added","user":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-02T13:13:17Z","updated_at":"2015-06-03T10:03:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0269305f292395a303660e8b4e65b8ad9c1fb02","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55/commits","review_comments_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55/comments","review_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/55/comments","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/statuses/fb2d5936fed16768b036887679fb86f5a691e425","head":{"label":"oihane:8.0-reports","ref":"8.0-reports","sha":"fb2d5936fed16768b036887679fb86f5a691e425","user":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"repo":{"id":32580412,"name":"odoomrp-utils","full_name":"oihane/odoomrp-utils","owner":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oihane/odoomrp-utils","description":"OdooMRP utilities","fork":true,"url":"https://api.github.com/repos/oihane/odoomrp-utils","forks_url":"https://api.github.com/repos/oihane/odoomrp-utils/forks","keys_url":"https://api.github.com/repos/oihane/odoomrp-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oihane/odoomrp-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oihane/odoomrp-utils/teams","hooks_url":"https://api.github.com/repos/oihane/odoomrp-utils/hooks","issue_events_url":"https://api.github.com/repos/oihane/odoomrp-utils/issues/events{/number}","events_url":"https://api.github.com/repos/oihane/odoomrp-utils/events","assignees_url":"https://api.github.com/repos/oihane/odoomrp-utils/assignees{/user}","branches_url":"https://api.github.com/repos/oihane/odoomrp-utils/branches{/branch}","tags_url":"https://api.github.com/repos/oihane/odoomrp-utils/tags","blobs_url":"https://api.github.com/repos/oihane/odoomrp-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oihane/odoomrp-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oihane/odoomrp-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/oihane/odoomrp-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oihane/odoomrp-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/oihane/odoomrp-utils/languages","stargazers_url":"https://api.github.com/repos/oihane/odoomrp-utils/stargazers","contributors_url":"https://api.github.com/repos/oihane/odoomrp-utils/contributors","subscribers_url":"https://api.github.com/repos/oihane/odoomrp-utils/subscribers","subscription_url":"https://api.github.com/repos/oihane/odoomrp-utils/subscription","commits_url":"https://api.github.com/repos/oihane/odoomrp-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/oihane/odoomrp-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/oihane/odoomrp-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/oihane/odoomrp-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/oihane/odoomrp-utils/contents/{+path}","compare_url":"https://api.github.com/repos/oihane/odoomrp-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oihane/odoomrp-utils/merges","archive_url":"https://api.github.com/repos/oihane/odoomrp-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oihane/odoomrp-utils/downloads","issues_url":"https://api.github.com/repos/oihane/odoomrp-utils/issues{/number}","pulls_url":"https://api.github.com/repos/oihane/odoomrp-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/oihane/odoomrp-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/oihane/odoomrp-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oihane/odoomrp-utils/labels{/name}","releases_url":"https://api.github.com/repos/oihane/odoomrp-utils/releases{/id}","created_at":"2015-03-20T11:35:10Z","updated_at":"2015-05-06T13:50:24Z","pushed_at":"2015-06-02T14:01:56Z","git_url":"git://github.com/oihane/odoomrp-utils.git","ssh_url":"git@github.com:oihane/odoomrp-utils.git","clone_url":"https://github.com/oihane/odoomrp-utils.git","svn_url":"https://github.com/oihane/odoomrp-utils","homepage":"","size":444,"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":"odoomrp:8.0","ref":"8.0","sha":"a37cdedbda908694db0e1b11f7bcb376becdbf74","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":27420524,"name":"odoomrp-utils","full_name":"odoomrp/odoomrp-utils","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-utils","description":"OdooMRP utilities","fork":false,"url":"https://api.github.com/repos/odoomrp/odoomrp-utils","forks_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/forks","keys_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/teams","hooks_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/hooks","issue_events_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/events{/number}","events_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/events","assignees_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/assignees{/user}","branches_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/branches{/branch}","tags_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/tags","blobs_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/languages","stargazers_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/stargazers","contributors_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/contributors","subscribers_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/subscribers","subscription_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/subscription","commits_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/contents/{+path}","compare_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/merges","archive_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/downloads","issues_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues{/number}","pulls_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/labels{/name}","releases_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/releases{/id}","created_at":"2014-12-02T07:27:11Z","updated_at":"2015-05-05T07:58:54Z","pushed_at":"2015-06-02T16:16:22Z","git_url":"git://github.com/odoomrp/odoomrp-utils.git","ssh_url":"git@github.com:odoomrp/odoomrp-utils.git","clone_url":"https://github.com/odoomrp/odoomrp-utils.git","svn_url":"https://github.com/odoomrp/odoomrp-utils","homepage":"","size":1299,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":5,"forks":24,"open_issues":5,"watchers":9,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55"},"html":{"href":"https://github.com/odoomrp/odoomrp-utils/pull/55"},"issue":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/55"},"comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/statuses/fb2d5936fed16768b036887679fb86f5a691e425"}}}}