Skip to content

Commit

Permalink
Merge pull request #345 from Vauxoo/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream Vauxoo/addons-vauxoo (17.0)
  • Loading branch information
bt-admin authored Jan 9, 2025
2 parents 7ba640a + 1b236e8 commit 1da5c5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions default_warehouse_from_sale_team/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def _search_default_journal(self):
journal = super()._search_default_journal()
team = (
self.env.context.get("salesteam")
# If the team_id value (ID) is in the cache, it must be converted to a record from the
# cached value to avoid triggering the field's compute method when it has not yet been computed.
or self._fields["team_id"].convert_to_record(self._cache.get("team_id"), self)
# If the team_id value (ID) is in the cache on a existing account.move record, it must be
# converted to a record from the cached value to avoid triggering the field's compute
# method when it has not yet been computed.
or (self and self._fields["team_id"].convert_to_record(self._cache.get("team_id"), self))
or self.env.user.sale_team_id
)
journal_on_team = team._get_default_journal([journal.type or "general"])
Expand Down

0 comments on commit 1da5c5a

Please sign in to comment.