diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index a789ad287f3..aba732797ef 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -702,6 +702,7 @@ class sale_order(osv.osv):
#'state': 'waiting',
'note': line.notes,
'company_id': order.company_id.id,
+ 'returned_price': line.price_unit,
})
if line.product_id:
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 0c0e21fa2b9..66f295c54e0 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1212,6 +1212,8 @@ class stock_picking(osv.osv):
{'price_unit': product_price,
'price_currency_id': product_currency})
+ if not move.returned_price:
+ move_obj.write(cr, uid, [move.id], {'returned_price': move.price_unit})
for move in too_few:
product_qty = move_product_qty[move.id]
@@ -1532,6 +1534,7 @@ class stock_move(osv.osv):
# used for colors in tree views:
'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True),
+ 'returned_price': fields.float('Returned product price', digits=(16,2)),
}
_constraints = [
(_check_tracking,
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 0c99a6cf272..54aacc4ac94 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -672,6 +672,7 @@
+
+