remove total 100% validation

This commit is contained in:
pawan.sharma 2022-06-22 10:14:03 +05:30
parent 56154d28be
commit be776fd047
1 changed files with 2 additions and 6 deletions

View File

@ -200,14 +200,14 @@ class Project(models.Model):
for rec in self.sale_line_employee_ids:
if rec.distribution_per > 100:
raise ValidationError(_("Percentage should be less than or equal to 100"))
if rec.role == 'Manager':
"""if rec.role == 'Manager':
manager_total = manager_total + rec.distribution_per
if manager_total > 100:
raise ValidationError(_("Manager Distribution Percentage should be less than or equal to 100"))
else:
employee_total = employee_total + rec.distribution_per
if employee_total > 100:
raise ValidationError(_("Employee Distribution Percentage should be less than or equal to 100"))
raise ValidationError(_("Employee Distribution Percentage should be less than or equal to 100"))"""
@api.onchange('budgeted_revenue', 'expenses_per')
@ -350,15 +350,11 @@ class InheritProjectProductEmployeeMap(models.Model):
def _compute_total_cost(self):
for val in self:
if val.project_id.project_type == 'hours_in_consultant':
print('111111111111')
if val.hour_distribution == 'Percentage':
print('22222222222222')
if val.role == 'Manager':
print('3333333333')
val.cost = val.project_id.budgeted_revenue * (val.project_id.manager_per / 100) * (
val.distribution_per / 100)
else:
print('44444444444444')
val.cost = val.project_id.budgeted_revenue * (val.project_id.employee_per / 100) * (
val.distribution_per / 100)
if val.price_unit > 0.0: