{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/comments/31540046","id":31540046,"diff_hunk":"@@ -0,0 +1,336 @@\n+# -*- coding: utf-8 -*-\n+\n+import psycopg2\n+import logging\n+from openerp.osv import osv\n+from openerp import SUPERUSER_ID\n+from abc import ABCMeta, abstractmethod\n+\n+logger = logging.getLogger(__name__)\n+ABSTRACT_MODEL_NAME = 'abstract.materialized.sql.view'\n+\n+\n+class AbstractMaterializedSqlView(osv.AbstractModel):\n+\n+    \"\"\"This class is an abstract model to help developer to\n+       create/refresh/update materialized view.\n+    \"\"\"\n+    _name = ABSTRACT_MODEL_NAME\n+    _description = u\"This is an helper class to manage materialized SQL view\"\n+    _auto = False\n+\n+    _sql_mat_view_name = ''\n+    \"\"\"The name of the materialized sql view.\n+       Must be defined in inherit class (using inherit = [])\n+    \"\"\"","path":"materialized_sql_view/model/abstract_materialized_sql_view.py","position":25,"original_position":25,"commit_id":"2b59a21264e28f3c5340abd0673a88b60c641aac","original_commit_id":"2b59a21264e28f3c5340abd0673a88b60c641aac","user":{"login":"nbessi","id":147671,"avatar_url":"https://avatars.githubusercontent.com/u/147671?v=3","gravatar_id":"","url":"https://api.github.com/users/nbessi","html_url":"https://github.com/nbessi","followers_url":"https://api.github.com/users/nbessi/followers","following_url":"https://api.github.com/users/nbessi/following{/other_user}","gists_url":"https://api.github.com/users/nbessi/gists{/gist_id}","starred_url":"https://api.github.com/users/nbessi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbessi/subscriptions","organizations_url":"https://api.github.com/users/nbessi/orgs","repos_url":"https://api.github.com/users/nbessi/repos","events_url":"https://api.github.com/users/nbessi/events{/privacy}","received_events_url":"https://api.github.com/users/nbessi/received_events","type":"User","site_admin":false},"body":"if the property are mandatory we may use the property decorator to raise a explicit message","created_at":"2015-06-02T16:11:20Z","updated_at":"2015-06-02T16:11:20Z","html_url":"https://github.com/OCA/server-tools/pull/110#discussion_r31540046","pull_request_url":"https://api.github.com/repos/OCA/server-tools/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments/31540046"},"html":{"href":"https://github.com/OCA/server-tools/pull/110#discussion_r31540046"},"pull_request":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/110","id":27113681,"html_url":"https://github.com/OCA/server-tools/pull/110","diff_url":"https://github.com/OCA/server-tools/pull/110.diff","patch_url":"https://github.com/OCA/server-tools/pull/110.patch","issue_url":"https://api.github.com/repos/OCA/server-tools/issues/110","number":110,"state":"open","locked":false,"title":"Add new module: materialized sql view","user":{"login":"petrus-v","id":4328507,"avatar_url":"https://avatars.githubusercontent.com/u/4328507?v=3","gravatar_id":"","url":"https://api.github.com/users/petrus-v","html_url":"https://github.com/petrus-v","followers_url":"https://api.github.com/users/petrus-v/followers","following_url":"https://api.github.com/users/petrus-v/following{/other_user}","gists_url":"https://api.github.com/users/petrus-v/gists{/gist_id}","starred_url":"https://api.github.com/users/petrus-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrus-v/subscriptions","organizations_url":"https://api.github.com/users/petrus-v/orgs","repos_url":"https://api.github.com/users/petrus-v/repos","events_url":"https://api.github.com/users/petrus-v/events{/privacy}","received_events_url":"https://api.github.com/users/petrus-v/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nI'm Pierre Verkest from Anybox, I'm pretty new in OCA and not sure about\r\nthe workflow to add new modules. Anyway this is a module we developed\r\non [bitbucket](https://bitbucket.org/anybox/materialized_sql_view).\r\n\r\nI'm glad to contribute and dive into OCA tools and thanks @legalsylvain who\r\nask us to push this `materialized_sql_view` module here.\r\n\r\nIf you want to know more about this module you can read materialized_sql_view\r\nmodule description in `__openerp__.py`.\r\n\r\nI had to separate tests in an other module as I would tested the module with a\r\nreal model but wouldn't see it on production servers.\r\n\r\nI already prepare a [branch running under v7](https://github.com/petrus-v/server-tools/tree/7.0-materialized_sql_view)\r\nI guess if it's like odoo workflow I haven't to make a PR on both branches (7.0 and 8.0) ?\r\n\r\nI was surprised some tested pass in Travis, like this one:\r\n https://travis-ci.org/petrus-v/server-tools/builds/46459751 based on this\r\ncommit: https://github.com/petrus-v/server-tools/commit/ab614eddd7f11dc81251080960f1969e6454d396\r\nwhich should failed.\r\n\r\nregards,\r\n","created_at":"2015-01-09T17:05:46Z","updated_at":"2015-06-02T16:11:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c83a8fa3010a4d3430fd20f468cb8f76c37e5dc2","assignee":null,"milestone":{"url":"https://api.github.com/repos/OCA/server-tools/milestones/3","html_url":"https://github.com/OCA/server-tools/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/server-tools/milestones/3/labels","id":983662,"number":3,"title":"8.0","description":"","creator":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":10,"state":"open","created_at":"2015-02-17T21:52:00Z","updated_at":"2015-06-02T14:47:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/server-tools/pulls/110/commits","review_comments_url":"https://api.github.com/repos/OCA/server-tools/pulls/110/comments","review_comment_url":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/server-tools/issues/110/comments","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/2b59a21264e28f3c5340abd0673a88b60c641aac","head":{"label":"petrus-v:8.0-materialized_sql_view","ref":"8.0-materialized_sql_view","sha":"2b59a21264e28f3c5340abd0673a88b60c641aac","user":{"login":"petrus-v","id":4328507,"avatar_url":"https://avatars.githubusercontent.com/u/4328507?v=3","gravatar_id":"","url":"https://api.github.com/users/petrus-v","html_url":"https://github.com/petrus-v","followers_url":"https://api.github.com/users/petrus-v/followers","following_url":"https://api.github.com/users/petrus-v/following{/other_user}","gists_url":"https://api.github.com/users/petrus-v/gists{/gist_id}","starred_url":"https://api.github.com/users/petrus-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrus-v/subscriptions","organizations_url":"https://api.github.com/users/petrus-v/orgs","repos_url":"https://api.github.com/users/petrus-v/repos","events_url":"https://api.github.com/users/petrus-v/events{/privacy}","received_events_url":"https://api.github.com/users/petrus-v/received_events","type":"User","site_admin":false},"repo":{"id":28394313,"name":"server-tools","full_name":"petrus-v/server-tools","owner":{"login":"petrus-v","id":4328507,"avatar_url":"https://avatars.githubusercontent.com/u/4328507?v=3","gravatar_id":"","url":"https://api.github.com/users/petrus-v","html_url":"https://github.com/petrus-v","followers_url":"https://api.github.com/users/petrus-v/followers","following_url":"https://api.github.com/users/petrus-v/following{/other_user}","gists_url":"https://api.github.com/users/petrus-v/gists{/gist_id}","starred_url":"https://api.github.com/users/petrus-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrus-v/subscriptions","organizations_url":"https://api.github.com/users/petrus-v/orgs","repos_url":"https://api.github.com/users/petrus-v/repos","events_url":"https://api.github.com/users/petrus-v/events{/privacy}","received_events_url":"https://api.github.com/users/petrus-v/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petrus-v/server-tools","description":"Tools for Odoo Administrators to improve some technical features on Odoo.","fork":true,"url":"https://api.github.com/repos/petrus-v/server-tools","forks_url":"https://api.github.com/repos/petrus-v/server-tools/forks","keys_url":"https://api.github.com/repos/petrus-v/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petrus-v/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petrus-v/server-tools/teams","hooks_url":"https://api.github.com/repos/petrus-v/server-tools/hooks","issue_events_url":"https://api.github.com/repos/petrus-v/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/petrus-v/server-tools/events","assignees_url":"https://api.github.com/repos/petrus-v/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/petrus-v/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/petrus-v/server-tools/tags","blobs_url":"https://api.github.com/repos/petrus-v/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petrus-v/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petrus-v/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/petrus-v/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petrus-v/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/petrus-v/server-tools/languages","stargazers_url":"https://api.github.com/repos/petrus-v/server-tools/stargazers","contributors_url":"https://api.github.com/repos/petrus-v/server-tools/contributors","subscribers_url":"https://api.github.com/repos/petrus-v/server-tools/subscribers","subscription_url":"https://api.github.com/repos/petrus-v/server-tools/subscription","commits_url":"https://api.github.com/repos/petrus-v/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/petrus-v/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/petrus-v/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/petrus-v/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/petrus-v/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/petrus-v/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petrus-v/server-tools/merges","archive_url":"https://api.github.com/repos/petrus-v/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petrus-v/server-tools/downloads","issues_url":"https://api.github.com/repos/petrus-v/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/petrus-v/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/petrus-v/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/petrus-v/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petrus-v/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/petrus-v/server-tools/releases{/id}","created_at":"2014-12-23T11:23:04Z","updated_at":"2015-02-05T10:02:34Z","pushed_at":"2015-06-02T13:39:02Z","git_url":"git://github.com/petrus-v/server-tools.git","ssh_url":"git@github.com:petrus-v/server-tools.git","clone_url":"https://github.com/petrus-v/server-tools.git","svn_url":"https://github.com/petrus-v/server-tools","homepage":"https://community.odoo.com/project/30","size":1491,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"7.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"0f98114dc5c21e0d20aac872b0fc6de544d2113a","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":20896532,"name":"server-tools","full_name":"OCA/server-tools","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/server-tools","description":"Tools for Odoo Administrators to improve some technical features on Odoo.","fork":false,"url":"https://api.github.com/repos/OCA/server-tools","forks_url":"https://api.github.com/repos/OCA/server-tools/forks","keys_url":"https://api.github.com/repos/OCA/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/server-tools/teams","hooks_url":"https://api.github.com/repos/OCA/server-tools/hooks","issue_events_url":"https://api.github.com/repos/OCA/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/server-tools/events","assignees_url":"https://api.github.com/repos/OCA/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/server-tools/tags","blobs_url":"https://api.github.com/repos/OCA/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/server-tools/languages","stargazers_url":"https://api.github.com/repos/OCA/server-tools/stargazers","contributors_url":"https://api.github.com/repos/OCA/server-tools/contributors","subscribers_url":"https://api.github.com/repos/OCA/server-tools/subscribers","subscription_url":"https://api.github.com/repos/OCA/server-tools/subscription","commits_url":"https://api.github.com/repos/OCA/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/server-tools/merges","archive_url":"https://api.github.com/repos/OCA/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/server-tools/downloads","issues_url":"https://api.github.com/repos/OCA/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/OCA/server-tools/releases{/id}","created_at":"2014-06-16T18:52:44Z","updated_at":"2015-05-28T00:19:03Z","pushed_at":"2015-06-02T15:59:37Z","git_url":"git://github.com/OCA/server-tools.git","ssh_url":"git@github.com:OCA/server-tools.git","clone_url":"https://github.com/OCA/server-tools.git","svn_url":"https://github.com/OCA/server-tools","homepage":"https://community.odoo.com/project/30","size":5200,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"open_issues_count":40,"forks":126,"open_issues":40,"watchers":51,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/110"},"html":{"href":"https://github.com/OCA/server-tools/pull/110"},"issue":{"href":"https://api.github.com/repos/OCA/server-tools/issues/110"},"comments":{"href":"https://api.github.com/repos/OCA/server-tools/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/server-tools/statuses/2b59a21264e28f3c5340abd0673a88b60c641aac"}}}}