Merge branch 'all_project_timesheet' into 'development'
comment timesheet hours validation See merge request prakash.jain/cor-odoo!197
This commit is contained in:
commit
b0c792005e
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue