Merge lp:~openerp-dev/openobject-addons/trunk-bug-834512-jap into lp:openobject-addons

Proposed by Jagdish Panchal (Open ERP)
Status: Merged
Merged at revision: 6044
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-834512-jap
Merge into: lp:openobject-addons
Diff against target: 12 lines (+2/-0)
1 file modified
account/account_move_line.py (+2/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-834512-jap
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Needs Fixing
Meera Trambadia (OpenERP) (community) Approve
qdp (OpenERP) Pending
Review via email: mp+85797@code.launchpad.net

Description of the change

Hello,

Fixed key error of journal_id while creating journal items --fixes lp:834512

Thanks
JAP

To post a comment you must log in.
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) :
review: Approve
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

If there is not journal_id in context as well as there is no move_id in context then you use "search_default_journal_id" to replace in context['journal_id']. I think this is not correct. Each time if you change the journal from search view and try to create entries. It pass old search_default_journal_id in context always.

And if you use Accounting/Journal Entries/Journal Items menu to create journal entries, you can see it will not work with your code.

Thanks,
Mustufa

review: Needs Fixing
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

If I have tested using trunk webclient, I had journal_id key in context. it means somewhere gtk miss this key in its context.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2011-11-14 11:34:05 +0000
3+++ account/account_move_line.py 2011-12-15 06:34:26 +0000
4@@ -1249,6 +1249,8 @@
5 if len(period_candidate_ids) != 1:
6 raise osv.except_osv(_('Encoding error'), _('No period found or period given is ambigous.'))
7 context['period_id'] = period_candidate_ids[0][0]
8+ if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
9+ context['journal_id'] = context.get('search_default_journal_id')
10 self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
11 move_id = vals.get('move_id', False)
12 journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)

Subscribers

People subscribed via source and target branches

to all changes: