# -*- coding: utf-8 -*-
from odoo.tests import tagged
from odoo.addons.account.tests.common import AccountTestInvoicingHttpCommon


@tagged('post_install', '-at_install')
class TestTourAccountAnalyticFilters(AccountTestInvoicingHttpCommon):

    @classmethod
    def setUpClass(cls):
        super().setUpClass()

        cls.env.user.groups_id += cls.env.ref(
            'analytic.group_analytic_accounting')
        cls.report = cls.env.ref('odex30_account_reports.profit_and_loss')
        cls.report.write({'filter_analytic': True})
        cls.analytic_plan = cls.env['account.analytic.plan'].create({
            'name': 'Plan',
        })

        cls.env['account.analytic.account'].create({
            'name': 'Time Off',
            'plan_id': cls.analytic_plan.id
        })

    def test_tour_account_report_analytic_filters(self):
        self.start_tour("/odoo", 'account_reports_analytic_filters', login=self.env.user.login)
