<odoo>

    <record model="ir.ui.view" id="mklab_forecast_mrp.listforecast">
      <field name="name">Прогноз и план</field>
      <field name="model">mklab.forecast</field>
      <field name="arch" type="xml">
        <list>
          <field name="name"/>
          <field name="start_date"/>
          <field name="state"/>
          <field name="is_promo"/>
          <field name="total_amount"/>
        </list>
      </field>
    </record>

    <record model="ir.ui.view" id="mklab_forecast_mrp.formforecast">
      <field name="name">Прогноз и план</field>
      <field name="model">mklab.forecast</field>
      <field name="arch" type="xml">
        <form>
          <header>
            <field name="state" widget="statusbar" statusbar_visible="draft,active"/>
            <button name="fill_lines" type="object" string="Заполнить строки" class="oe_highlight"/>
            <button name="create_mrp" type="object" string="Создать заказы на производство" class="oe_highlight"/>
            <button name="action_validate" string="Утвердить" type="object" class="oe_highlight"/>
            <button name="action_cancel" string="Отменить" type="object"/>
          </header>
          <sheet>
            <group>
              <group>
                <field name="start_date"/>
                <field name="is_promo"/>
                <field name="expected_growth"/>
              </group>
              <group>
                <field name="is_ready_to_calc"/>
                <field name="total_amount"/>
              </group>
            </group>
            <group>
              <field name="partner_ids" widget="many2many_tags"/>
            </group>
            <field name="forecast_line_ids">
              <list editable="top">
                <field name="product_id"/>
                <field name="forecast_value"/>
                <field name="order_value"/>
                <field name="invoice_value"/>
                <field name="price"/>
                <field name="total_amount"/>
                <field name="bom_id"/>
                <field name="mrp_order_id"/>
                <field name="notes"/>
                <field name="is_calculated" readonly="True"/>
                <button name="get_forecast_values" type="object" string="Прогноз"/>
                <button name="get_fact_values" type="object" string="Факт"/>
                <button name="calc_bom" type="object" string="Подобрать ВМ"/>
              </list>
            </field>
          </sheet>
        </form>
      </field>
    </record>

    <record model="ir.ui.view" id="mklab_forecast_mrp.discmaster">
      <field name="name">Влияние скидок на рост продаж</field>
      <field name="model">mklab.discountmaster</field>
      <field name="arch" type="xml">
        <form>
          <sheet>
            <group>
              <field name="date_from"/>
              <field name="date_to"/>
              <field name="accuracy"/>
              <field name="is_net_check"/>
            </group>
            <field name="line_ids">
              <list editable="top">
                <field name="product_id"/>
                <field name="our_disc"/>
                <field name="net_disc"/>
                <field name="sale_growth"/>
                <field name="note"/>
                <button name="calc_sale_growth" type="object" string="Расчет" class="oe_highlight"/>
              </list>
            </field>
          </sheet>
        </form>
      </field>
    </record>

    <record model="ir.actions.act_window" id="mklab_forecast_mrp.action_windowforecast">
      <field name="name">Прогноз-план</field>
      <field name="res_model">mklab.forecast</field>
      <field name="view_mode">list,form</field>
    </record>

    <record model="ir.actions.act_window" id="mklab_forecast_mrp.action_window_master">
      <field name="name">Влияние скидок на рост продаж</field>
      <field name="res_model">mklab.discountmaster</field>
      <field name="view_mode">form</field>
      <field name="target">new</field>
    </record>

    <menuitem name="Прогнозы" id="mklab_forecast_mrp.menu_2_list"
              parent="mklab_forecast_mrp.menu_2"
              action="mklab_forecast_mrp.action_windowforecast"/>

    <menuitem name="Мастер анализа данных" id="mklab_forecast_mrp.menu_3_list"
              parent="mklab_forecast_mrp.menu_3"
              action="mklab_forecast_mrp.action_window_master"/>

</odoo>
