Filter Problems for Financial Report, BS and P&L Reports in OpenERP v6.1and trunk
Bug #1078146 reported by
Michael Aldrin Villamar (FS3)
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP Publisher's Warranty Team |
Bug Description
Target Moves filter in Financial Report, Balance Sheet and Profit & Loss (Accounting > Reporting > Legal Reports > Accounting Reports) does not work properly. It always print 'all entries' even the value of Target Moves is 'all posted entries'. In addition, the period filters does not work if the start and end periods are the same.
Related branches
lp://staging/~openerp-dev/openobject-addons/7.0-staging-mat
- Martin Trigaux (OpenERP): Pending requested
-
Diff: 129 lines (+26/-8)6 files modifiedaccount/project/wizard/account_analytic_chart_view.xml (+5/-5)
account/report/account_financial_report.py (+1/-0)
account/report/account_financial_report.rml (+6/-1)
account/wizard/account_financial_report.py (+3/-2)
account/wizard/account_report_common.py (+1/-0)
project/project.py (+10/-0)
summary: |
- Filter Problems for Financial Report, BS and P&L Reports in OpenERP v6.1 + Filter Problems for Financial Report, BS and P&L Reports in OpenERP + v6.1and trunk |
Changed in openobject-addons: | |
assignee: | OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
To post a comment you must log in.
I've created my module to fix these bugs. Here are some parts of the module. Thanks!
#####
# PROBLEM: there is an error when start and end periods are the same.
# SOLUTION: In build_ctx_periods, return the period_from_id with a list
# FILE: account.py period( osv.osv) :
class account_
_inherit = "account.period"
# FIXED: There is an error if the start and end periods are the same. periods( self, cr, uid, period_from_id, period_to_id): period, self).build_ ctx_periods( cr, uid, period_ from_id= period_ from_id, period_ to_id=period_ to_id)
def build_ctx_
if period_from_id == period_to_id:
return [period_from_id]
return super(account_
account_period()
#####
#####
# PROBLEM: Target Moves filter functionality does not work in Financial Report, BS and P&L.
# SOLUTION: Include Target Moves in context.
# FILE: account_ financial_ report. py financial_ report( osv.osv) : financial. report"
class account_
_inherit = "account.
def _get_balance(self, cr, uid, ids, field_names, args, context=None): get('account. account' )
continue
res[ report. id] = dict((fn, 0.0) for fn in field_names)
account_ ids = []
account_ ids.append( a.id) obj.browse( cr, uid, account_ids, context=context):
for field in field_names:
res[ report. id][field] += getattr(b, field)
report_ types = [x.id for x in report. account_ type_ids]
account_ ids = account_ obj.search( cr, uid, [('user_type','in', report_types), ('type' ,'!=',' view')] , context=context) obj.browse( cr, uid, account_ids, context=context):
for field in field_names:
res[ report. id][field] += getattr(a, field) account_ report_ id:
res2 = self._get_ balance( cr, uid, [report. account_ report_ id.id], field_names, False, context=context)
for field in field_names:
res[ report. id][field] += value[field]
res2 = self._get_ balance( cr, uid, [rec.id for rec in report. children_ ids], field_names, False, context=context)
for field in field_names:
res[ report. id][field] += value[field]
account_obj = self.pool.
res = {}
for report in self.browse(cr, uid, ids, context=context):
if report.id in res:
if report.type == 'accounts':
# it's the sum of the linked accounts
### Use browse method to include context
for a in report.account_ids:
for b in account_
###
elif report.type == 'account_type':
# it's the sum the leaf accounts with such an account type
for a in account_
elif report.type == 'account_report' and report.
# it's the amount of the linked report
for key, value in res2.items():
elif report.type == 'sum':
# it's the sum of the children of this account.report
for key, value in res2.items():
return res
_columns = { function( _get_balance. ..
'balance': fields.