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
1=== modified file 'account/account.py'
2--- account/account.py 2014-04-22 13:50:12 +0000
3+++ account/account.py 2014-04-29 19:58:32 +0000
4@@ -1647,7 +1647,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 2014-04-23 14:17:43 +0000
16+++ account/account_move_line.py 2014-04-29 19:58:32 +0000
17@@ -1029,9 +1029,8 @@
18 all_moves = obj_move_line.search(cr, uid, ['|',('reconcile_id', 'in', unlink_ids),('reconcile_partial_id', 'in', unlink_ids)])
19 all_moves = list(set(all_moves) - set(move_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 if all_moves:
27 obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)
28 return True