Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-one-move-fix-jge into lp:banking-addons/bank-statement-reconcile-70

Proposed by Joël Grand-Guillaume @ camptocamp
Status: Work in progress
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-one-move-fix-jge
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 65 lines (+10/-14)
1 file modified
account_statement_one_move/statement.py (+10/-14)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-one-move-fix-jge
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp Needs Fixing
Leonardo Pistone manual tests Disapprove
Review via email: mp+209867@code.launchpad.net

Description of the change

Hi,

This merge contain:

[FIX] Confirmation / cancellation of statement
[FIX] Add context for account_contraints compatibility in button_cancel
[FIX] Do not validate a move on statement confirmation

This is a return after testing that on a customer instance.

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

Joël,

Can you confirm there are no duplicate MPs and bugs to link to that one?
In that case, I approve.

style-wise, there are spaces missing on l56.

Thanks!

review: Needs Information (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi Leonardo,

I fixed the space, thanks I missed it. I have no bug report on it as this midule just land here yesterday. Tested on the last customer installation, it appear that we missed some trouble in the review. This MP correct them.

Regards,

Joël

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Joël, ok!

review: Approve (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

It appears that this module doesn't work at all on my test instance... I didn't had the time to understand properly why, but it creates wrong move. Sometime you have really one move and sometime not at all.

It override a large portion of code to creates the move line and even discussing with Guewen we didn't find a clean way to solve.

So for now I STRONGLY RECOMMEND NOT TO USE this module !

Regards,

Joël

Revision history for this message
Leonardo Pistone (lepistone) wrote :

I change my vote then. Thanks.

review: Disapprove (manual tests)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) :
review: Needs Fixing
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/bank-statement-reconcile. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Unmerged revisions

135. By Joël Grand-Guillaume @ camptocamp

[FIX] space for PEP8

134. By Joël Grand-Guillaume @ camptocamp

[FIX] Confirmation / cancellation of statement
[FIX] Add context for account_contraints compatibility in button_cancel
[FIX] Do not validate a move on statement confirmation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_statement_one_move/statement.py'
2--- account_statement_one_move/statement.py 2014-02-07 13:24:37 +0000
3+++ account_statement_one_move/statement.py 2014-03-07 11:59:42 +0000
4@@ -58,11 +58,12 @@
5 def _prepare_move(self, cr, uid, st_line, st_line_number, context=None):
6 res = super(account_bank_statement, self).\
7 _prepare_move(cr, uid, st_line, st_line_number, context=context)
8- res.update({
9- 'ref': st_line.statement_id.name,
10- 'name': st_line.statement_id.name,
11- 'date': st_line.statement_id.date,
12- })
13+ if st_line.statement_id.profile_id.one_move:
14+ res.update({
15+ 'ref': st_line.statement_id.name,
16+ 'name': '/',
17+ 'date': st_line.statement_id.date,
18+ })
19 return res
20
21
22@@ -123,19 +124,13 @@
23 company_currency_id, context=context)
24 return account_move_line_obj.create(cr, uid, bank_move_vals, context=context)
25
26- def _valid_move(self, cr, uid, move_id, context=None):
27- move_obj = self.pool.get('account.move')
28- move = move_obj.browse(cr, uid, move_id, context=context)
29- move_obj.post(cr, uid, [move_id], context=context)
30- return True
31-
32
33 def _prepare_transfer_move_line_vals(self, cr, uid, st, name, amount, move_id, context=None):
34 """
35 Prepare the dict of values to create the transfer move lines.
36 """
37 account_id = st.profile_id.journal_id.default_debit_account_id.id
38- partner_id = st.profile_id.partner_id and profile.partner_id.id or False
39+ partner_id = st.profile_id.partner_id and st.profile_id.partner_id.id or False
40 if amount < 0.0:
41 debit = 0.0
42 credit = -amount
43@@ -201,7 +196,6 @@
44 move_id = context['move_id']
45 move = move_obj.browse(cr, uid, move_id, context=context)
46 transfe_line_ids = self.create_move_transfer_lines(cr, uid, move, st, context=context)
47- self._valid_move(cr, uid, move_id, context=context)
48 lines_ids = [x.id for x in st.line_ids]
49 st_line_obj.write(cr, uid, lines_ids,
50 {'move_ids': [(4, move_id, False)]},
51@@ -210,6 +204,9 @@
52
53 def button_cancel(self, cr, uid, ids, context=None):
54 done = []
55+ if context is None:
56+ context = {}
57+ context['from_parent_object'] = True
58 for st in self.browse(cr, uid, ids, context=context):
59 if st.profile_id.one_move and st.line_ids:
60 for move in st.line_ids[0].move_ids:
61@@ -222,4 +219,3 @@
62 context=context)
63 return True
64
65-

Subscribers

People subscribed via source and target branches