add condition for zero budgeted hour

This commit is contained in:
pawan.sharma 2022-05-18 10:01:17 +05:30
parent 6ce1e29220
commit 24ace4bf2f
1 changed files with 10 additions and 4 deletions

View File

@ -168,11 +168,17 @@ class Project(models.Model):
if record.actual_revenue > 0.0:
record.profit_per = (record.profit_amt / record.actual_revenue) * 100
########################
if record.project_type == 'hours_in_consultant' and record.budgeted_hours > 0.0:
record.hourly_rate = (record.budgeted_revenue / record.budgeted_hours)
if record.project_type == 'hours_in_consultant':
if record.budgeted_hours == 0.0:
record.hourly_rate = 0.0
else:
record.hourly_rate = (record.budgeted_revenue / record.budgeted_hours)
########### Added New code 14 March 2022 ###########
if record.project_type == 'hours_no_limit' and record.budgeted_hours2 > 0.0:
record.hourly_rate = (record.budgeted_revenue / record.budgeted_hours2)
if record.project_type == 'hours_no_limit':
if record.budgeted_hours2 == 0.0:
record.hourly_rate = 0.0
else:
record.hourly_rate = (record.budgeted_revenue / record.budgeted_hours2)
#####################
@api.depends('manager_per', 'hour_distribution')