|
|
@ -212,20 +212,6 @@ class AttendanceSheet(models.Model): |
|
|
|
) |
|
|
|
] |
|
|
|
|
|
|
|
@api.depends("start_time", "end_time", "week") |
|
|
|
def _compute_name(self): |
|
|
|
for rec in self: |
|
|
|
start_time_dt = fields.Datetime.from_string(rec.start_time) |
|
|
|
start_time_dt = fields.Datetime.context_timestamp( |
|
|
|
rec, start_time_dt |
|
|
|
) |
|
|
|
name = "[%s] - " % fields.Date.to_string(start_time_dt) |
|
|
|
if rec.week: |
|
|
|
name += rec.week + " - " |
|
|
|
if rec.time_slot: |
|
|
|
name += rec.time_slot |
|
|
|
rec.name = name |
|
|
|
|
|
|
|
@api.depends("start_time", "end_time") |
|
|
|
def _compute_time_slot(self): |
|
|
|
for rec in self: |
|
|
@ -241,6 +227,21 @@ class AttendanceSheet(models.Model): |
|
|
|
+ end_time_dt.strftime("%H:%M") |
|
|
|
) |
|
|
|
|
|
|
|
@api.depends("start_time", "end_time", "week") |
|
|
|
def _compute_name(self): |
|
|
|
for rec in self: |
|
|
|
start_time_dt = fields.Datetime.from_string(rec.start_time) |
|
|
|
start_time_dt = fields.Datetime.context_timestamp( |
|
|
|
rec, start_time_dt |
|
|
|
) |
|
|
|
name = "%s - " % (fields.Date.to_string(start_time_dt),) |
|
|
|
if rec.week: |
|
|
|
name += rec.week + "_" |
|
|
|
name += "%s_" % (start_time_dt.strftime("%a"),) |
|
|
|
if rec.time_slot: |
|
|
|
name += rec.time_slot |
|
|
|
rec.name = name |
|
|
|
|
|
|
|
@api.depends("start_time") |
|
|
|
def _compute_day(self): |
|
|
|
for rec in self: |
|
|
@ -494,7 +495,7 @@ class AttendanceSheet(models.Model): |
|
|
|
else: |
|
|
|
actual_shift = self.env["beesdoo.shift.shift"].create( |
|
|
|
{ |
|
|
|
"name": _("[Added Shift]"), |
|
|
|
"name": _("%s (added)" % self.name), |
|
|
|
"task_type_id": added_shift.task_type_id.id, |
|
|
|
"state": added_shift.state, |
|
|
|
"worker_id": added_shift.worker_id.id, |
|
|
|