if attendences and attendences[-1]['action'] == 'sign_in':
attendences.append({'name': tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
# sum up the attendances' durations
+ ldt = None
for att in attendences:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
- if att['action'] == 'sign_out':
+ if ldt and att['action'] == 'sign_out':
wh += (dt - ldt).seconds/60/60
- ldt = dt
+ else:
+ ldt = dt
# Week xml representation
# wh = hour2str(wh)
today_xml = '<day num="%s"><wh>%s</wh></day>' % ((today - month).days+1, round(wh,2))
if attendances and attendances[-1]['action'] == 'sign_in':
attendances.append({'name': n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_out'})
# sum up the attendances' durations
+ ldt = None
for att in attendances:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
- if att['action'] == 'sign_out':
+ if ldt and att['action'] == 'sign_out':
week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + ((dt - ldt).seconds/3600)
+ else:
+ ldt = dt
# Week xml representation
week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % n_monday.strftime('%Y-%m-%d')]
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [int_id], context=context)
if (not wait) and phase.mail_feature:
- body = phase.mail_body % {'employee_name': child.name, 'user_signature': user.signature,
+ body = phase.mail_body % {'employee_name': child.name, 'user_signature': child.user_id.signature,
'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time }
sub = phase.email_subject
dest = [child.work_email]
if dest:
- tools.email_send(src, dest, sub, body)
+ tools.email_send(evaluation.employee_id.work_email, dest, sub, body)
self.write(cr, uid, ids, {'state':'wait'}, context=context)
return True
if record.case_id:
self.pool.get('crm.meeting').unlink(cr, uid, [record.case_id.id])
if record.linked_request_ids:
- list_ids = []
- [list_ids.append(i) for id in record.linked_request_ids]
+ list_ids = [ lr.id for lr in record.linked_request_ids]
self.holidays_cancel(cr, uid, list_ids)
self.unlink(cr, uid, list_ids)
def _get_and_change_date_format_for_swiss (self,date_to_format):
date_formatted=''
if date_to_format:
- date_formatted = strptime (date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
+ date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
return date_formatted
def _explode_name(self,chaine,length):
return Stringer
def explode_this(self,chaine,length):
- chaine = rstrip(chaine)
+ chaine = chaine.rstrip()
ast = list(chaine)
i = length
while i <= len(ast):
from tools import config
from tools.translate import _
-
-
def prev_bounds(cdate=False):
when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
this_first = date(when.year, when.month, 1)
line_ids += [movel_pool.create(cr, uid, rec, context=context)]
- for contrub in line.category_id.contribute_ids:
- print contrib.name, contrub.code, contrub.amount_type, contrib.contribute_per, line.total
+ # if self._debug:
+ # for contrib in line.category_id.contribute_ids:
+ # _log.debug("%s %s %s %s %s", contrib.name, contrub.code, contrub.amount_type, contrib.contribute_per, line.total)
adj_move_id = False
if total_deduct > 0:
return case.user_id and case.user_id.id or False
def _date_category(self, cr, uid, context=None):
+ case_obj = self.pool.get('hr.applicant')
if context is None:
context = {}
+ case = case_obj.browse(cr, uid, context['active_id'], context=context)
categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')], context=context)
return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
self.__usr = user
def __getitem__(self, name):
-
if name in ('__obj', '__user'):
- return super(ExprContext, self).__getitem__(name)
-
+ return super(Env, self).__getitem__(name)
if name == 'user':
return self.__user
-
if name == 'object':
return self.__obj
-
return self.__obj[name]
class process_process(osv.osv):
if hasattr(self, 'count'):
data = self.env[namespace]
test = key in data
- ls
self.count = True
return key in self.env[namespace]
trail = url[i:] + trail
url = url[0:i]
- url = cleanURL(url)
+ url = self.cleanURL(url)
sb.append(u'<a href="')
sb.append(url)
if toclevel < wgMaxTocLevel:
toc.append(u"</li>\n")
toc.append(u"</ul>\n</li>\n" * max(0, toclevel - 1))
- toc.insert(0, u'<div id="toc"><h2>' + _('Table of Contents') + '</h2>')
+ #TODO: use gettext
+ #toc.insert(0, u'<div id="toc"><h2>' + _('Table of Contents') + '</h2>')
+ toc.insert(0, u'<div id="toc"><h2>Table of Contents</h2>')
toc.append(u'</ul>\n</div>')
# split up and insert constructed headlines