Files
stock-rma/rma_account/models/stock_valuation_layer.py
Jordi Ballester Alomar 623b22c091 [FIX] include anglo-saxon price unit calculation in refunds.
Otherwise the anglo saxon entries won't be correct.
For example, the Interim (Delivered) account should balance
after receiving and triggering a refund on a customer rma.
2022-11-24 18:57:04 +01:00

17 lines
619 B
Python

# Copyright 2017-22 ForgeFlow S.L. (www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models
class StockValuationLayer(models.Model):
_inherit = "stock.valuation.layer"
def _validate_accounting_entries(self):
res = super(StockValuationLayer, self)._validate_accounting_entries()
for svl in self:
# Eventually reconcile together the stock interim accounts
if svl.company_id.anglo_saxon_accounting:
svl.stock_move_id.rma_line_id._stock_account_anglo_saxon_reconcile_valuation()
return res