Merge lp:~openerp-dev/openobject-addons/trunk-bug-735990-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 4549
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-735990-ara
Merge into: lp:openobject-addons
Diff against target: 39 lines (+9/-6)
1 file modified
account/wizard/account_chart.py (+9/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-735990-ara
Reviewer Review Type Date Requested Status
OpenERP buildbot (community) Disapprove
Mustufa Rangwala (Open ERP) (community) Approve
Ashvin Rathod (OpenERP) (community) Needs Resubmitting
qdp (OpenERP) Pending
Review via email: mp+53624@code.launchpad.net

Description of the change

Hello,

Fix: Con not open account chart from Wizard If we passing fiscal year argument

Thanks,
ara

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

rename variable fiscalyear => fiscalyear_id

and if data['fiscalyear']: => if fiscalyear_id:

review: Needs Fixing
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

hello,

I have changed as you describe above.

Thanks,
ara

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve
Revision history for this message
OpenERP buildbot (openerp-buildbot) wrote :

product/test/product_report.yml: 'int' object is unsubscriptable
account/test/account_fiscalyear_close_state.yml: 'int' object is unsubscriptable
project/test/test_project_delegation.yml: 'int' object is unsubscriptable
project_long_term/test/test_schedule_phases_case1.yml: 'int' object is unsubscriptable
project_gtd/test/gtd_test.yml: 'int' object is unsubscriptable

review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/wizard/account_chart.py'
2--- account/wizard/account_chart.py 2011-02-15 12:13:39 +0000
3+++ account/wizard/account_chart.py 2011-03-16 13:29:32 +0000
4@@ -30,12 +30,12 @@
5 _columns = {
6 'fiscalyear': fields.many2one('account.fiscalyear', \
7 'Fiscal year', \
8- help = 'Keep empty for all open fiscal years'),
9+ help='Keep empty for all open fiscal years'),
10 'period_from': fields.many2one('account.period', 'Start period'),
11 'period_to': fields.many2one('account.period', 'End period'),
12 'target_move': fields.selection([('posted', 'All Posted Entries'),
13 ('all', 'All Entries'),
14- ], 'Target Moves', required = True),
15+ ], 'Target Moves', required=True),
16 }
17
18 def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
19@@ -83,13 +83,16 @@
20 result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_tree')
21 id = result and result[1] or False
22 result = act_obj.read(cr, uid, [id], context=context)[0]
23+ fiscalyear_id = data.get('fiscalyear', False) and data['fiscalyear'][0] or False
24 result['periods'] = []
25 if data['period_from'] and data['period_to']:
26- result['periods'] = period_obj.build_ctx_periods(cr, uid, data['period_from'], data['period_to'])
27- result['context'] = str({'fiscalyear': data['fiscalyear'], 'periods': result['periods'], \
28+ period_from = data.get('period_from', False) and data['period_from'][0] or False
29+ period_to = data.get('period_to', False) and data['period_to'][0] or False
30+ result['periods'] = period_obj.build_ctx_periods(cr, uid, period_from, period_to)
31+ result['context'] = str({'fiscalyear': fiscalyear_id, 'periods': result['periods'], \
32 'state': data['target_move']})
33- if data['fiscalyear']:
34- result['name'] += ':' + fy_obj.read(cr, uid, [data['fiscalyear']], context=context)[0]['code']
35+ if fiscalyear_id:
36+ result['name'] += ':' + fy_obj.read(cr, uid, [fiscalyear_id], context=context)[0]['code']
37 return result
38
39 _defaults = {

Subscribers

People subscribed via source and target branches

to all changes: