Use ends_at for record name of period and use language format
issue10740 review334971002 (grafted from d0501664206fdbabc93d2d32c17f87c890ab6b09) --HG-- branch : 6.0
This commit is contained in:
1 parent
0713e0dd5d
commit
8d94215afc
2 files changed
+13
-2
No files matched your search
+8
-2
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user