Odoo18-Base/addons/purchase_stock/models/stock_valuation_layer.py
2025-01-06 10:57:38 +07:00

13 lines
449 B
Python

from odoo import models
class StockValuationLayer(models.Model):
_inherit = 'stock.valuation.layer'
def _get_layer_price_unit(self):
""" This function returns the value of product in a layer per unit, relative to the aml
the function is designed to be overriden to add logic to price unit calculation
:param layer: the layer the price unit is derived from
"""
return self.value / self.quantity