Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_voucher_killer_vre into lp:banking-addons/bank-statement-reconcile-70

Proposed by Vincent Renaville@camptocamp
Status: Work in progress
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_voucher_killer_vre
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 95 lines (+41/-9) (has conflicts)
1 file modified
statement_voucher_killer/voucher.py (+41/-9)
Text conflict in statement_voucher_killer/voucher.py
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_voucher_killer_vre
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Approve
Alexandre Fayolle - camptocamp Abstain
Stefan Rijnhart (Opener) Approve
Leonardo Pistone Needs Fixing
Review via email: mp+213975@code.launchpad.net

This proposal supersedes a proposal from 2014-04-03.

Description of the change

It take the date of the payment line to set the bank statement line instead of maturity date of the payment line
See bug report

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

To the naked eye, there seems to be a long line. Can you give the comment its own line?

otherwise, il lgtm

thanks!

review: Needs Fixing
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! Looks good, even if I had to verify for myself that line.date actually contains the payment order scheduled date even if this is changed after creating the payment lines (due to logic in the official payment module).

review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

such fixes deserve an automated test

review: Abstain
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote : Posted in a previous version of this proposal

Hi, Vincent, please make the MP against the correct branch bank-statement-reconcile-70. You can do it from "Resubmit proposal" link on the right part.

Regards.

review: Needs Fixing
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

Regards.

review: Approve (code review)
142. By Vincent Renaville@camptocamp

[FIX] pep8

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

142. By Vincent Renaville@camptocamp

[FIX] pep8

141. By Vincent Renaville@camptocamp

[FIx] set correct date when import payment line into payment order: see bug #1301781

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'statement_voucher_killer/voucher.py'
2--- statement_voucher_killer/voucher.py 2014-03-04 16:27:19 +0000
3+++ statement_voucher_killer/voucher.py 2014-05-13 15:20:41 +0000
4@@ -45,7 +45,9 @@
5 statement_line_obj = self.pool.get('account.bank.statement.line')
6 currency_obj = self.pool.get('res.currency')
7 line_date = time.strftime('%Y-%m-%d')
8- statement = statement_obj.browse(cr, uid, statement_id, context=context)
9+ statement = statement_obj.browse(cr, uid,
10+ statement_id,
11+ context=context)
12 # for each selected move lines
13 for line in line_obj.browse(cr, uid, line_ids, context=context):
14 ctx = context.copy()
15@@ -59,11 +61,16 @@
16 amount = -line.credit
17
18 if line.amount_currency:
19- amount = currency_obj.compute(cr, uid, line.currency_id.id,
20- statement.currency.id, line.amount_currency, context=ctx)
21+ amount = currency_obj.compute(cr, uid,
22+ line.currency_id.id,
23+ statement.currency.id,
24+ line.amount_currency,
25+ context=ctx)
26 elif (line.invoice and line.invoice.currency_id.id != statement.currency.id):
27- amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,
28- statement.currency.id, amount, context=ctx)
29+ amount = currency_obj.compute(cr, uid,
30+ line.invoice.currency_id.id,
31+ statement.currency.id,
32+ amount, context=ctx)
33
34 context.update({'move_line_ids': [line.id],
35 'invoice_id': line.invoice.id})
36@@ -87,8 +94,14 @@
37 'statement_id': statement_id,
38 'ref': move_line.ref,
39 'voucher_id': False,
40+<<<<<<< TREE
41 'date': time.strftime('%Y-%m-%d'),
42 }
43+=======
44+ 'date': line_date,
45+ }, context=context)
46+ return {'type': 'ir.actions.act_window_close'}
47+>>>>>>> MERGE-SOURCE
48
49
50 class AccountPaymentPopulateStatement(orm.TransientModel):
51@@ -109,13 +122,21 @@
52 if not line_ids:
53 return {'type': 'ir.actions.act_window_close'}
54
55- statement = statement_obj.browse(cr, uid, context['active_id'], context=context)
56+ statement = statement_obj.browse(cr,
57+ uid,
58+ context['active_id'],
59+ context=context)
60
61 for line in line_obj.browse(cr, uid, line_ids, context=context):
62 ctx = context.copy()
63- ctx['date'] = line.ml_maturity_date # Last value_date earlier,but this field exists no more now
64- amount = currency_obj.compute(cr, uid, line.currency.id,
65- statement.currency.id, line.amount_currency, context=ctx)
66+ # if the date is not set on the statement line
67+ # we used the one set on statement
68+ ctx['date'] = line.date or statement.date
69+ amount = currency_obj.compute(cr, uid,
70+ line.currency.id,
71+ statement.currency.id,
72+ line.amount_currency,
73+ context=ctx)
74 if not line.move_line_id.id:
75 continue
76 context.update({'move_line_ids': [line.move_line_id.id]})
77@@ -135,7 +156,18 @@
78 'partner_id': payment_line.partner_id.id,
79 'account_id': payment_line.move_line_id.account_id.id,
80 'statement_id': statement.id,
81+<<<<<<< TREE
82 'ref': payment_line.communication,
83 'date': (payment_line.date or payment_line.ml_maturity_date or
84 statement.date)
85 }
86+=======
87+ 'ref': line.communication,
88+ 'date': ctx['date'],
89+ }, context=context)
90+
91+ line_obj.write(cr, uid,
92+ [line.id],
93+ {'bank_statement_line_id': st_line_id})
94+ return {'type': 'ir.actions.act_window_close'}
95+>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches