{"action":"created","comment":{"url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments/40296075","id":40296075,"diff_hunk":"@@ -0,0 +1,74 @@\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, tools\n+\n+\n+class AnalyticProductionCostReport(models.Model):\n+    _name = \"analytic.production.cost.report\"\n+    _description = \"Analytic Production Cost Report\"\n+    _auto = False\n+\n+    date = fields.Date('Date', readonly=True)\n+    user_id = fields.Many2one('res.users', string='User', readonly=True)\n+    name = fields.Char(string='Description', readonly=True)\n+    partner_id = fields.Many2one('res.partner', string='Partner')\n+    company_id = fields.Many2one(\n+        'res.company', string='Company', required=True)\n+    currency_id = fields.Many2one(\n+        'res.currency', string='Currency', required=True)\n+    account_id = fields.Many2one(\n+        'account.analytic.account', string='Account', required=True)\n+    general_account_id = fields.Many2one(\n+        'account.account', string='General Account', required=True)\n+    journal_id = fields.Many2one(\n+        'account.analytic.journal', string='Journal', required=True)\n+    move_id = fields.Many2one(\n+        'account.move.line', string='Move', required=True)\n+    product_id = fields.Many2one(\n+        'product.product', string='Product', required=True)\n+    product_uom_id = fields.Many2one(\n+        'product.uom', string='Product Unit of Measure', required=True)\n+    production = fields.Many2one(\n+        'mrp.production', string='Production', readonly=True)\n+    workorder = fields.Many2one(\n+        'mrp.production.workcenter.line', string='Work order', readonly=True)\n+    amount = fields.Float(string='amount', readonly=True)\n+    unit_amount = fields.Integer(string='Unit Amount', readonly=True)\n+    nbr = fields.Integer(string='# Entries', readonly=True)\n+\n+    def init(self, cr):\n+        tools.drop_view_if_exists(cr, 'analytic_production_cost_report')\n+        cr.execute(\"\"\"\n+            create or replace view analytic_production_cost_report as (","path":"analytic_production_cost_report/report/analytic_production_cost_report.py","position":44,"original_position":44,"commit_id":"69cbd62ec60225cc55bcfbc23eaa2c9aa2815afe","original_commit_id":"69cbd62ec60225cc55bcfbc23eaa2c9aa2815afe","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":"Como buena práctica, se está dividiendo la consulta en varios métodos que devuelven una parte de la consulta, para que así se pueda extender con herencia cosas como por ejemplo añadir un campo. Aquí tienes un ejemplo: https://github.com/odoo/odoo/blob/8.0/addons/account/report/account_invoice_report.py#L203","created_at":"2015-09-24T08:34:09Z","updated_at":"2015-09-24T08:34:09Z","html_url":"https://github.com/odoomrp/odoomrp-utils/pull/94#discussion_r40296075","pull_request_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/comments/40296075"},"html":{"href":"https://github.com/odoomrp/odoomrp-utils/pull/94#discussion_r40296075"},"pull_request":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94","id":45796524,"html_url":"https://github.com/odoomrp/odoomrp-utils/pull/94","diff_url":"https://github.com/odoomrp/odoomrp-utils/pull/94.diff","patch_url":"https://github.com/odoomrp/odoomrp-utils/pull/94.patch","issue_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/94","number":94,"state":"open","locked":false,"title":"[ADD] analytic_production_cost_report: This module creates the new me…","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":"…nu option \"Analytic production cost analysis\", in the Reporting-Accounting menu.\r\n\r\nNuevo módulo que crea la nueva opción de menú \"Análisis analítica costes de producción\", soliciatada en la reclamación CLM0372-Campos de agrupación en informe de análisis de asientos analíticos","created_at":"2015-09-23T15:51:45Z","updated_at":"2015-09-24T08:34:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c1e81f4a390b56ec4367b93285e67396a6af627","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94/commits","review_comments_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94/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/94/comments","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-utils/statuses/69cbd62ec60225cc55bcfbc23eaa2c9aa2815afe","head":{"label":"alfredoavanzosc:odoomrp-utils-analytic_production_cost_report","ref":"odoomrp-utils-analytic_production_cost_report","sha":"69cbd62ec60225cc55bcfbc23eaa2c9aa2815afe","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":29463626,"name":"odoomrp-utils","full_name":"alfredoavanzosc/odoomrp-utils","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-utils","description":"OdooMRP utilities","fork":true,"url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils","forks_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/forks","keys_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/teams","hooks_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/hooks","issue_events_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/issues/events{/number}","events_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/events","assignees_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/assignees{/user}","branches_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/branches{/branch}","tags_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/tags","blobs_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/languages","stargazers_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/stargazers","contributors_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/contributors","subscribers_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/subscribers","subscription_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/subscription","commits_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/contents/{+path}","compare_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/merges","archive_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/downloads","issues_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/issues{/number}","pulls_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/labels{/name}","releases_url":"https://api.github.com/repos/alfredoavanzosc/odoomrp-utils/releases{/id}","created_at":"2015-01-19T09:36:44Z","updated_at":"2015-01-19T09:36:45Z","pushed_at":"2015-09-24T06:56:34Z","git_url":"git://github.com/alfredoavanzosc/odoomrp-utils.git","ssh_url":"git@github.com:alfredoavanzosc/odoomrp-utils.git","clone_url":"https://github.com/alfredoavanzosc/odoomrp-utils.git","svn_url":"https://github.com/alfredoavanzosc/odoomrp-utils","homepage":"","size":526,"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":"3c605c3027f69fd23e49c119a9e4c71d6f96cfb5","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-09-22T21:19:07Z","pushed_at":"2015-09-24T06:56:34Z","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":1072,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":11,"forks":40,"open_issues":11,"watchers":15,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94"},"html":{"href":"https://github.com/odoomrp/odoomrp-utils/pull/94"},"issue":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/94"},"comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/pulls/94/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/94/commits"},"statuses":{"href":"https://api.github.com/repos/odoomrp/odoomrp-utils/statuses/69cbd62ec60225cc55bcfbc23eaa2c9aa2815afe"}}}}