Skip to content

Commit

Permalink
T1863 FIX missing company_id for foreign sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Sep 30, 2024
1 parent 78b3869 commit cb2afb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions recurring_contract/models/recurring_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,10 @@ def on_change_partner_id(self):
company_ids = self.env["res.company"].search(
[("partner_id.country_id", "=", self.partner_id.country_id.id)], limit=1
)
self.company_id = company_ids.filtered(
lambda company: company.country_id == self.partner_id.country_id
)
if company_ids:
self.company_id = company_ids.filtered(
lambda company: company.country_id == self.partner_id.country_id
)

@api.onchange("company_id")
def on_change_company_id(self):
Expand Down

0 comments on commit cb2afb6

Please sign in to comment.