-
+
- (*) A positive delay means that the employee worked less than recorded.
- (*) A negative delay means that the employee worked more than encoded.
+ (*) A positive delay means that the employee worked less than recorded.
+ (*) A negative delay means that the employee worked more than encoded.
diff --git a/addons/hr_attendance/wizard/__init__.py b/addons/hr_attendance/wizard/__init__.py
new file mode 100644
index 00000000000..447b2047f2c
--- /dev/null
+++ b/addons/hr_attendance/wizard/__init__.py
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+import sign_in_out
+import print_attendance_error
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/wizard/sign_in_out.py b/addons/hr_attendance/wizard/sign_in_out.py
new file mode 100644
index 00000000000..a3e82b9d669
--- /dev/null
+++ b/addons/hr_attendance/wizard/sign_in_out.py
@@ -0,0 +1,194 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import netsvc
+import time
+from tools.translate import _
+
+si_so_form ='''
+'''
+
+si_so_fields = {
+ 'name' : {'string' : "Employee's name", 'type':'char', 'required':True, 'readonly':True},
+ 'state' : {'string' : "Current state", 'type' : 'char', 'required' : True, 'readonly': True},
+}
+
+si_form = '''
+'''
+
+si_fields = {
+ 'success' : {'string' : "Sign in's status", 'type' : 'char', 'required' : True, 'readonly' : True},
+}
+
+so_form = '''
+'''
+
+so_ask_fields = {
+ 'name' : {'string' : "Employee's name", 'type':'char', 'required':True, 'readonly':True},
+ 'last_time' : {'string' : "Your last sign out", 'type' : 'datetime', 'required' : True},
+}
+
+def _si_check(self, cr, uid, data, context):
+ states = {True : 'si', False: 'si_ask_so'}
+ service = netsvc.LocalService('object_proxy')
+ emp_id = data['form']['emp_id']
+ att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id)], limit=1, order='name desc')
+ last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
+ if last_att:
+ last_att = last_att[0]
+ cond = not last_att or last_att['action'] == 'sign_out'
+ return states[cond]
+
+si_ask_form ='''
+'''
+
+si_ask_fields = {
+ 'name' : {'string' : "Employee's name", 'type':'char', 'required':True, 'readonly':True},
+ 'last_time' : {'string' : "Your last sign in", 'type' : 'datetime', 'required' : True},
+}
+
+def _so_check(self, cr, uid, data, context):
+ states = {True : 'so', False: 'so_ask_si'}
+ service = netsvc.LocalService('object_proxy')
+ emp_id = data['form']['emp_id']
+ att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id)], limit=1, order='name desc')
+ last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
+ if last_att:
+ last_att = last_att[0]
+ cond = last_att and last_att['action'] == 'sign_in'
+ return states[cond]
+
+class wiz_si_so(wizard.interface):
+ states = {
+ 'init' : {
+ 'actions' : [_get_empid],
+ 'result' : {'type' : 'form', 'arch' : si_so_form, 'fields' : si_so_fields, 'state' : [('end', 'Cancel'),('si_test', 'Sign in'),('so_test', 'Sign out')] }
+ },
+ 'si_test' : {
+ 'actions' : [],
+ 'result' : {'type' : 'choice', 'next_state': _si_check}
+ },
+ 'si_ask_so' : {
+ 'actions' : [],
+ 'result' : {'type' : 'form', 'arch' : so_ask_form, 'fields' : so_ask_fields, 'state' : [('end', 'Cancel'),('si', 'Sign in') ] }
+ },
+ 'si' : {
+ 'actions' : [_sign_in],
+ 'result' : {'type' : 'state', 'state':'end'}
+ },
+ 'so_test' : {
+ 'actions' : [],
+ 'result' : {'type' : 'choice', 'next_state': _so_check }
+ },
+ 'so_ask_si' : {
+ 'actions' : [],
+ 'result' : {'type' : 'form', 'arch' : si_ask_form, 'fields' : si_ask_fields, 'state' : [('end', 'Cancel'),('so', 'Sign out')] }
+ },
+ 'so' : {
+ 'actions' : [_sign_out],
+ 'result' : {'type' : 'state', 'state':'end'}
+ },
+ }
+wiz_si_so('hr.si_so')
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index f42dfb11761..6d2be72d4e7 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -10,7 +10,35 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -27,76 +55,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -107,13 +89,6 @@
-
-
-
-
-
-
-
@@ -140,7 +115,7 @@
-
+
@@ -148,18 +123,44 @@
- [[ repeatIn(objects,'o') ]]
+ [[ repeatIn(objects,'o') ]]HR Expenses [[ o.name or '' ]]
-
+
- Employee: [[ o.employee_id.name ]]
- Date: [[ time.strftime('%d/%m/%Y', time.strptime(o.date, '%Y-%m-%d')) ]]
- Reference: [[ o.ref ]]
-
+
+