Merge lp:~openerp-dev/openobject-addons/trunk-bug-1219204-cod into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1219204-cod
Merge into: lp:openobject-addons
Diff against target: 28 lines (+3/-4)
2 files modified
account/account.py (+1/-1)
account/account_move_line.py (+2/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1219204-cod
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) (community) Needs Fixing
OpenERP Core Team Pending
Review via email: mp+199623@code.launchpad.net

Description of the change

Hello,

  I have fixed this bug "error when re-generating opening entries",i unlink the opening entry.

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.
Revision history for this message
Mohammad Alhashash (alhashash) wrote :

This branch should be updated to prevent conflict on the current v7 addons. Please check lp:~alhashash/openobject-addons/7.0-bug-1219204

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

#24 don't loose the context here. I propose
context=dict(context or {}, regenerate_opening=True)

Then you should move #9 before the loop, as we don't need to loop if this key is set

review: Needs Fixing

Unmerged revisions

9020. By Mohammad Alhashash

[FIX] Fixed this bug: error when re-generating opening entries

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2013-12-09 10:50:31 +0000
3+++ account/account.py 2013-12-19 07:40:19 +0000
4@@ -1680,7 +1680,7 @@
5 # you should use the generate opening entries wizard for that
6 def unlink(self, cr, uid, ids, context=None):
7 for move_rec in self.browse(cr, uid, ids, context=context):
8- if move_rec.opening_reconciliation:
9+ if move_rec.opening_reconciliation and not context['regenerate_opening']:
10 raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \
11 opening/closing fiscal year process.'))
12 return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)
13
14=== modified file 'account/account_move_line.py'
15--- account/account_move_line.py 2013-12-09 10:50:31 +0000
16+++ account/account_move_line.py 2013-12-19 07:40:19 +0000
17@@ -1022,9 +1022,8 @@
18 unlink_ids += rec_ids
19 unlink_ids += part_rec_ids
20 if unlink_ids:
21- if opening_reconciliation:
22- obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
23- obj_move_rec.unlink(cr, uid, unlink_ids)
24+ ctx = {'regenerate_opening':True} if opening_reconciliation else None
25+ obj_move_rec.unlink(cr, uid, unlink_ids, ctx)
26 return True
27
28 def unlink(self, cr, uid, ids, context=None, check=True):

Subscribers

People subscribed via source and target branches

to all changes: