Skip to content

Commit

Permalink
Merge PR #1078 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 13, 2023
2 parents ececcc7 + ab5ea01 commit 428845f
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 16 deletions.
17 changes: 14 additions & 3 deletions account_financial_report/tests/test_aged_partner_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@


class TestAgedPartnerBalance(TransactionCase):
def setUp(self):
super().setUp()
self.wizard_model = self.env["aged.partner.balance.report.wizard"]
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
cls.wizard_model = cls.env["aged.partner.balance.report.wizard"]

def test_report(self):
"""Check that report is produced correctly."""
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/tests/test_general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class TestGeneralLedgerReport(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
cls.before_previous_fy_year = fields.Date.from_string("2014-05-05")
cls.previous_fy_date_start = fields.Date.from_string("2015-01-01")
cls.previous_fy_date_end = fields.Date.from_string("2015-12-31")
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/tests/test_journal_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ class TestJournalReport(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
cls.AccountObj = cls.env["account.account"]
cls.InvoiceObj = cls.env["account.move"]
cls.JournalObj = cls.env["account.journal"]
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/tests/test_open_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ class TestOpenItems(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)

def test_partner_filter(self):
partner_1 = self.env.ref("base.res_partner_1")
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/tests/test_trial_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
# Remove previous account groups and related invoices to avoid conflicts
group_obj = cls.env["account.group"]
cls.group1 = group_obj.create({"code_prefix_start": "1", "name": "Group 1"})
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/tests/test_vat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ def init_invoice(
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
cls.date_from = time.strftime("%Y-%m-01")
cls.date_to = time.strftime("%Y-%m-28")
cls.company = cls.env.user.company_id
Expand Down
37 changes: 24 additions & 13 deletions account_tax_balance/tests/test_account_tax_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,39 @@

@odoo.tests.tagged("post_install", "-at_install")
class TestAccountTaxBalance(HttpCase):
def setUp(self):
super().setUp()
self.env.user.groups_id = [(4, self.env.ref("account.group_account_user").id)]
self.company = self.env.user.company_id
self.range_type = self.env["date.range.type"].create(
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(
context=dict(
cls.env.context,
mail_create_nolog=True,
mail_create_nosubscribe=True,
mail_notrack=True,
no_reset_password=True,
tracking_disable=True,
)
)
cls.env.user.groups_id = [(4, cls.env.ref("account.group_account_user").id)]
cls.company = cls.env.user.company_id
cls.range_type = cls.env["date.range.type"].create(
{"name": "Fiscal year", "allow_overlap": False}
)
self.range_generator = self.env["date.range.generator"]
self.current_year = datetime.now().year
self.current_month = datetime.now().month
range_generator = self.range_generator.create(
cls.range_generator = cls.env["date.range.generator"]
cls.current_year = datetime.now().year
cls.current_month = datetime.now().month
range_generator = cls.range_generator.create(
{
"date_start": "%s-01-01" % self.current_year,
"name_prefix": "%s-" % self.current_year,
"type_id": self.range_type.id,
"date_start": "%s-01-01" % cls.current_year,
"name_prefix": "%s-" % cls.current_year,
"type_id": cls.range_type.id,
"duration_count": 1,
"unit_of_time": str(MONTHLY),
"count": 12,
}
)
range_generator.action_apply()
self.range = self.env["date.range"]
cls.range = cls.env["date.range"]

def test_tax_balance(self):
previous_taxes_ids = (
Expand Down

0 comments on commit 428845f

Please sign in to comment.