Merge branch 'development' into 'master'

Development

See merge request prakash.jain/cor-odoo!50
This commit is contained in:
prakash.jain 2021-01-03 22:38:32 -08:00
commit 2b5ae16a99
1 changed files with 2 additions and 2 deletions

View File

@ -39,14 +39,14 @@ class AccountAnalyticLine(models.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('employee_id') and vals.get('project_id'):
"""if vals.get('employee_id') and vals.get('project_id'):
project = self.env['project.project'].search([('id', '=', vals.get('project_id'))])
if project:
for rec in project.sale_line_employee_ids:
if rec.employee_id.id == vals.get('employee_id'):
remain_hour = rec.budgeted_qty - rec.timesheet_hour
if vals.get('unit_amount') > remain_hour:
raise ValidationError(_("Your can not fill entry more than Budgeted hours"))
raise ValidationError(_("Your can not fill entry more than Budgeted hours"))"""
value = super(AccountAnalyticLine, self).create(vals)
return value