From ba082a347da5cf1b0b55da7e50411677d49001e4 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 19 Aug 2008 23:49:26 +0200 Subject: [PATCH] Bugfixes bzr revid: fp@tinyerp.com-20080819214926-jhjchub2iow3h30b --- addons/account/account.py | 27 ++++++++++++----------- addons/hr_timesheet/hr_timesheet_view.xml | 12 +++++++++- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b56b86e21fc..8e0b0d1abd2 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -177,20 +177,21 @@ class account_account(osv.osv): } ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) acc_set = ",".join(map(str, ids2)) - query = self.pool.get('account.move.line')._query_get(cr, uid, - context=context) - cr.execute(("SELECT l.account_id, " +\ - ' , '.join(map(lambda x: mapping[x], field_names)) + - "FROM " \ - "account_move_line l " \ - "WHERE " \ - "l.account_id IN (%s) " \ - "AND " + query + " " \ - "GROUP BY l.account_id") % (acc_set, )) - accounts = {} - for res in cr.fetchall(): - accounts[res[0]] = res[1:] + if ids2: + query = self.pool.get('account.move.line')._query_get(cr, uid, + context=context) + cr.execute(("SELECT l.account_id, " +\ + ' , '.join(map(lambda x: mapping[x], field_names)) + + "FROM " \ + "account_move_line l " \ + "WHERE " \ + "l.account_id IN (%s) " \ + "AND " + query + " " \ + "GROUP BY l.account_id") % (acc_set, )) + + for res in cr.fetchall(): + accounts[res[0]] = res[1:] res = {} for id in ids: diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index e1995546d75..da7a0089b20 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -60,9 +60,19 @@ + + My Working Hours of The Day + ir.actions.act_window + hr.analytic.timesheet + form + tree,form + [('user_id','=',uid),('date', '=',time.strftime('%Y-%m-%d'))] + + + - Workin Hours + Working Hours ir.actions.act_window hr.analytic.timesheet form