diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 54e0af4ee26..fa150b291dc 100755
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -124,7 +124,6 @@ class account_analytic_line(osv.osv):
result = round(amount, prec)
if not flag:
result *= -1
-
return {'value': {
'amount': result,
'general_account_id': a,
diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml
index 673cdfab8e1..dd424e17ceb 100755
--- a/addons/account/board_account_view.xml
+++ b/addons/account/board_account_view.xml
@@ -27,6 +27,7 @@
tree,graph
{'group_by':['user_type'], 'group_by_no_leaf':1}
+ [('year','=',time.strftime('%Y'))]
Treasury
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
index e80cb290889..266b4a056d7 100755
--- a/addons/account/report/account_entries_report.py
+++ b/addons/account/report/account_entries_report.py
@@ -94,25 +94,21 @@ class account_entries_report(osv.osv):
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
- def read_group(self, cr, uid, domain, *args, **kwargs):
- todel=[]
+ def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
+ if context is None:
+ context = {}
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
- for arg in domain:
- if arg[0] == 'period_id' and arg[2] == 'current_period':
- current_period = period_obj.find(cr, uid)[0]
- domain.append(['period_id','in',[current_period]])
- todel.append(arg)
- break
- elif arg[0] == 'period_id' and arg[2] == 'current_year':
- current_year = fiscalyear_obj.find(cr, uid)
- ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
- domain.append(['period_id','in',ids])
- todel.append(arg)
- for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
- if a in domain:
- domain.remove(a)
- return super(account_entries_report, self).read_group(cr, uid, domain, *args, **kwargs)
+ if context.get('period', False) == 'current_period':
+ current_period = period_obj.find(cr, uid)[0]
+ domain.append(['period_id','in',[current_period]])
+ elif context.get('year', False) == 'current_year':
+ current_year = fiscalyear_obj.find(cr, uid)
+ ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
+ domain.append(['period_id','in',ids])
+ else:
+ domain = domain
+ return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index d2d5883e947..baa9e15182b 100755
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -70,11 +70,11 @@