diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py index 740a97cea8e..3bfdff40b57 100644 --- a/addons/account/wizard/account_chart.py +++ b/addons/account/wizard/account_chart.py @@ -30,12 +30,12 @@ class account_chart(osv.osv_memory): _columns = { 'fiscalyear': fields.many2one('account.fiscalyear', \ 'Fiscal year', \ - help = 'Keep empty for all open fiscal years'), + help='Keep empty for all open fiscal years'), 'period_from': fields.many2one('account.period', 'Start period'), 'period_to': fields.many2one('account.period', 'End period'), 'target_move': fields.selection([('posted', 'All Posted Entries'), ('all', 'All Entries'), - ], 'Target Moves', required = True), + ], 'Target Moves', required=True), } def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None): @@ -83,16 +83,16 @@ class account_chart(osv.osv_memory): result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_tree') id = result and result[1] or False result = act_obj.read(cr, uid, [id], context=context)[0] - fiscalyear = data.get('fiscalyear', False) and data['fiscalyear'][0] or False + fiscalyear_id = data.get('fiscalyear', False) and data['fiscalyear'][0] or False result['periods'] = [] if data['period_from'] and data['period_to']: period_from = data.get('period_from', False) and data['period_from'][0] or False period_to = data.get('period_to', False) and data['period_to'][0] or False result['periods'] = period_obj.build_ctx_periods(cr, uid, period_from, period_to) - result['context'] = str({'fiscalyear': fiscalyear, 'periods': result['periods'], \ + result['context'] = str({'fiscalyear': fiscalyear_id, 'periods': result['periods'], \ 'state': data['target_move']}) - if data['fiscalyear']: - result['name'] += ':' + fy_obj.read(cr, uid, [fiscalyear], context=context)[0]['code'] + if fiscalyear_id: + result['name'] += ':' + fy_obj.read(cr, uid, [fiscalyear_id], context=context)[0]['code'] return result _defaults = {