Added cost price to lots by locations.

This commit is contained in:
José Miguel Pardo Salar 2022-07-04 13:07:41 +02:00
parent bfdfb5b9f6
commit 984e71359a
2 changed files with 8 additions and 0 deletions

View File

@ -7,4 +7,5 @@ from . import stock
def register():
Pool.register(
stock.Lot,
stock.LotsByLocations,
module='stock_lot_cost_price', type_='model')

View File

@ -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')