# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from lxml import etree

from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.safe_eval import safe_eval
from odoo.tools.translate import _

class kpi_input(models.Model):
    _name = 'kpi.input'
    _description = 'Input'

    name = fields.Char('Label', required=True)
    code = fields.Char('Code', required=True)
    comment = fields.Text('Comment')
    domain_id = fields.Many2one('kpi.domain', string='Source',domain=[('domain', '=', 'origem')])

    _sql_constraints = [('uniq_label', 'unique(name)', 'Label must be unique for each Input.'),('uniq_code', 'unique(code)', 'Code must be unique for each Input.')]

