Merge lp:~therp-nl/banking-addons/ab61-lp1090733-vouchers_wrong_date into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 144
Proposed branch: lp:~therp-nl/banking-addons/ab61-lp1090733-vouchers_wrong_date
Merge into: lp:banking-addons/6.1
Diff against target: 33 lines (+7/-3)
1 file modified
account_banking/account_banking.py (+7/-3)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ab61-lp1090733-vouchers_wrong_date
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+140070@code.launchpad.net

Description of the change

This is a backport of https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574251-rha/+merge/104383 to the modified version of this method that exists in account_banking

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Looks fine to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_banking/account_banking.py'
--- account_banking/account_banking.py 2012-05-02 15:09:49 +0000
+++ account_banking/account_banking.py 2012-12-15 15:23:19 +0000
@@ -410,13 +410,19 @@
410 'account.bank.statement.line')410 'account.bank.statement.line')
411 st_line = account_bank_statement_line_obj.browse(411 st_line = account_bank_statement_line_obj.browse(
412 cr, uid, st_line_id, context=context)412 cr, uid, st_line_id, context=context)
413 period_id = self._get_period(
414 cr, uid, st_line.date, context=context) # AB
413 # Start account voucher415 # Start account voucher
414 # Post the voucher and update links between statement and moves416 # Post the voucher and update links between statement and moves
415 if st_line.voucher_id:417 if st_line.voucher_id:
416 voucher_pool = self.pool.get('account.voucher')418 voucher_pool = self.pool.get('account.voucher')
417 wf_service = netsvc.LocalService("workflow")419 wf_service = netsvc.LocalService("workflow")
418 voucher_pool.write(420 voucher_pool.write(
419 cr, uid, [st_line.voucher_id.id], {'number': st_line_number}, context=context)421 cr, uid, [st_line.voucher_id.id], {
422 'number': st_line_number,
423 'date': st_line.date,
424 'period_id': period_id, # AB
425 }, context=context)
420 if st_line.voucher_id.state == 'cancel':426 if st_line.voucher_id.state == 'cancel':
421 voucher_pool.action_cancel_draft(427 voucher_pool.action_cancel_draft(
422 cr, uid, [st_line.voucher_id.id], context=context)428 cr, uid, [st_line.voucher_id.id], context=context)
@@ -443,8 +449,6 @@
443 context.update({'date': st_line.date})449 context.update({'date': st_line.date})
444 ctxt = context.copy() # AB450 ctxt = context.copy() # AB
445 ctxt['company_id'] = st_line.company_id.id # AB451 ctxt['company_id'] = st_line.company_id.id # AB
446 period_id = self._get_period(
447 cr, uid, st_line.date, context=ctxt) # AB
448452
449 move_id = account_move_obj.create(cr, uid, {453 move_id = account_move_obj.create(cr, uid, {
450 'journal_id': st.journal_id.id,454 'journal_id': st.journal_id.id,

Subscribers

People subscribed via source and target branches