# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2010-now OpenERP s.a. (<http://odoo.com>).
#    Copyright (C) 2015-now cofair GMBH (<http://www.cofair.ch>).
#    Author Mathias Neef <mn[at]copado.de>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from odoo import fields, models


class PluraflowResCompany(models.Model):
    """inerits res.company with settings
    for letterhead and additions for german law"""
    _inherit = 'res.company'

    HEADER_POSITION_SELECTION = [
        ('left', 'left'),
        ('center', 'center'),
        ('right', 'right')
    ]

    ADDRESS_POSITION_SELECTION = [
        ('left', 'left'),
        ('right', 'right')
    ]

    FOOTER_POSITION_SELECTION = [
        ('left', 'left'),
        ('center', 'center'),
        ('right', 'right'),
        ('block', 'block')
    ]

    pw_custom1 = fields.Char('Custom Field 1')
    pw_custom2 = fields.Char('Custom Field 2')
    pw_custom3 = fields.Char('Custom Field 3')
    pw_custom4 = fields.Char('Custom Field 4')
    pw_letterhead_image = fields.Binary(
        'Letterhead Image',
        help='Best Size: 250x90px (LxH) with 96dpi')
    pw_letterhead_fname = fields.Char(
        'Image Filename',
        size=256)
    pw_header_position = fields.Selection(
        HEADER_POSITION_SELECTION,
        'Header Position',
        required=True,
        default='center')
    pw_address_position = fields.Selection(
        ADDRESS_POSITION_SELECTION,
        'Address Position',
        required=True,
        default='left')
    pw_footer_position = fields.Selection(
        FOOTER_POSITION_SELECTION,
        'Footer Position',
        required=True,
        default='right')
