From 4c4f5d94a6a4b61ac1e12639009a66988008f8c1 Mon Sep 17 00:00:00 2001 From: projectsodoo Date: Thu, 25 Feb 2021 10:30:25 +0530 Subject: [PATCH] Sub project alias changed --- .../report/project_budget_amt_analysis.py | 14 +++++++------- .../report/project_budget_hrs_analysis.py | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/project_report/report/project_budget_amt_analysis.py b/project_report/report/project_budget_amt_analysis.py index 95f0a30..f5b2b4a 100755 --- a/project_report/report/project_budget_amt_analysis.py +++ b/project_report/report/project_budget_amt_analysis.py @@ -39,10 +39,10 @@ class BudgetAmtAnalysis(models.Model): tools.drop_view_if_exists(self._cr, self._table) self._cr.execute(""" CREATE OR REPLACE VIEW %s AS ( - SELECT ROW_NUMBER() OVER() as id, project_id, parent_project, start_date, end_date, timesheet_date, partner_id, employee_id, amount_type, pricing_type, project_type, revenue from ( + SELECT ROW_NUMBER() OVER() as id, project_id, parentproject as parent_project, start_date, end_date, timesheet_date, partner_id, employee_id, amount_type, pricing_type, project_type, revenue from ( SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, @@ -58,7 +58,7 @@ class BudgetAmtAnalysis(models.Model): union SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, @@ -77,7 +77,7 @@ class BudgetAmtAnalysis(models.Model): union SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, @@ -93,7 +93,7 @@ class BudgetAmtAnalysis(models.Model): union SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, @@ -116,7 +116,7 @@ class BudgetAmtAnalysis(models.Model): union SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, @@ -137,7 +137,7 @@ class BudgetAmtAnalysis(models.Model): union SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro.date_start AS start_date, pro.date AS end_date, pro.partner_id AS partner_id, diff --git a/project_report/report/project_budget_hrs_analysis.py b/project_report/report/project_budget_hrs_analysis.py index de52b0e..7d6f4f9 100755 --- a/project_report/report/project_budget_hrs_analysis.py +++ b/project_report/report/project_budget_hrs_analysis.py @@ -49,7 +49,7 @@ class BudgetHrsAnalysis(models.Model): SELECT ROW_NUMBER() OVER() as id, project_id, - parent_project, + parentproject as parent_project, startdate as start_date, enddate as end_date, pricing_type as pricing_type, @@ -60,7 +60,7 @@ class BudgetHrsAnalysis(models.Model): hours from ( SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, pro_emp.employee_id AS employee_id, date_start AS startdate, date AS enddate, @@ -76,7 +76,7 @@ class BudgetHrsAnalysis(models.Model): Union all SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, null::int AS employee_id, date_start AS startdate, date AS enddate, @@ -92,7 +92,7 @@ class BudgetHrsAnalysis(models.Model): Union all SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, AAL.employee_id AS employee_id, coalesce(pro.date_start, (select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id)) AS startdate, (select max(al.end_datetime::date) from account_analytic_line as al) as enddate, @@ -109,7 +109,7 @@ class BudgetHrsAnalysis(models.Model): Union all SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, AAL.employee_id AS employee_id, coalesce(pro.date_start, (select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id)) AS startdate, (select max(al.end_datetime::date) from account_analytic_line as al) as enddate, @@ -125,7 +125,7 @@ class BudgetHrsAnalysis(models.Model): Union all SELECT pro.id AS project_id, - (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, + (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parentproject, AAL.employee_id AS employee_id, pro.date_start AS startdate, (select max(al.end_datetime::date) from account_analytic_line as al) as enddate,