Added cost price to lots by locations.
This commit is contained in:
parent
bfdfb5b9f6
commit
984e71359a
|
@ -7,4 +7,5 @@ from . import stock
|
|||
def register():
|
||||
Pool.register(
|
||||
stock.Lot,
|
||||
stock.LotsByLocations,
|
||||
module='stock_lot_cost_price', type_='model')
|
||||
|
|
7
stock.py
7
stock.py
|
@ -26,3 +26,10 @@ class Lot(metaclass=PoolMeta):
|
|||
], order=[('effective_date', 'DESC')])
|
||||
if moves:
|
||||
return moves[0].origin.unit_price
|
||||
|
||||
|
||||
class LotsByLocations(metaclass=PoolMeta):
|
||||
__name__ = 'stock.lots_by_locations'
|
||||
|
||||
cost_price = fields.Function(fields.Numeric(
|
||||
'Cost price', digits=price_digits), 'get_lot')
|
||||
|
|
Loading…
Reference in New Issue