diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index b8d155a993f..0e3ea22c73e 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -115,9 +115,9 @@ class account_voucher(osv.osv):
return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
- if not view_id and context.get('invoice_type', False):
+ if not view_id:
mod_obj = self.pool.get('ir.model.data')
- if context.get('invoice_type') in ('out_invoice', 'out_refund'):
+ if context.get('invoice_type', False) in ('out_invoice', 'out_refund') or context.get('line_type', False) == 'customer':
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
else:
result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml
index a36578bb70b..3202c75e1a5 100644
--- a/addons/account_voucher/account_voucher_view.xml
+++ b/addons/account_voucher/account_voucher_view.xml
@@ -199,7 +199,7 @@
-
+
@@ -211,7 +211,7 @@
-
+
@@ -222,7 +222,7 @@
-
+
@@ -234,7 +234,7 @@
-
+
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index 482ad524f71..40bc6da9c2f 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -19,12 +19,7 @@
#
##############################################################################
-import os
-
from osv import fields, osv
-import tools
-from tools.translate import _
-import addons
import addons
diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py
index c51406f19de..9e8a4d84088 100644
--- a/addons/hr_attendance/hr_attendance.py
+++ b/addons/hr_attendance/hr_attendance.py
@@ -41,9 +41,7 @@ def _employee_get(obj, cr, uid, context=None):
if context is None:
context = {}
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
- if ids:
- return ids[0]
- return False
+ return ids and ids[0] or False
class hr_attendance(osv.osv):
_name = "hr.attendance"
@@ -65,7 +63,7 @@ class hr_attendance(osv.osv):
'day': fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32),
}
_defaults = {
- 'name': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), #Don't remove the lambda, if you remove it then the current time will not change
+ 'name': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), #please don't remove the lambda, if you remove it then the current time will not change
'employee_id': _employee_get,
}
@@ -158,4 +156,4 @@ class hr_employee(osv.osv):
hr_employee()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py
index e2b071de66a..66b8567d070 100644
--- a/addons/hr_attendance/wizard/hr_attendance_byweek.py
+++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py
@@ -47,6 +47,7 @@ class hr_attendance_byweek(osv.osv_memory):
'report_name': 'hr.attendance.allweeks',
'datas': datas,
}
+
hr_attendance_byweek()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file