From 501ae75e4d30df34e2faf6050e3ef906bccb9329 Mon Sep 17 00:00:00 2001 From: almumu Date: Fri, 31 Oct 2025 12:00:38 +0100 Subject: [PATCH] [16.0][FIX] purchase_deposit: fixes account.tax access error in a multi company environment Solves access error when creating a Deposit invoice, because it was getting all the product taxes of the existing companies. --- purchase_deposit/wizard/purchase_make_invoice_advance.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py index 9607c0708b8..84e96c6ad6c 100644 --- a/purchase_deposit/wizard/purchase_make_invoice_advance.py +++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py @@ -56,7 +56,9 @@ class PurchaseAdvancePaymentInv(models.TransientModel): def _compute_deposit_account_id(self): product = self.purchase_deposit_product_id self.deposit_account_id = product.property_account_expense_id - self.deposit_taxes_id = product.supplier_taxes_id + self.deposit_taxes_id = product.supplier_taxes_id.filtered( + lambda tx: tx.company_id == self.env.company + ) def _prepare_deposit_val(self, order, po_line, amount): ir_property_obj = self.env["ir.property"]