[stock] store price_unit for all stock moves, and use it for suggesting return picking values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Wishlist
|
OpenERP R&D Addons Team 2 |
Bug Description
In OpenERP 6.0 stock.move has a price_unit field for storing the unit cost price of the products, but this field only has a value for incoming pickings on products with average price (because it is used by the picking wizard in that case).
We should change the stock module to make sure the unit price is always written in that field, also in the other cases (we must also preserve the current behavior for
incoming pickings, which means we should store the value that was set by the user in the picking wizard, not always the current average price.).
Finally, we should use this price_unit column to suggest a cost price when doing a return picking. We should suggest the price_unit value of the stock moves we are
returning, instead of suggesting the current product price, as previously discussed in bug 613286. The tooltip should also be updated, etc.
======= (original description below) =======
to be able to calculate the stock value for every point in time for avg price and real time
obviously for accounting purpose real time we must have
account_balance == stock values
and must be able to proove it
if (pick.type != 'in') and (move.product_
if all stock moves have the price_unit field set:
qty * price_unit= move_value
and sum(+/- move_value)
enables to calculated the total stock value per product in every point of time matching the account balance
a little step further will be to calculated the average price per stock_location and lot
Related branches
- Rucha (Open ERP) (community): Approve
-
Diff: 282 lines (+63/-25)6 files modifiedsale/sale.py (+1/-0)
stock/report/report_stock_move.py (+23/-13)
stock/stock.py (+29/-5)
stock/wizard/stock_partial_picking.py (+1/-1)
stock/wizard/stock_return_picking.py (+7/-5)
stock/wizard/stock_return_picking_view.xml (+2/-1)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Nevertheless for accounting purpose it would be much better to store in stock moves the value (qty*price) used for account moves instead as it is always possible to re-calculate the price = value/qty , but not always value= qty*price, because of the rounding and precision issue needed for the price field.