Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions account_multi_store/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# directory
##############################################################################
from odoo import api, fields, models
from odoo.tools import config


class AccountJournal(models.Model):
Expand All @@ -27,8 +28,10 @@ def _search(self, domain, offset=0, limit=None, order=None):
user = self.env.user
# if superadmin, do not apply
if not self.env.is_superuser():
domain += ["|", ("store_id", "=", False), ("store_id", "child_of", user.store_ids.ids)]
return super(AccountJournal, self.with_context(active_test=False))._search(domain, offset, limit, order)
domain = domain + ["|", ("store_id", "=", False), ("store_id", "child_of", user.store_ids.ids)]
if not config["test_enable"]:
self = self.with_context(active_test=False)
return super(AccountJournal, self)._search(domain, offset, limit, order)

@api.model
@api.readonly
Expand Down
Loading