From ddd6f9b8d5c6c5437dd324a38018527e18a32c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20L=C3=B3pez=20Ram=C3=ADrez?= Date: Mon, 26 Oct 2020 11:08:27 +0100 Subject: [PATCH] Translate Status field in beesdoo.shift.shift --- beesdoo_shift/models/task.py | 11 ++++++----- beesdoo_worker_status/models/task.py | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/beesdoo_shift/models/task.py b/beesdoo_shift/models/task.py index 0fa1b330f..eb5d3e273 100644 --- a/beesdoo_shift/models/task.py +++ b/beesdoo_shift/models/task.py @@ -3,6 +3,7 @@ from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError +from odoo.tools.translate import _ class Task(models.Model): @@ -19,11 +20,11 @@ class Task(models.Model): ################################## def _get_selection_status(self): return [ - ("open", "Confirmed"), - ("done", "Attended"), - ("absent", "Absent"), - ("excused", "Excused"), - ("cancel", "Cancelled"), + ("open", _("Confirmed")), + ("done", _("Attended")), + ("absent", _("Absent")), + ("excused", _("Excused")), + ("cancel", _("Cancelled")), ] def _get_color_mapping(self, state): diff --git a/beesdoo_worker_status/models/task.py b/beesdoo_worker_status/models/task.py index c8bf89a38..b4a9c5790 100644 --- a/beesdoo_worker_status/models/task.py +++ b/beesdoo_worker_status/models/task.py @@ -1,4 +1,5 @@ from odoo import fields, models +from odoo.tools.translate import _ class Task(models.Model): @@ -10,12 +11,12 @@ class Task(models.Model): def _get_selection_status(self): return [ - ("open", "Confirmed"), - ("done", "Attended"), - ("absent_2", "Absent - 2 compensations"), - ("absent_1", "Absent - 1 compensation"), - ("absent_0", "Absent - 0 compensation"), - ("cancel", "Cancelled"), + ("open", _("Confirmed")), + ("done", _("Attended")), + ("absent_2", _("Absent - 2 compensations")), + ("absent_1", _("Absent - 1 compensation")), + ("absent_0", _("Absent - 0 compensation")), + ("cancel", _("Cancelled")), ] def _get_color_mapping(self, state):