unit factor is applied twice in account valuation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Medium
|
OpenERP R&D Addons Team 2 |
Bug Description
lets say you have a product:
- a product with base UoM 'Units'
- default purchase unit: dozen
- no UoS defined
- cost method: 'average'
- standard cost: 300
- real time valuation
now, do a purchase of one dozen. the price unit field shows $3,600, quantity: 1
checking the 'stock.move' record:
- product_qty: 1.00
- product_uom: dozen
- product_uos_qty: 1.00
- product_uos: dozen
- price_unit: 3600.00 (price of one dozen)
when the movement is processed, the account journal entry amount is $43,200 !!!
looking in the 'stock.move' _get_reference_
default_uom = move.product_
qty = product_
# if product is set to average price and a specific value was entered in the picking wizard,
# we use it
if move.product_
so, it calculates the quantity by calling _compute_qty(), which transforms the "one dozen" specification into "12 units"; so far so good. but then it multiplies that quantity (12) by the price_unit field which holds 3600.00 (price of one dozen). finally it returns an amount of 43200.00
i think there are two possible fixes:
option A: _get_reference_
or
option B: the purchase code should store the base unit price in the stock.move price_unit field.
Option A sounds better, but want to check other people's opinion.
Related branches
- Harry (OpenERP) (community): Needs Fixing
-
Diff: 17 lines (+1/-2)1 file modifiedstock/stock.py (+1/-2)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
I'm attaching the core of my current fix. in a new module I inherit from stock.move and just override _get_reference_ accounting_ values_ for_valuation( ) to recalculate the amount in that specific case.