rounding (float representation) error in residual amount

Bug #424214 reported by szczytt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
gpa(OpenERP)

Bug Description

Server version 5.0.3

1. Enter invoice with total amount of 123,36. Accept.
2. Make partial payment of 52,57
3. Make remaining payment of 70,79.

Invoice does not change state to Done (Paid).

Residual shows -0,00 (on database it is -1.42108547152e-014).

Looks like float representation error. Round is missing somewhere.

Related branches

Changed in openobject-addons:
status: New → Confirmed
assignee: nobody → gpa(tiny) (gpa-openerp)
Revision history for this message
szczytt (szczytt) wrote :

Workaround/patch:

invoice.py

line 111 (_amount_residual):

from: res[inv.id] = to_pay - abs(paid_amt)
to: res[inv.id] = round(to_pay - abs(paid_amt),10)

line 895 (pay_and_reconcile):

from: if (not total) or writeoff_acc_id:
to: if (not round(total,10)) or writeoff_acc_id:

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Fixed by revision 2379 <email address hidden>.

Thanks.

Changed in openobject-addons:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.