Merge branch 'pawan_branch' into 'development'

update divide by 0 condition

See merge request prakash.jain/cor-odoo!56
This commit is contained in:
pawan.sharma 2021-01-06 04:34:30 -08:00
commit 407fa91197
2 changed files with 3 additions and 2 deletions

View File

@ -178,7 +178,8 @@ class InheritProjectProductEmployeeMap(models.Model):
val.cost = val.project_id.budgeted_revenue * (val.project_id.manager_per/100) * (val.distribution_per/100)
else:
val.cost = val.project_id.budgeted_revenue * (val.project_id.employee_per/100) * (val.distribution_per/100)
val.budgeted_qty = val.cost/val.price_unit
if val.price_unit > 0.0:
val.budgeted_qty = val.cost/val.price_unit
else:
val.cost = 0.0
#val.cost = val.budgeted_qty * val.price_unit

View File

@ -44,7 +44,7 @@
<field name="budgeted_revenue"
attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"/>
<field name="hour_distribution" widget="radio"
attrs="{'invisible': [('project_type','!=','hours_in_consultant')]}"/>
attrs="{'invisible': ['|',('project_type','!=','hours_in_consultant'),('pricing_type','=','fixed_rate')]}"/>
<field name="manager_per" attrs="{'invisible': [('hour_distribution','!=','Percentage')]}"/>
<field name="employee_per" attrs="{'invisible': [('hour_distribution','!=','Percentage')]}"/>
<field name="expenses_per" attrs="{'invisible': [('pricing_type','=','fixed_rate')]}"/>