Browse Source

[ADD] b_shift : attendance sheet notifications count

pull/143/head
Elouan Le Bars 5 years ago
parent
commit
e8f27cdf5d
  1. 16
      beesdoo_shift/models/attendance_sheet.py

16
beesdoo_shift/models/attendance_sheet.py

@ -147,8 +147,7 @@ class AttendanceSheetShiftAdded(models.Model):
class AttendanceSheet(models.Model):
_name = "beesdoo.shift.sheet"
_inherit = ["mail.thread"]
# _inherit = ['mail.thread','ir.needaction_mixin']
_inherit = ["mail.thread", "ir.needaction_mixin"]
_description = "Attendance sheets with all the shifts in one time range."
_order = "start_time"
@ -332,9 +331,16 @@ class AttendanceSheet(models.Model):
new_sheet.max_worker_nb += task_template.worker_nb
return new_sheet
# @api.model
# def _needaction_domain_get(self):
# return [('state','=','not_validated')]
# Workaround to display notifications only for unread and not validated
# sheets, via a check on domain.
@api.model
def _needaction_count(self, domain=None):
if domain == [
("is_annotated", "=", True),
("is_read", "=", False),
] or domain == [("state", "=", "not_validated")]:
return self.search_count(domain)
return
@api.multi
def write(self, vals):

Loading…
Cancel
Save