From 72c6bc7ac5408996ee010a65afb7f57a35697c6e Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 29 Oct 2010 11:25:58 +0530 Subject: [PATCH 1/3] [FIX] account: view while selecting voucher_id(payment) for account.bank.statement.line from bank and cash statement bzr revid: psi@tinyerp.co.in-20101029055558-awbslxjkm255edod --- addons/account_voucher/account_voucher.py | 4 ++-- addons/account_voucher/account_voucher_view.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 @@ - + From 62fba6d0bbd65e3947d74af5cd6f58ffc3e5e590 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 29 Oct 2010 11:37:06 +0530 Subject: [PATCH 2/3] [REF] HR: Removed warnings from buildbot (import statetement unused) bzr revid: mra@mra-laptop-20101029060706-r1fmgelwv9dwrpt9 --- addons/hr/hr.py | 5 ----- 1 file changed, 5 deletions(-) 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 From a6d42b32e2a36a116feb64d4cdec9a3bf0e1b00d Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 29 Oct 2010 12:54:30 +0530 Subject: [PATCH 3/3] [REF] hr_attenedace: code improved bzr revid: mra@mra-laptop-20101029072430-d1siyfqhmftqka56 --- addons/hr_attendance/hr_attendance.py | 8 +++----- addons/hr_attendance/wizard/hr_attendance_byweek.py | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) 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