Merge branch 'development' into 'master'
Development See merge request prakash.jain/cor-odoo!192
This commit is contained in:
commit
4ffa068035
|
@ -225,16 +225,16 @@ class AccountAnalyticLine(models.Model):
|
|||
if rec.start_datetime:
|
||||
rec.date = rec.start_datetime.date()
|
||||
|
||||
@api.constrains('start_datetime', 'end_datetime', 'employee_id')
|
||||
def _check_date(self):
|
||||
for entry in self.filtered('employee_id'):
|
||||
domain = [
|
||||
('start_datetime', '<', entry.end_datetime),
|
||||
('end_datetime', '>', entry.start_datetime),
|
||||
('employee_id', '=', entry.employee_id.id),
|
||||
('id', '!=', entry.id),
|
||||
]
|
||||
entries = self.search_count(domain)
|
||||
if entries:
|
||||
raise ValidationError(
|
||||
_('You can not set 2 timesheet entries that overlaps on the same day for the same employee.'))
|
||||
# @api.constrains('start_datetime', 'end_datetime', 'employee_id')
|
||||
# def _check_date(self):
|
||||
# for entry in self.filtered('employee_id'):
|
||||
# domain = [
|
||||
# ('start_datetime', '<', entry.end_datetime),
|
||||
# ('end_datetime', '>', entry.start_datetime),
|
||||
# ('employee_id', '=', entry.employee_id.id),
|
||||
# ('id', '!=', entry.id),
|
||||
# ]
|
||||
# entries = self.search_count(domain)
|
||||
# if entries:
|
||||
# raise ValidationError(
|
||||
# _('You can not set 2 timesheet entries that overlaps on the same day for the same employee.'))
|
||||
|
|
Loading…
Reference in New Issue