# 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
            else:
                group_display = _group_display_2018()
                total_display = _total_display_2018()

            line.is_group = line.code in group_display
            line.is_total = line.code in total_display

    @api.multi
    @api.depends('code')
    def _compute_is_readonly(self):
        for line in self:
            if line.statement_id.version == '2019':
                editable_display = _editable_display_2019()
            else:
                editable_display = _editable_display_2018()

            if line.statement_id.state == 'draft':
                line.is_readonly = line.code not in editable_display
            else:
                line.is_readonly = True

    @api.multi
    def unlink(self):
        for line in self:
            if line.statement_id.state == 'posted':
                raise UserError(
                    _('You cannot delete lines of a posted statement! '
                      'Reset the statement to draft first.'))
            if line.statement_id.state == 'final':
                raise UserError(

# 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

            else:
                group_display = _group_display_2018()
                total_display = _total_display_2018()

            line.is_group = line.code in group_display
            line.is_total = line.code in total_display

    @api.multi
    @api.depends('code')
    def _compute_is_readonly(self):
        for line in self:
            if line.statement_id.version == '2019':
                editable_display = _editable_display_2019()
            else:
                editable_display = _editable_display_2018()

            if line.statement_id.state == 'draft':
                line.is_readonly = line.code not in editable_display
            else:
                line.is_readonly = True

    @api.multi
    def unlink(self):
        for line in self:
            if line.statement_id.state == 'posted':
                raise UserError(
                    _('You cannot delete lines of a posted statement! '
                      'Reset the statement to draft first.'))
            if line.statement_id.state == 'final':
                raise UserError(

                    _('You cannot delete lines of a statement set as final!'))