[FIX] stock_account: validating svl from different companies
Commit 7fa9ec2638 create accounting entries from stock_account in
batch. The test on `self.company_id.anglo_saxon_accounting` is
problematic in case of multi recordset. Instead, this commit evaluate
the company_id for each record of `self`.
closes odoo/odoo#64813
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
This commit is contained in:
@@ -47,8 +47,8 @@ class StockValuationLayer(models.Model):
|
||||
if am_vals:
|
||||
account_moves = self.env['account.move'].sudo().create(am_vals)
|
||||
account_moves._post()
|
||||
if self.company_id.anglo_saxon_accounting:
|
||||
for svl in self:
|
||||
# Eventually reconcile together the invoice and valuation accounting entries on the stock interim accounts
|
||||
for svl in self:
|
||||
if svl.company_id.anglo_saxon_accounting:
|
||||
svl.stock_move_id._get_related_invoices()._stock_account_anglo_saxon_reconcile_valuation(product=svl.product_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user