Merge lp:~openerp-dev/openobject-addons/5.0-opw-4435-ach into lp:openobject-addons/5.0

Proposed by Anup(SerpentCS)
Status: Rejected
Rejected by: Raphael Collet (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/5.0-opw-4435-ach
Merge into: lp:openobject-addons/5.0
Diff against target: 40 lines (+9/-3)
2 files modified
account/account_move_line.py (+7/-1)
account/invoice.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/5.0-opw-4435-ach
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Disapprove
Stephane Wirtel (OpenERP) Pending
Jay Vora (Serpent Consulting Services) Pending
Review via email: mp+62480@code.launchpad.net

Description of the change

Hello,

The merge fixes the following issues.

 - When you pay the invoice partially using the payment term the residual amount was not being deducted.
 - When you pay invoice in different currency it caused an error.
 - Writeoff was being an issue due to the rounding of amount in different currencies.

All the issues has been fixed by this.

Thanks.

To post a comment you must log in.
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

The case 4435 has been fixed by Quentin (rev 2918) in another way.
Therefore I will reject this branch.

review: Disapprove

Unmerged revisions

2910. By Anup(SerpentCS)

[FIX] account : Invoice Paid in different currencies causing issues, Fixed(Case:4435)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2010-12-16 16:06:42 +0000
3+++ account/account_move_line.py 2011-05-26 13:01:38 +0000
4@@ -563,7 +563,13 @@
5 account_id = line['account_id']['id']
6 account_type = line['account_id']['type']
7 partner_id = (line['partner_id'] and line['partner_id']['id']) or False
8- writeoff = debit - credit
9+
10+ if (line.invoice.currency_id != line.invoice.company_id.currency_id) or (line.currency_id != line.invoice.company_id.currency_id):
11+ # Rounding issues with different currencies
12+ writeoff = round(debit - credit,tools.config['price_accuracy']-1)
13+ else:
14+ writeoff = debit - credit
15+
16 # Ifdate_p in context => take this date
17 if context.has_key('date_p') and context['date_p']:
18 date=context['date_p']
19
20=== modified file 'account/invoice.py'
21--- account/invoice.py 2011-02-28 10:53:53 +0000
22+++ account/invoice.py 2011-05-26 13:01:38 +0000
23@@ -114,7 +114,7 @@
24 inv_total = inv.amount_total
25 context_unreconciled = context.copy()
26 for lines in inv.move_lines:
27- if lines.currency_id and lines.currency_id.id == inv.currency_id.id:
28+ if lines.currency_id and lines.currency_id.id == inv.currency_id.id and lines.amount_currency:
29 if inv.type in ('out_invoice','in_refund'):
30 inv_total += lines.amount_currency
31 else:
32@@ -144,8 +144,8 @@
33 ids_line = line.reconcile_id.line_id
34 elif line.reconcile_partial_id:
35 ids_line = line.reconcile_partial_id.line_partial_ids
36+ partial_ids.append(line.id)
37 l = map(lambda x: x.id, ids_line)
38- partial_ids.append(line.id)
39 res[id] =[x for x in l if x <> line.id and x not in partial_ids]
40 return res
41