mirror of
https://gitlab.com/datalifeit/trytond-stock_lot_cost_price
synced 2023-12-14 05:33:05 +01:00
Added cost price to lots by locations.
This commit is contained in:
parent
bfdfb5b9f6
commit
984e71359a
2 changed files with 8 additions and 0 deletions
|
@ -7,4 +7,5 @@ from . import stock
|
||||||
def register():
|
def register():
|
||||||
Pool.register(
|
Pool.register(
|
||||||
stock.Lot,
|
stock.Lot,
|
||||||
|
stock.LotsByLocations,
|
||||||
module='stock_lot_cost_price', type_='model')
|
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')])
|
], order=[('effective_date', 'DESC')])
|
||||||
if moves:
|
if moves:
|
||||||
return moves[0].origin.unit_price
|
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 a new issue