Merge branch 'all_project_timesheet' into 'development'

comment timesheet hours validation

See merge request prakash.jain/cor-odoo!197
This commit is contained in:
pawan.sharma 2021-10-06 16:50:45 +00:00
commit b0c792005e
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):