Files
stock-logistics-warehouse/stock_inventory_cost_info/models/stock_inventory.py
Sergio Teruel ae3bf14623 [MIG] stock_inventory_cost_info: Migration to v13.0
[UPD] Update stock_inventory_cost_info.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_inventory_cost_info
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_inventory_cost_info/
2021-11-11 09:25:59 +01:00

23 lines
730 B
Python

# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class InventoryLine(models.Model):
_inherit = "stock.inventory.line"
currency_id = fields.Many2one(
string="Currency", related="inventory_id.company_id.currency_id", readonly=True
)
adjustment_cost = fields.Monetary(
string="Adjustment cost", compute="_compute_adjustment_cost", store=True
)
@api.depends("difference_qty", "inventory_id.state")
def _compute_adjustment_cost(self):
for record in self:
record.adjustment_cost = (
record.difference_qty * record.product_id.standard_price
)