comment timesheet hours validation

This commit is contained in:
pawan.sharma 2021-10-06 22:14:46 +05:30
parent 204899eac1
commit b221e126dc
1 changed files with 5 additions and 4 deletions

View File

@ -236,14 +236,15 @@ class AccountAnalyticLine(models.Model):
@api.model
def create(self, vals):
if vals.get('unit_amount') == 0.0:
raise ValidationError(_("Your can not fill 0.0 hour entry"))
if vals.get('unit_amount') >= 24.0:
raise ValidationError(_("Your can not fill more than 24.0 hour entry"))
# if vals.get('unit_amount') == 0.0:
# raise ValidationError(_("Your can not fill 0.0 hour entry"))
# if vals.get('unit_amount') >= 24.0:
# raise ValidationError(_("Your can not fill more than 24.0 hour entry"))
value = super(AccountAnalyticLine, self).create(vals)
if value and value.project_id:
value.project_id._onchange_calculate_timesheet_hours()
value.project_id._compute_calc()
value._onchange_start_end_date_time()
return value
def write(self, vals):