# Path: l10n_de_tax_statement/models/l10n_de_tax_statement_2018.py
# def _base_display_2018():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '51', '52',
#     )
# 
# def _tax_display_2018():
#     return (
#         '26', '27', '28', '30',
#         '33', '34', '35', '36',
#         '48', '49', '50', '51', '52', '53', '55',
#         '56', '57', '58', '59',
#         '60', '61', '62', '64', '65', '66', '67',
#     )
# 
# def _group_display_2018():
#     return (
#         '17', '18', '19',
#         '25', '31', '37',
#         '47', '54', '63',
#     )
# 
# def _total_display_2018():
#     return (
#         '53', '62',
#     )
# 
# def _editable_display_2018():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '51', '52',
#         '64', '65', '67',
#     )
# 
# Path: l10n_de_tax_statement/models/l10n_de_tax_statement_2019.py
# def _base_display_2019():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '48',
#         '49', '50',
#     )
# 
# def _tax_display_2019():
#     return (
#         '26', '27', '28', '30',
#         '33', '34', '35', '36',
#         '48', '49', '50', '51',
#         '53', '54', '55', '56',
#         '57', '58', '59', '60',
#         '62', '63', '64', '65',
#     )
# 
# def _group_display_2019():
#     return (
#         '17', '18', '19',
#         '25', '31', '37',
#         '47', '52', '61',
#     )
# 
# def _total_display_2019():
#     return (
#         '51', '60',
#     )
# 
# def _editable_display_2019():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '64', '65',
#     )


from odoo import _, api, fields, models
from odoo.osv import expression
from odoo.exceptions import UserError
from odoo.tools.misc import formatLang
from .l10n_de_tax_statement_2018 import \
    _base_display_2018, _tax_display_2018, \
    _group_display_2018, _total_display_2018, _editable_display_2018
from .l10n_de_tax_statement_2019 import \
    _base_display_2019, _tax_display_2019, \
    _group_display_2019, _total_display_2019, _editable_display_2019
                    _('You cannot delete lines of a statement set as final!'))
        super(VatStatementLine, self).unlink()

    @api.multi
    def view_tax_lines(self):
        self.ensure_one()
        return self.get_lines_action(tax_or_base='tax')

    @api.multi
    def view_base_lines(self):
        self.ensure_one()
        return self.get_lines_action(tax_or_base='base')

    def get_lines_action(self, tax_or_base='tax'):
        self.ensure_one()
        action = self.env.ref('account.action_account_moves_all_tree')
        vals = action.read()[0]
        vals['context'] = {}
        vals['domain'] = self._get_move_lines_domain(tax_or_base)
        return vals

    def _get_move_lines_domain(self, tax_or_base):
        statement = self.statement_id
        taxes = self._filter_taxes_by_code(statement._compute_taxes())
        past_taxes = statement._compute_past_invoices_taxes()
        past_taxes = self._filter_taxes_by_code(past_taxes)
        if statement.state == 'draft':
            domain = self._get_domain_draft(taxes, tax_or_base)
            past_domain = self._get_domain_draft(past_taxes, tax_or_base)
        else:

# Path: l10n_de_tax_statement/models/l10n_de_tax_statement_2018.py
# def _base_display_2018():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '51', '52',
#     )
# 
# def _tax_display_2018():
#     return (
#         '26', '27', '28', '30',
#         '33', '34', '35', '36',
#         '48', '49', '50', '51', '52', '53', '55',
#         '56', '57', '58', '59',
#         '60', '61', '62', '64', '65', '66', '67',
#     )
# 
# def _group_display_2018():
#     return (
#         '17', '18', '19',
#         '25', '31', '37',
#         '47', '54', '63',
#     )
# 
# def _total_display_2018():
#     return (
#         '53', '62',
#     )
# 
# def _editable_display_2018():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '51', '52',
#         '64', '65', '67',
#     )
# 
# Path: l10n_de_tax_statement/models/l10n_de_tax_statement_2019.py
# def _base_display_2019():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '48',
#         '49', '50',
#     )
# 
# def _tax_display_2019():
#     return (
#         '26', '27', '28', '30',
#         '33', '34', '35', '36',
#         '48', '49', '50', '51',
#         '53', '54', '55', '56',
#         '57', '58', '59', '60',
#         '62', '63', '64', '65',
#     )
# 
# def _group_display_2019():
#     return (
#         '17', '18', '19',
#         '25', '31', '37',
#         '47', '52', '61',
#     )
# 
# def _total_display_2019():
#     return (
#         '51', '60',
#     )
# 
# def _editable_display_2019():
#     return (
#         '20', '21', '22', '23', '24',
#         '26', '27', '28', '29', '30',
#         '32', '33', '34', '35', '36',
#         '38', '39', '40', '41', '42',
#         '48', '49', '50', '64', '65',
#     )


# Path: l10n_de_tax_statement/models/l10n_de_tax_statement_line.py
from odoo import _, api, fields, models
from odoo.osv import expression
from odoo.exceptions import UserError
from odoo.tools.misc import formatLang
from .l10n_de_tax_statement_2018 import \
    _base_display_2018, _tax_display_2018, \
    _group_display_2018, _total_display_2018, _editable_display_2018
from .l10n_de_tax_statement_2019 import \
    _base_display_2019, _tax_display_2019, \
    _group_display_2019, _total_display_2019, _editable_display_2019

                    _('You cannot delete lines of a statement set as final!'))
        super(VatStatementLine, self).unlink()

    @api.multi
    def view_tax_lines(self):
        self.ensure_one()
        return self.get_lines_action(tax_or_base='tax')

    @api.multi
    def view_base_lines(self):
        self.ensure_one()
        return self.get_lines_action(tax_or_base='base')

    def get_lines_action(self, tax_or_base='tax'):
        self.ensure_one()
        action = self.env.ref('account.action_account_moves_all_tree')
        vals = action.read()[0]
        vals['context'] = {}
        vals['domain'] = self._get_move_lines_domain(tax_or_base)
        return vals

    def _get_move_lines_domain(self, tax_or_base):
        statement = self.statement_id
        taxes = self._filter_taxes_by_code(statement._compute_taxes())
        past_taxes = statement._compute_past_invoices_taxes()
        past_taxes = self._filter_taxes_by_code(past_taxes)
        if statement.state == 'draft':
            domain = self._get_domain_draft(taxes, tax_or_base)
            past_domain = self._get_domain_draft(past_taxes, tax_or_base)
        else:

            domain = self._get_domain_posted(taxes, tax_or_base)