From 13eff344ea46a64180e80cf5d1edb0f7b57e7d20 Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Mon, 25 Mar 2019 12:07:54 +0800 Subject: [PATCH 1/8] [MIG] project_completion_report: Migration to 12.0 --- project_completion_report/README.rst | 61 ++++++ project_completion_report/__init__.py | 5 + project_completion_report/__manifest__.py | 25 +++ project_completion_report/report/__init__.py | 5 + .../report/project_completion_report.py | 176 ++++++++++++++++++ .../report/project_completion_report_view.xml | 103 ++++++++++ .../security/ir.model.access.csv | 2 + 7 files changed, 377 insertions(+) create mode 100644 project_completion_report/README.rst create mode 100644 project_completion_report/__init__.py create mode 100644 project_completion_report/__manifest__.py create mode 100644 project_completion_report/report/__init__.py create mode 100644 project_completion_report/report/project_completion_report.py create mode 100644 project_completion_report/report/project_completion_report_view.xml create mode 100644 project_completion_report/security/ir.model.access.csv diff --git a/project_completion_report/README.rst b/project_completion_report/README.rst new file mode 100644 index 00000000..1cb1085e --- /dev/null +++ b/project_completion_report/README.rst @@ -0,0 +1,61 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +========================= +Project Completion Report +========================= + +This module creates a report that allows you to follow-up the +completion of a project by comparing the estimated time and the +time actually spent in the timesheets. + +Usage +===== + +To use this module, you need to: + +#. Go to Reporting > Project > Project Completion Report + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} + +.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt +.. branch is "8.0" for example + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Sebastien Maillard + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/project_completion_report/__init__.py b/project_completion_report/__init__.py new file mode 100644 index 00000000..f38bc429 --- /dev/null +++ b/project_completion_report/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Elico Corp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import report diff --git a/project_completion_report/__manifest__.py b/project_completion_report/__manifest__.py new file mode 100644 index 00000000..160a7b9c --- /dev/null +++ b/project_completion_report/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# © 2016 - Elico Corp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Project Completion Report", + "summary": "Follow-up project completion (estimated / consumed)", + "version": "10.0.1.0.0", + "category": "Project", + 'website': 'https://www.elico-corp.com', + 'support': 'support@elico-corp.com', + "author": "Elico Corp", + "license": "AGPL-3", + "application": False, + "installable": False, + "depends": [ + "project_timesheet", + "project_issue_sheet", + "project_project_category", + "business_requirement_deliverable_project", + ], + "data": [ + "report/project_completion_report_view.xml", + "security/ir.model.access.csv", + ], +} diff --git a/project_completion_report/report/__init__.py b/project_completion_report/report/__init__.py new file mode 100644 index 00000000..75ef2a91 --- /dev/null +++ b/project_completion_report/report/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Elico Corp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import project_completion_report diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py new file mode 100644 index 00000000..80215275 --- /dev/null +++ b/project_completion_report/report/project_completion_report.py @@ -0,0 +1,176 @@ +# -*- coding: utf-8 -*- +# © 2016 Elico Corp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields, tools + + +class ProjectCompletionReport(models.Model): + """Project Completion Report""" + + _name = "project.completion.report" + # Database table should not be created, use init() instead + _auto = False + _description = "Project Completion Report" + # Field used for the Name + _rec_name = 'activity_name' + + id = fields.Integer('ID', readonly=True) + partner_id = fields.Many2one( + 'res.partner', 'Customer', readonly=True) + master_project_id = fields.Many2one( + 'project.project', 'Master Project', readonly=True, + help="Master Project of the Business Requirement") + br_id = fields.Many2one( + 'business.requirement', 'Bus. Req.', + readonly=True, help="Business Requirement") + project_id = fields.Many2one( + 'project.project', 'Project', readonly=True) + account_id = fields.Many2one( + 'account.analytic.account', 'Analytic Account', readonly=True) + project_state = fields.Char( + 'State', readonly=True, help="Project State") + project_categ_id = fields.Many2one( + 'project.project.category', + 'Project Cat.', readonly=True, help="Project Category") + activity_type = fields.Selection( + [ + ('task', 'Task'), + ('issue', 'Issue'), + ], 'Type', readonly=True, + help="Type is used to separate Tasks and Issues") + activity_id = fields.Char( + 'Activity ID', readonly=True, help="Task ID or Issue ID") + activity_name = fields.Char( + 'Activity Name', readonly=True, help="Task name or Issue name") + user_id = fields.Many2one( + 'res.users', + 'Assignee', + readonly=True, + help="Assignee is not necessarily the one who input the Timesheets") + activity_stage_id = fields.Many2one( + 'project.task.type', 'Stage', + readonly=True, help="Activity Stage") + # FIXME if BR resource UoM is not hours, `qty` needs to be converted + estimated_hours = fields.Float( + 'Est. time', digits=(16, 2), readonly=True, + help="Estimated time (from BR)") + planned_hours = fields.Float( + 'Init. time', digits=(16, 2), readonly=True, + help="Initial time (from Task)") + total_tms = fields.Float( + 'Time spent', digits=(16, 2), readonly=True, + help="Time spent on timesheet") + remaining_hours = fields.Float( + 'Remain. time', digits=(16, 2), readonly=True, + help="Remaining time") + total_hours = fields.Float('Total time', digits=(16, 2), readonly=True) + variance = fields.Float('Variance', digits=(16, 2), readonly=True, + help="Variance between Estimated time (from BR) and Total time") + + def init(self, cr): + """Project Completion Report""" + tools.drop_view_if_exists(cr, 'project_completion_report') + cr.execute(""" + CREATE OR REPLACE VIEW project_completion_report AS ( + -- Since Odoo requires a unique ID for each line and since some + -- issues and tasks might share the same ID, use the row number + -- to ensure each row has a unique ID + SELECT + row_number() OVER + ( + -- Tasks first, then issues + -- Warning: without the sort over the activity type, + -- Odoo is confusing some task IDs as if they were + -- issue IDs + ORDER BY q.activity_type DESC, q.activity_id ASC + ) AS id, q.* + FROM + ( + ( + SELECT + a.partner_id, + b.project_id AS master_project_id, + b.id AS br_id, + p.id AS project_id, + a.id AS account_id, + p.project_categ_id, + p.state AS project_state, + 'task' AS activity_type, + t.id AS activity_id, + t.name AS activity_name, + t.user_id, + t.stage_id AS activity_stage_id, + COALESCE(r.qty, 0) AS estimated_hours, + t.planned_hours, + COALESCE(SUM(al.unit_amount), 0) AS total_tms, + t.remaining_hours, + COALESCE(SUM(al.unit_amount), 0) + + t.remaining_hours AS total_hours, + COALESCE(SUM(al.unit_amount), 0) + + t.remaining_hours - COALESCE(r.qty, 0) + AS variance + FROM + project_project p + -- Link with the analytic account + INNER JOIN account_analytic_account a + ON a.id = p.analytic_account_id + -- Link with the task + INNER JOIN project_task t ON t.project_id = p.id + -- Link with the timesheet + LEFT OUTER JOIN project_task_work tw + ON tw.task_id = t.id + LEFT OUTER JOIN hr_analytic_timesheet tms + ON tms.id = tw.hr_analytic_timesheet_id + LEFT OUTER JOIN account_analytic_line al + ON al.id = tms.line_id + -- Link with the BR + LEFT OUTER JOIN business_requirement b + ON b.id = p.business_requirement_id + -- Link with the BR resource + LEFT OUTER JOIN business_requirement_resource r + ON r.business_requirement_id = b.id + AND r.id = t.br_resource_id + GROUP BY + t.id, p.id, a.id, b.id, r.id + ) + UNION + ( + SELECT + a.partner_id, + b.project_id AS master_project_id, + b.id AS br_id, + p.id AS project_id, + a.id AS account_id, + p.project_categ_id, + p.state AS project_state, + 'issue' AS activity_type, + i.id AS activity_id, + i.name AS activity_name, + i.user_id, + i.stage_id AS activity_stage_id, + 0 AS estimated_hours, + 0 AS planned_hours, + COALESCE(SUM(al.unit_amount), 0) AS total_tms, + 0 AS remaining_hours, + COALESCE(SUM(al.unit_amount), 0) AS total_hours, + COALESCE(SUM(al.unit_amount), 0) AS variance + FROM + project_project p + -- Link with the analytic account + INNER JOIN account_analytic_account a + ON a.id = p.analytic_account_id + -- Link with the issue + INNER JOIN project_issue i ON i.project_id = p.id + -- Link with the timesheet + LEFT OUTER JOIN hr_analytic_timesheet tms + ON tms.issue_id = i.id + LEFT OUTER JOIN account_analytic_line al + ON al.id = tms.line_id + -- Link with the BR + LEFT OUTER JOIN business_requirement b + ON b.id = p.business_requirement_id + GROUP BY + i.id, p.id, a.id, b.id + ) + ) AS q)""") diff --git a/project_completion_report/report/project_completion_report_view.xml b/project_completion_report/report/project_completion_report_view.xml new file mode 100644 index 00000000..6b42b730 --- /dev/null +++ b/project_completion_report/report/project_completion_report_view.xml @@ -0,0 +1,103 @@ + + + + + + Project Completion Tree + project.completion.report + + + + + + + + + + + + + + + + + + + + + + + + + + Project Completion Pivot Table + project.completion.report + + + + + + + + + + + + + + Project Completion Analysis + project.completion.report + form + tree,graph + {} + [] + + + + Project Completion Search + project.completion.report + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project_completion_report/security/ir.model.access.csv b/project_completion_report/security/ir.model.access.csv new file mode 100644 index 00000000..3060c7af --- /dev/null +++ b/project_completion_report/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_project_completion_report,project.completion.report all,model_project_completion_report,base.group_user,1,1,1,1 From 4f141a592d923fa1b081cf8d3ae5b416d91c06ce Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 14:10:21 +0800 Subject: [PATCH 2/8] [MIG] migrate project_completion_report to 12.0 --- oca_dependencies.txt | 2 + project_completion_report/README.rst | 9 +- project_completion_report/__init__.py | 4 - project_completion_report/__manifest__.py | 7 +- project_completion_report/report/__init__.py | 5 +- .../report/project_completion_report.py | 19 +- .../report/project_completion_report_view.xml | 192 +++++++++--------- 7 files changed, 114 insertions(+), 124 deletions(-) diff --git a/oca_dependencies.txt b/oca_dependencies.txt index e69de29b..250f7def 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -0,0 +1,2 @@ +business-requirement https://github.com/OCA/business-requirement.git 12.0 +odoo_enterprise git@github.com:Elico-Corp/odoo_enterprise.git 12.0 \ No newline at end of file diff --git a/project_completion_report/README.rst b/project_completion_report/README.rst index 1cb1085e..a4c98d70 100644 --- a/project_completion_report/README.rst +++ b/project_completion_report/README.rst @@ -1,6 +1,6 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 ========================= Project Completion Report @@ -28,7 +28,7 @@ Bug Tracker =========== Bugs are tracked on `GitHub Issues -`_. In case of trouble, please +`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. @@ -44,6 +44,7 @@ Contributors ------------ * Sebastien Maillard +* Reinhard Sheng Maintainer ---------- diff --git a/project_completion_report/__init__.py b/project_completion_report/__init__.py index f38bc429..65ecf071 100644 --- a/project_completion_report/__init__.py +++ b/project_completion_report/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# © 2016 Elico Corp -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - from . import report diff --git a/project_completion_report/__manifest__.py b/project_completion_report/__manifest__.py index 160a7b9c..20f09642 100644 --- a/project_completion_report/__manifest__.py +++ b/project_completion_report/__manifest__.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- -# © 2016 - Elico Corp -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# © 2016-2019 Elico Corp (https://www.elico-corp.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Project Completion Report", "summary": "Follow-up project completion (estimated / consumed)", - "version": "10.0.1.0.0", + "version": "12.0.1.0.0", "category": "Project", 'website': 'https://www.elico-corp.com', 'support': 'support@elico-corp.com', diff --git a/project_completion_report/report/__init__.py b/project_completion_report/report/__init__.py index 75ef2a91..ac16b606 100644 --- a/project_completion_report/report/__init__.py +++ b/project_completion_report/report/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Elico Corp -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# © 2016-2019 Elico Corp (https://www.elico-corp.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import project_completion_report diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py index 80215275..378ad9f4 100644 --- a/project_completion_report/report/project_completion_report.py +++ b/project_completion_report/report/project_completion_report.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- -# © 2016 Elico Corp -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# © 2016-2019 Elico Corp (https://www.elico-corp.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, tools +from odoo import models, fields, tools class ProjectCompletionReport(models.Model): @@ -118,12 +117,8 @@ def init(self, cr): -- Link with the task INNER JOIN project_task t ON t.project_id = p.id -- Link with the timesheet - LEFT OUTER JOIN project_task_work tw - ON tw.task_id = t.id - LEFT OUTER JOIN hr_analytic_timesheet tms - ON tms.id = tw.hr_analytic_timesheet_id LEFT OUTER JOIN account_analytic_line al - ON al.id = tms.line_id + ON al.task_id = t.id -- Link with the BR LEFT OUTER JOIN business_requirement b ON b.id = p.business_requirement_id @@ -161,10 +156,8 @@ def init(self, cr): INNER JOIN account_analytic_account a ON a.id = p.analytic_account_id -- Link with the issue - INNER JOIN project_issue i ON i.project_id = p.id - -- Link with the timesheet - LEFT OUTER JOIN hr_analytic_timesheet tms - ON tms.issue_id = i.id + INNER JOIN helpdesk_ticket h + ON h.project_id = p.id LEFT OUTER JOIN account_analytic_line al ON al.id = tms.line_id -- Link with the BR diff --git a/project_completion_report/report/project_completion_report_view.xml b/project_completion_report/report/project_completion_report_view.xml index 6b42b730..254ab5db 100644 --- a/project_completion_report/report/project_completion_report_view.xml +++ b/project_completion_report/report/project_completion_report_view.xml @@ -1,103 +1,103 @@ - - + + - - Project Completion Tree - project.completion.report - - - - - - - - - - - - - - - - - - - - - - - + + Project Completion Tree + project.completion.report + + + + + + + + + + + + + + + + + + + + + + + - - Project Completion Pivot Table - project.completion.report - - - - - - - - - - - + + Project Completion Pivot Table + project.completion.report + + + + + + + + + + + - - Project Completion Analysis - project.completion.report - form - tree,graph - {} - [] - + + Project Completion Analysis + project.completion.report + form + tree,graph + {} + [] + - - Project Completion Search - project.completion.report - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Project Completion Search + project.completion.report + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + From c4636db876a9e2425123b9ffab7853cda29483dc Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 14:17:57 +0800 Subject: [PATCH 3/8] [IMP] imp code --- .../report/project_completion_report.py | 8 ++++---- .../report/project_completion_report_view.xml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py index 378ad9f4..acc5e6f1 100644 --- a/project_completion_report/report/project_completion_report.py +++ b/project_completion_report/report/project_completion_report.py @@ -140,10 +140,10 @@ def init(self, cr): p.project_categ_id, p.state AS project_state, 'issue' AS activity_type, - i.id AS activity_id, - i.name AS activity_name, - i.user_id, - i.stage_id AS activity_stage_id, + h.id AS activity_id, + h.name AS activity_name, + h.user_id, + h.stage_id AS activity_stage_id, 0 AS estimated_hours, 0 AS planned_hours, COALESCE(SUM(al.unit_amount), 0) AS total_tms, diff --git a/project_completion_report/report/project_completion_report_view.xml b/project_completion_report/report/project_completion_report_view.xml index 254ab5db..82eb451f 100644 --- a/project_completion_report/report/project_completion_report_view.xml +++ b/project_completion_report/report/project_completion_report_view.xml @@ -72,23 +72,23 @@ - - - - - - - - - From fa94e3fd9a0faf515512eab406701f449d70922a Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 14:26:32 +0800 Subject: [PATCH 4/8] [FIX] fix copyright --- project_completion_report/__manifest__.py | 4 ++-- project_completion_report/report/__init__.py | 3 --- project_completion_report/report/project_completion_report.py | 2 +- .../report/project_completion_report_view.xml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/project_completion_report/__manifest__.py b/project_completion_report/__manifest__.py index 20f09642..e0819c09 100644 --- a/project_completion_report/__manifest__.py +++ b/project_completion_report/__manifest__.py @@ -1,5 +1,5 @@ # © 2016-2019 Elico Corp (https://www.elico-corp.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). { "name": "Project Completion Report", "summary": "Follow-up project completion (estimated / consumed)", @@ -8,7 +8,7 @@ 'website': 'https://www.elico-corp.com', 'support': 'support@elico-corp.com', "author": "Elico Corp", - "license": "AGPL-3", + "license": "LGPL-3", "application": False, "installable": False, "depends": [ diff --git a/project_completion_report/report/__init__.py b/project_completion_report/report/__init__.py index ac16b606..99565ff1 100644 --- a/project_completion_report/report/__init__.py +++ b/project_completion_report/report/__init__.py @@ -1,4 +1 @@ -# © 2016-2019 Elico Corp (https://www.elico-corp.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from . import project_completion_report diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py index acc5e6f1..001acb15 100644 --- a/project_completion_report/report/project_completion_report.py +++ b/project_completion_report/report/project_completion_report.py @@ -1,5 +1,5 @@ # © 2016-2019 Elico Corp (https://www.elico-corp.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import models, fields, tools diff --git a/project_completion_report/report/project_completion_report_view.xml b/project_completion_report/report/project_completion_report_view.xml index 82eb451f..b308bd61 100644 --- a/project_completion_report/report/project_completion_report_view.xml +++ b/project_completion_report/report/project_completion_report_view.xml @@ -1,6 +1,6 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> From cf032d9bc5419d2d96246cf355d60b0b55997455 Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 14:32:09 +0800 Subject: [PATCH 5/8] [FIX] fix depends --- project_completion_report/__manifest__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project_completion_report/__manifest__.py b/project_completion_report/__manifest__.py index e0819c09..d2363ffb 100644 --- a/project_completion_report/__manifest__.py +++ b/project_completion_report/__manifest__.py @@ -10,10 +10,10 @@ "author": "Elico Corp", "license": "LGPL-3", "application": False, - "installable": False, + "installable": True, "depends": [ - "project_timesheet", - "project_issue_sheet", + "hr_timesheet", + "helpdesk_timesheet", "project_project_category", "business_requirement_deliverable_project", ], From a5fa7c67c739ddc9035d1f1ca311325e939338e9 Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 15:19:42 +0800 Subject: [PATCH 6/8] [FIX] issue link fix --- project_completion_report/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_completion_report/README.rst b/project_completion_report/README.rst index a4c98d70..0a310e1b 100644 --- a/project_completion_report/README.rst +++ b/project_completion_report/README.rst @@ -28,7 +28,7 @@ Bug Tracker =========== Bugs are tracked on `GitHub Issues -`_. In case of trouble, please +`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. From 14a4ac956e740dc5eae8a781f077b4da95a927da Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Tue, 26 Mar 2019 15:55:37 +0800 Subject: [PATCH 7/8] [FIX] fix travis --- project_completion_report/report/project_completion_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py index 001acb15..7c334803 100644 --- a/project_completion_report/report/project_completion_report.py +++ b/project_completion_report/report/project_completion_report.py @@ -64,7 +64,8 @@ class ProjectCompletionReport(models.Model): 'Remain. time', digits=(16, 2), readonly=True, help="Remaining time") total_hours = fields.Float('Total time', digits=(16, 2), readonly=True) - variance = fields.Float('Variance', digits=(16, 2), readonly=True, + variance = fields.Float( + 'Variance', digits=(16, 2), readonly=True, help="Variance between Estimated time (from BR) and Total time") def init(self, cr): From 60ddd5c8e44abb0f82e64ae539931d62a780f574 Mon Sep 17 00:00:00 2001 From: Reinhard <779081643@qq.com> Date: Thu, 28 Mar 2019 16:32:20 +0800 Subject: [PATCH 8/8] [FIX] fix slq --- project_completion_report/report/project_completion_report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project_completion_report/report/project_completion_report.py b/project_completion_report/report/project_completion_report.py index 7c334803..a6482f47 100644 --- a/project_completion_report/report/project_completion_report.py +++ b/project_completion_report/report/project_completion_report.py @@ -160,11 +160,11 @@ def init(self, cr): INNER JOIN helpdesk_ticket h ON h.project_id = p.id LEFT OUTER JOIN account_analytic_line al - ON al.id = tms.line_id + ON al.helpdesk_ticket_id = h.id -- Link with the BR LEFT OUTER JOIN business_requirement b ON b.id = p.business_requirement_id GROUP BY - i.id, p.id, a.id, b.id + h.id, p.id, a.id, b.id ) ) AS q)""")