Report subproject hide updated

This commit is contained in:
root 2022-09-08 14:49:02 +05:30
parent 74830e81f1
commit 9bcfcbc182
2 changed files with 14 additions and 9 deletions

View File

@ -59,6 +59,7 @@ with pro_data as (
PRO.active as project_active,
PRO.project_type,
PRO.pricing_type,
PRO.is_sub_project,
(select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project,
--(select PRO.id from project_subproject_rel as PAR where PRO.id=PAR.project_id limit 1) as parent_project,
STRING_AGG(distinct tag_master.name, ', ') as tag_name,
@ -156,7 +157,7 @@ data1 as (
>= drange_data1.start_date::date + '00:00:00'::time
and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3)
<= drange_data1.end_date::date + '23:59:59'::time
where pro_data.pricing_type = 'fixed_rate'
where pro_data.pricing_type = 'fixed_rate' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
drange_data1.start_date,
drange_data1.end_date,
@ -202,7 +203,7 @@ data2 as (
0.0 AS profit_per
FROM pro_data
left join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit'
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
pro_data.pproject_id,
pro_data.project_active,
@ -250,7 +251,7 @@ SELECT
>= drange_data1.start_date::date + '00:00:00'::time
and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3)
<= drange_data1.end_date::date + '23:59:59'::time
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit'
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
drange_data1.start_date,
drange_data1.end_date,
@ -303,7 +304,7 @@ SELECT
0.0 as profit_per
FROM pro_data
left join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
pro_data.pproject_id,
pro_data.project_active,
@ -348,7 +349,7 @@ SELECT
left join pro_data on pro_data.pproject_id = drange_data2.project_id
left join cons_data1 on cons_data1.project_id=drange_data2.project_id and cons_data1.employee_id=drange_data2.employee_id
and drange_data2.start_date >= cons_data1.start_date and drange_data2.end_date <= cons_data1.end_date
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
drange_data2.start_date,
drange_data2.end_date,
@ -407,7 +408,7 @@ SELECT
>= cons_data1.start_date::date + '00:00:00'::time
and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3)
<= cons_data1.end_date::date + '23:59:59'::time
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False
group by
drange_data1.start_date,
drange_data1.end_date,

View File

@ -89,10 +89,14 @@
<filter string="Tags" name="group_tags" context="{'group_by':'tag_name'}"/>
<filter string="Parent Project" name="group_parent_project" context="{'group_by':'parent_project'}"/>
<!--<filter string="Budgeted Hours" name="budgethrs"
domain="[('timesheet_sdatetime','=',False)]"/>
<filter string="Current Year" name="currentyear"
domain="[('timesheet_sdatetime','=',False)]"/>-->
<filter string="Current Year (Timesheet start date)" name="currentyear"
domain="[('timesheet_sdatetime','&lt;=', time.strftime('%%Y-12-31')),('timesheet_sdatetime','&gt;=',time.strftime('%%Y-01-01'))]"/>
<filter string="Last Year" name="lyear" domain="[('timesheet_sdatetime','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('timesheet_sdatetime','&lt;', time.strftime('%%Y-01-01'))]"/>-->
<filter string="Current Year (Start date)" name="currentyear"
domain="[('start_date','&lt;=', time.strftime('%%Y-12-31')),('start_date','&gt;=',time.strftime('%%Y-01-01'))]"/>
<filter string="Current Year (End date)" name="currentyear"
domain="[('end_date','&lt;=', time.strftime('%%Y-12-31')),('end_date','&gt;=',time.strftime('%%Y-01-01'))]"/>
<filter string="Last Year" name="lyear" domain="[('timesheet_sdatetime','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('timesheet_sdatetime','&lt;', time.strftime('%%Y-01-01'))]"/>
</group>
</search>
</field>