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
=== modified file 'statement_voucher_killer/voucher.py'
--- statement_voucher_killer/voucher.py 2014-03-04 16:27:19 +0000
+++ statement_voucher_killer/voucher.py 2014-05-13 15:20:41 +0000
@@ -45,7 +45,9 @@
45 statement_line_obj = self.pool.get('account.bank.statement.line')45 statement_line_obj = self.pool.get('account.bank.statement.line')
46 currency_obj = self.pool.get('res.currency')46 currency_obj = self.pool.get('res.currency')
47 line_date = time.strftime('%Y-%m-%d')47 line_date = time.strftime('%Y-%m-%d')
48 statement = statement_obj.browse(cr, uid, statement_id, context=context)48 statement = statement_obj.browse(cr, uid,
49 statement_id,
50 context=context)
49 # for each selected move lines51 # for each selected move lines
50 for line in line_obj.browse(cr, uid, line_ids, context=context):52 for line in line_obj.browse(cr, uid, line_ids, context=context):
51 ctx = context.copy()53 ctx = context.copy()
@@ -59,11 +61,16 @@
59 amount = -line.credit61 amount = -line.credit
6062
61 if line.amount_currency:63 if line.amount_currency:
62 amount = currency_obj.compute(cr, uid, line.currency_id.id,64 amount = currency_obj.compute(cr, uid,
63 statement.currency.id, line.amount_currency, context=ctx)65 line.currency_id.id,
66 statement.currency.id,
67 line.amount_currency,
68 context=ctx)
64 elif (line.invoice and line.invoice.currency_id.id != statement.currency.id):69 elif (line.invoice and line.invoice.currency_id.id != statement.currency.id):
65 amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,70 amount = currency_obj.compute(cr, uid,
66 statement.currency.id, amount, context=ctx)71 line.invoice.currency_id.id,
72 statement.currency.id,
73 amount, context=ctx)
6774
68 context.update({'move_line_ids': [line.id],75 context.update({'move_line_ids': [line.id],
69 'invoice_id': line.invoice.id})76 'invoice_id': line.invoice.id})
@@ -87,8 +94,14 @@
87 'statement_id': statement_id,94 'statement_id': statement_id,
88 'ref': move_line.ref,95 'ref': move_line.ref,
89 'voucher_id': False,96 'voucher_id': False,
97<<<<<<< TREE
90 'date': time.strftime('%Y-%m-%d'),98 'date': time.strftime('%Y-%m-%d'),
91 }99 }
100=======
101 'date': line_date,
102 }, context=context)
103 return {'type': 'ir.actions.act_window_close'}
104>>>>>>> MERGE-SOURCE
92105
93106
94class AccountPaymentPopulateStatement(orm.TransientModel):107class AccountPaymentPopulateStatement(orm.TransientModel):
@@ -109,13 +122,21 @@
109 if not line_ids:122 if not line_ids:
110 return {'type': 'ir.actions.act_window_close'}123 return {'type': 'ir.actions.act_window_close'}
111124
112 statement = statement_obj.browse(cr, uid, context['active_id'], context=context)125 statement = statement_obj.browse(cr,
126 uid,
127 context['active_id'],
128 context=context)
113129
114 for line in line_obj.browse(cr, uid, line_ids, context=context):130 for line in line_obj.browse(cr, uid, line_ids, context=context):
115 ctx = context.copy()131 ctx = context.copy()
116 ctx['date'] = line.ml_maturity_date # Last value_date earlier,but this field exists no more now132 # if the date is not set on the statement line
117 amount = currency_obj.compute(cr, uid, line.currency.id,133 # we used the one set on statement
118 statement.currency.id, line.amount_currency, context=ctx)134 ctx['date'] = line.date or statement.date
135 amount = currency_obj.compute(cr, uid,
136 line.currency.id,
137 statement.currency.id,
138 line.amount_currency,
139 context=ctx)
119 if not line.move_line_id.id:140 if not line.move_line_id.id:
120 continue141 continue
121 context.update({'move_line_ids': [line.move_line_id.id]})142 context.update({'move_line_ids': [line.move_line_id.id]})
@@ -135,7 +156,18 @@
135 'partner_id': payment_line.partner_id.id,156 'partner_id': payment_line.partner_id.id,
136 'account_id': payment_line.move_line_id.account_id.id,157 'account_id': payment_line.move_line_id.account_id.id,
137 'statement_id': statement.id,158 'statement_id': statement.id,
159<<<<<<< TREE
138 'ref': payment_line.communication,160 'ref': payment_line.communication,
139 'date': (payment_line.date or payment_line.ml_maturity_date or161 'date': (payment_line.date or payment_line.ml_maturity_date or
140 statement.date)162 statement.date)
141 }163 }
164=======
165 'ref': line.communication,
166 'date': ctx['date'],
167 }, context=context)
168
169 line_obj.write(cr, uid,
170 [line.id],
171 {'bank_statement_line_id': st_line_id})
172 return {'type': 'ir.actions.act_window_close'}
173>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches