Skip to content

Commit

Permalink
[FIX] account_invoice_inter_company: Remove self company
Browse files Browse the repository at this point in the history
from eligible companies in `_find_company_from_invoice_partner`
  • Loading branch information
renda-dev committed Nov 17, 2023
1 parent 146d001 commit 1ac5f5c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion account_invoice_inter_company/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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

Expand Down

0 comments on commit 1ac5f5c

Please sign in to comment.