Merge branch 'copy_master' into 'master'

add condition for zero budgeted hour

See merge request prakash.jain/cor-odoo!229
This commit is contained in:
pawan.sharma 2022-05-19 04:23:00 +00:00
commit 17f9914b3f
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')