# 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
    is_readonly = fields.Boolean(compute='_compute_is_readonly')

    state = fields.Selection(related='statement_id.state')

    @api.multi
    @api.depends('base', 'tax', 'code')
    def _compute_amount_format(self):
        for line in self:
            if line.statement_id.version == '2019':
                base_display = _base_display_2019()
                tax_display = _tax_display_2019()
            else:
                base_display = _base_display_2018()
                tax_display = _tax_display_2018()

            base = formatLang(self.env, line.base, monetary=True)
            tax = formatLang(self.env, line.tax, monetary=True)
            if line.code in base_display:
                line.format_base = base
            if line.code in tax_display:
                line.format_tax = tax

    @api.multi
    @api.depends('code')
    def _compute_is_group(self):
        for line in self:
            if line.statement_id.version == '2019':
                group_display = _group_display_2019()
                total_display = _total_display_2019()
            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

    is_readonly = fields.Boolean(compute='_compute_is_readonly')

    state = fields.Selection(related='statement_id.state')

    @api.multi
    @api.depends('base', 'tax', 'code')
    def _compute_amount_format(self):
        for line in self:
            if line.statement_id.version == '2019':
                base_display = _base_display_2019()
                tax_display = _tax_display_2019()
            else:
                base_display = _base_display_2018()
                tax_display = _tax_display_2018()

            base = formatLang(self.env, line.base, monetary=True)
            tax = formatLang(self.env, line.tax, monetary=True)
            if line.code in base_display:
                line.format_base = base
            if line.code in tax_display:
                line.format_tax = tax

    @api.multi
    @api.depends('code')
    def _compute_is_group(self):
        for line in self:
            if line.statement_id.version == '2019':
                group_display = _group_display_2019()
                total_display = _total_display_2019()
            else:

                group_display = _group_display_2018()