Merge lp:~camptocamp/account-invoicing/7.0-write-off-refund-date-mdh into lp:~account-core-editors/account-invoicing/7.0

Proposed by Matthieu Dietrich @ camptocamp
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 26
Merged at revision: 33
Proposed branch: lp:~camptocamp/account-invoicing/7.0-write-off-refund-date-mdh
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 14 lines (+2/-2)
1 file modified
invoice_validation_wkfl/invoice.py (+2/-2)
To merge this branch: bzr merge lp:~camptocamp/account-invoicing/7.0-write-off-refund-date-mdh
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+202888@code.launchpad.net

Commit message

[FIX] use refund's date in write-off

Description of the change

Found in a client: if you use the refund wizard on an invoice with the 2nd or 3rd option, and there is a write-off due to the reconciliation of the invoice and the refund, the date is set to today instead of taking the refund's.
This can lead to some issues, since the period is however the one from the refund.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'invoice_validation_wkfl/invoice.py'
2--- invoice_validation_wkfl/invoice.py 2013-05-13 08:30:34 +0000
3+++ invoice_validation_wkfl/invoice.py 2014-01-23 16:20:36 +0000
4@@ -161,8 +161,8 @@
5 account_m_line_obj.reconcile(cr, uid, to_reconcile_ids[account],
6 writeoff_period_id=period,
7 writeoff_journal_id = inv.journal_id.id,
8- writeoff_acc_id=inv.account_id.id
9- )
10+ writeoff_acc_id=inv.account_id.id,
11+ context={'date_p': date})
12 if mode == 'modify':
13 invoice = inv_obj.read(cr, uid, [inv.id],
14 ['name', 'type', 'number', 'reference',

Subscribers

People subscribed via source and target branches