diff --git a/attendance.py b/attendance.py index 46474b1316..abd12debf9 100644 --- a/attendance.py +++ b/attendance.py @@ -87,7 +87,10 @@ class Line(ModelSQL, ModelView): return at.date() def get_rec_name(self, name): - return '%s@%s' % (self.employee.rec_name, self.at) + pool = Pool() + Lang = pool.get('ir.lang') + lang = Lang.get() + return '%s@%s' % (self.employee.rec_name, lang.strftime(self.at)) @classmethod def create(cls, vlist): @@ -200,7 +203,10 @@ class Period(Workflow, ModelSQL, ModelView): return 'draft' def get_rec_name(self, name): - return str(self.date) + pool = Pool() + Lang = pool.get('ir.lang') + lang = Lang.get() + return lang.strftime(self.ends_at) @classmethod def get_last_period_date(cls, company): diff --git a/tests/scenario_attendance.rst b/tests/scenario_attendance.rst index 25df9e4d5d..a0af8c4927 100644 --- a/tests/scenario_attendance.rst +++ b/tests/scenario_attendance.rst @@ -46,6 +46,8 @@ Create an attendance record for the employee:: >>> attendance.date == now.date() True + >>> bool(attendance.rec_name) + True When creating a new attendance the type is automatically set:: @@ -65,6 +67,9 @@ Close the period:: >>> period.state 'closed' + >>> bool(period.rec_name) + True + You can't create attendances in closed periods:: >>> attendance = Attendance()