Skip to content

Commit

Permalink
[FIX] account_operating_unit: Fixed issue in setting default operatin…
Browse files Browse the repository at this point in the history
…g unit in muti-company scenario
  • Loading branch information
aswani-beo authored and gucelik committed Jan 12, 2024
1 parent ccdcdc3 commit ec1246a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion account_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Accounting with Operating Units",
"summary": "Introduces Operating Unit (OU) in invoices and "
"Accounting Entries with clearing account",
"version": "13.0.1.3.0",
"version": "13.0.1.3.1",
"author": "ForgeFlow, "
"Serpent Consulting Services Pvt. Ltd.,"
"WilldooIT Pty Ltd,"
Expand Down
12 changes: 9 additions & 3 deletions account_operating_unit/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ def _onchange_operating_unit(self):
not self.journal_id
or self.journal_id.operating_unit_id != self.operating_unit_id
):
journal = self.env["account.journal"].search(
[("type", "=", self.journal_id.type)]
)
domain = []
if self.company_id:
domain = [
"|",
("company_id", "=", False),
("company_id", "=", self.company_id.id),
]
domain.append(("type", "=", self.journal_id.type))
journal = self.env["account.journal"].search(domain)
jf = journal.filtered(
lambda aj: aj.operating_unit_id == self.operating_unit_id
)
Expand Down

0 comments on commit ec1246a

Please sign in to comment.