Cost price - decimal accuracy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Wishlist
|
OpenERP R&D Addons Team 2 |
Bug Description
This bug might be related to https:/
product_
I don't want my purchase orders calculated or printed with 6 digits, and I don't want any outgoing invoice calculated or printed with 6 digits.
But for average price calculation I NEED more than 2 digits!
example:
Create new product, costing method = average price (set to 0,00)
Create PO_1: 10 pce, price 1,- Euro, reception
-> move anlaysis (total): qty 10, value 10,- Euro
-> product.form average price = 1,-
Create PO_2: 10 pce, price 1,50 Euro, reception
-> move analysis (total): qty 20, value 25,- Euro
-> product.form average price = 1,25
Create delivery order: 10 pce, process and validate
-> move analysis (total): qty 10, value 12,50 Euro
-> product.form average price = 1,25
Create PO_3 10 pce, price 1,- Euro, reception
-> move analysis (total): qty 20, value 22,40 Euro
Product.form average price = 1,12
This is how OpenERP book explains the average price calculation formula:
NP = (OP * QS + PP * QR) / (QS + QR),
where the following notation is used:
• NP: New Price,
• OP: Old Price,
• QS: Quantity actually in Stock,
• PP: Price Paid for the quantity received,
• QR: Quantity Received.
In my example (last recalculation of average price through reception PO_3) it would mean:
OP = 1,25
QS = 10
PP = 1,00
QR = 10
NP = (1,25 * 10 + 1,00 * 10) / (10 + 10) = 1,125
first issue:
The stock value after the last reception (PO3) is 22,50 Euro (1,25 * 10 + 1,00 * 10), move analysis says: 22,40 Euro
second issue:
Rounding cost price: 1,125 should have get rounded up to 1,13 instead of down to 1,12
So, I don't need 6 digits when I purchase for 1,50 Euro; I don't need 6 digits when I sale for 2,75 Euro.
But I need a solution for
A) wrong stock value
B) wrong average price
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
importance: | Undecided → Low |
status: | New → Confirmed |
Note: to be discussed with QDP before fixing anything