diff --git a/models/hr_timesheet.py b/models/hr_timesheet.py index ba8b2af8620b87cd568bc24ecad9f89812330104..8feb341e11cd6818b5c0f50fcf00f675461c78a7 100644 --- a/models/hr_timesheet.py +++ b/models/hr_timesheet.py @@ -165,8 +165,8 @@ class ScopHrTimesheet(models.Model): ) total = sum(lines.mapped("unit_amount")) if ( - not self.env.user.company_id.day_working - and total > self.env.user.company_id.day_duration + not self.env.company.day_working + and total > self.env.company.day_duration ): raise ValidationError( _( @@ -174,7 +174,7 @@ class ScopHrTimesheet(models.Model): "Journée du %s" ) % ( - self.env.user.company_id.day_duration, + self.env.company.day_duration, record.date.strftime("%d/%m/%Y"), ) ) @@ -187,7 +187,7 @@ class ScopHrTimesheet(models.Model): [ "|", ("company_id", "=", False), - ("company_id", "=", self.env.user.company_id.id), + ("company_id", "=", self.env.company.id), ("date_from", "<=", dt), ("date_to", ">=", dt), ]