Merge lp:~alhashash/ocb-addons/7.0-bug-1219204 into lp:ocb-addons

Proposed by Mohammad Alhashash
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~alhashash/ocb-addons/7.0-bug-1219204
Merge into: lp:ocb-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:~alhashash/ocb-addons/7.0-bug-1219204
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Review via email: mp+217676@code.launchpad.net
To post a comment you must log in.
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
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10156. By Mohammad Alhashash

OCB merge proposal

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 2014-04-22 13:50:12 +0000
+++ account/account.py 2014-04-29 19:58:32 +0000
@@ -1647,7 +1647,7 @@
1647 # you should use the generate opening entries wizard for that1647 # you should use the generate opening entries wizard for that
1648 def unlink(self, cr, uid, ids, context=None):1648 def unlink(self, cr, uid, ids, context=None):
1649 for move_rec in self.browse(cr, uid, ids, context=context):1649 for move_rec in self.browse(cr, uid, ids, context=context):
1650 if move_rec.opening_reconciliation:1650 if move_rec.opening_reconciliation and not context['regenerate_opening']:
1651 raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \1651 raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \
1652 opening/closing fiscal year process.'))1652 opening/closing fiscal year process.'))
1653 return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)1653 return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context)
16541654
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2014-04-23 14:17:43 +0000
+++ account/account_move_line.py 2014-04-29 19:58:32 +0000
@@ -1029,9 +1029,8 @@
1029 all_moves = obj_move_line.search(cr, uid, ['|',('reconcile_id', 'in', unlink_ids),('reconcile_partial_id', 'in', unlink_ids)])1029 all_moves = obj_move_line.search(cr, uid, ['|',('reconcile_id', 'in', unlink_ids),('reconcile_partial_id', 'in', unlink_ids)])
1030 all_moves = list(set(all_moves) - set(move_ids))1030 all_moves = list(set(all_moves) - set(move_ids))
1031 if unlink_ids:1031 if unlink_ids:
1032 if opening_reconciliation:1032 ctx = {'regenerate_opening':True} if opening_reconciliation else None
1033 obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})1033 obj_move_rec.unlink(cr, uid, unlink_ids, ctx)
1034 obj_move_rec.unlink(cr, uid, unlink_ids)
1035 if all_moves:1034 if all_moves:
1036 obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)1035 obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)
1037 return True1036 return True