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
=== modified file 'account/account.py'
--- account/account.py 2013-12-09 10:50:31 +0000
+++ account/account.py 2013-12-19 07:40:19 +0000
@@ -1680,7 +1680,7 @@
1680 # you should use the generate opening entries wizard for that1680 # you should use the generate opening entries wizard for that
1681 def unlink(self, cr, uid, ids, context=None):1681 def unlink(self, cr, uid, ids, context=None):
1682 for move_rec in self.browse(cr, uid, ids, context=context):1682 for move_rec in self.browse(cr, uid, ids, context=context):
1683 if move_rec.opening_reconciliation:1683 if move_rec.opening_reconciliation and not context['regenerate_opening']:
1684 raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \1684 raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \
1685 opening/closing fiscal year process.'))1685 opening/closing fiscal year process.'))
1686 return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)1686 return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)
16871687
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2013-12-09 10:50:31 +0000
+++ account/account_move_line.py 2013-12-19 07:40:19 +0000
@@ -1022,9 +1022,8 @@
1022 unlink_ids += rec_ids1022 unlink_ids += rec_ids
1023 unlink_ids += part_rec_ids1023 unlink_ids += part_rec_ids
1024 if unlink_ids:1024 if unlink_ids:
1025 if opening_reconciliation:1025 ctx = {'regenerate_opening':True} if opening_reconciliation else None
1026 obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})1026 obj_move_rec.unlink(cr, uid, unlink_ids, ctx)
1027 obj_move_rec.unlink(cr, uid, unlink_ids)
1028 return True1027 return True
10291028
1030 def unlink(self, cr, uid, ids, context=None, check=True):1029 def unlink(self, cr, uid, ids, context=None, check=True):

Subscribers

People subscribed via source and target branches

to all changes: