<?xml version="1.0" encoding="utf-8" ?>
<!-- -->
<!-- (c) Copyright Ascensio System SIA 2024 -->
<!-- -->
<odoo>
  <record id="action_eurooffice_demo_templates" model="ir.actions.act_window">
    <field name="name">Manage Templates</field>
    <field name="res_model">eurooffice.odoo.demo.templates</field>
    <field name="view_mode">form</field>
    <field name="target">new</field>
  </record>

  <record id="view_eurooffice_demo_templates_form" model="ir.ui.view">
    <field name="name">eurooffice.demo.templates.form</field>
    <field name="model">eurooffice.odoo.demo.templates</field>
    <field name="arch" type="xml">
      <form>
        <p>
          Check templates you want to export to the Euro-Office Templates module and press Export. You can do this as many times as you need.
        </p>
        <field name="selected_templates" widget="eurooffice_template_tree" />
        <footer>
          <button name="action_save" string="Export" type="object" class="btn-primary" />
          <button string="Cancel" special="cancel" class="btn-secondary" />
        </footer>
      </form>
    </field>
  </record>

  <record id="res_config_settings_view_form" model="ir.ui.view">
    <field name="name">res.config.settings.view.form.inherit.eurooffice_odoo_templates</field>
    <field name="model">res.config.settings</field>
    <field name="priority" eval="10" />
    <field name="inherit_id" ref="base.res_config_settings_view_form" />
    <field name="arch" type="xml">
      <xpath expr="//div[hasclass('o_eurooffice_settings_common')]" position="after">
        <div>
          <h2>Euro-Office Templates</h2>
          <div class="row mt16 o_settings_container">
            <div class="col-12 col-lg-6 o_setting_box">
              <div class="o_setting_left_pane" />
              <div class="o_setting_right_pane">
                <span class="o_form_label">
                  Templates gallery
                </span>
                <div class="text-muted">
                  Export templates to the Euro-Office Templates module
                </div>
                <div class="text-muted content-group mt16">
                  <button
                    type="action"
                    name="%(action_eurooffice_demo_templates)d"
                    string="Manage templates"
                    class="btn-link"
                    icon="fa-arrow-right"
                  />
                </div>
              </div>
            </div>
          </div>
          <div class="row mt16 o_settings_container">
            <div class="col-12 col-lg-6 o_setting_box">
              <div class="o_setting_left_pane">
                <field name="editable_form_fields" />
              </div>
              <div class="o_setting_right_pane">
                <label class="o_form_label" for="editable_form_fields">
                  Disable form fields after printing PDF form
                </label>
                <div class="text-muted">
                  Form fields cannot be filled in manually if they were not automatically filled in
                  with data from Odoo
                </div>
              </div>
            </div>
          </div>
        </div>
      </xpath>
    </field>
  </record>
</odoo>
