mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[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/
23 lines
730 B
Python
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
|
|
)
|