diff --git a/account_invoice_inter_company/models/account_move.py b/account_invoice_inter_company/models/account_move.py index 6c468822d99..1f41c12142d 100644 --- a/account_invoice_inter_company/models/account_move.py +++ b/account_invoice_inter_company/models/account_move.py @@ -57,7 +57,13 @@ def _find_company_from_invoice_partner(self): company = ( self.env["res.company"] .sudo() - .search([("partner_id", "=", self.commercial_partner_id.id)], limit=1) + .search( + [ + ("partner_id", "=", self.commercial_partner_id.id), + ("id", "!=", self.company_id.id), + ], + limit=1, + ) ) return company or False