# -*- coding: utf-8 -*-
from odoo import models, fields


class HypergraphTemplates(models.Model):
    _name = 'hg.templates'

    name = fields.Char(string='Название')
    line_ids = fields.One2many(comodel_name='hg.templates.line', inverse_name='template_id', string='Строки шаблона')


class HypergraphTemplatesLine(models.Model):
    _name = 'hg.templates.line'

    template_id = fields.Many2one(comodel_name='hg.templates', string='Шаблон', required=True, ondelete='cascade')
    index_id = fields.Many2one('hg.index', string='Показатель', required=True)
    date_due = fields.Date(string='Плановая дата')
    value_float_plan = fields.Float(string='Плановая сумма')