-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c622e81
commit 09d0072
Showing
5 changed files
with
50 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import test_tax_filtered | ||
# from . import test_decorator | ||
from . import test_mixin_change_filtered | ||
from . import test_mixin_change_search_domain |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
fiscal_company_account/tests/test_mixin_change_search_domain.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) | ||
# @author Julien WESTE | ||
# @author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
from odoo.addons.fiscal_company_base.tests.test_abstract import TestAbstract | ||
|
||
|
||
class TestMixinChangeSearchDomain(TestAbstract): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.user_accountant.company_id = cls.child_company.id | ||
cls.AccountAccount = cls.env["account.account"].with_user(cls.user_accountant) | ||
cls.AccountJournal = cls.env["account.journal"].with_user(cls.user_accountant) | ||
|
||
# Test Section | ||
def test_01_mixin_change_search_domain_account_account(self): | ||
"""Searching an account in a child company should return | ||
accounts of the mother company""" | ||
res = self.AccountAccount.search([("company_id", "=", self.mother_company.id)]) | ||
self.assertNotEqual( | ||
len(res), | ||
0, | ||
"Searching accounts in a fiscal child company should return" | ||
" accounts of the mother company", | ||
) | ||
|
||
def test_02_mixin_change_search_domain_account_journal(self): | ||
"""Searching a journal in a child company should return | ||
journals of the mother company""" | ||
self.user_accountant.company_id = self.child_company.id | ||
res = self.AccountJournal.search([("company_id", "=", self.mother_company.id)]) | ||
self.assertNotEqual( | ||
len(res), | ||
0, | ||
"Searching accounts in a fiscal child company should return" | ||
" accounts of the mother company", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters