Report total profit percentage and filter updated

This commit is contained in:
prakash 2022-04-14 12:38:30 +05:30
parent 2a551ec465
commit 80de65b053
2 changed files with 7 additions and 2 deletions

View File

@ -244,5 +244,10 @@ class ProjectRevenueCustomReport(models.Model):
line['pro_hourly_rate'] = line['budgeted_revenue'] / line['budgeted_hours']
if 'actual_revenue' in line and 'actual_cost' in line and 'expenses_amt' in line and 'id' in line:
line['profit_amt'] = line['actual_revenue'] - line['actual_cost'] - line['expenses_amt']
if 'profit_amt' in line and 'actual_revenue' in line and 'id' in line:
try:
line['profit_per'] = (line['profit_amt'] / line['actual_revenue']) * 100
except ZeroDivisionError:
pass
return res

View File

@ -67,8 +67,8 @@
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="employee_id"/>
<filter string="Fixed rate" name="fixed" domain="[('pricing_type','=','fixed_rate')]"/>
<filter string="Hours are budgeted according to a consultant" name="cons" domain="[('project_type','=','hours_in_consultant')]"/>
<filter string="Total hours are budgeted without division to consultant" name="limit" domain="[('project_type','=','hours_no_limit')]"/>
<filter string="Hours are budgeted according to a consultant" name="cons" domain="[('pricing_type','=','employee_rate'),('project_type','=','hours_in_consultant')]"/>
<filter string="Total hours are budgeted without division to consultant" name="limit" domain="[('pricing_type','=','employee_rate'),('project_type','=','hours_no_limit')]"/>
<filter string="Not Fixed rate" name="notfixed" domain="[('pricing_type','!=','fixed_rate')]"/>
<group expand="1" string="Group By">
<filter string="Project" name="group_project" context="{'group_by':'project_id'}"/>