transportista_vista.xml 4.71 KB
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data noupdate="0">

      <!-- explicit list view definition -->
      <record model="ir.ui.view" id="hgt_transportar.trans_transportista_list">
        <field name="name">Transportista</field>
        <field name="model">trans.transportista</field>
        <field name="arch" type="xml">
          <tree>
            <field name="trans_nombre"/>
            <field name="trans_razon_social"/>
            <field name="trans_tipo_ent"/>
            <field name="trans_telefono"/>
            <field name="trans_tipo"/>
          </tree>
        </field>
      </record>

      <record model="ir.ui.view" id="hgt_transportar.trans_transportista_form">
        <field name="name">Transportista</field>
        <field name="model">trans.transportista</field>
        <field name="arch" type="xml">
          <form>
            <header>
              <button name="deduplicar_pr" class='btn btn-warning' string="Quitar puntos de retiro duplicados" type="object" />
              <button name="publicar" class='btn btn-warning' string="Publicar imagen" type="object" />
              <button name="comprar" class='btn btn-info' string="Comprar membresia" type="object" />
            </header>
            <sheet>
              <group col="2" string="Datos generales">
                <field name="trans_nombre" colspan="2"/>
                <field name="trans_razon_social" colspan="2" required="1"/>
                <field name="trans_cuit" colspan="2" required="1"/>
              </group>
              <group col="2" string="Imagen">
                <field name="imagen" widget='image' options="{'preview_image': 'image_small', 'size': [30, 30]}"/>
              </group>
              <group col="2" string="Datos de contacto">
                <field name="trans_telefono" colspan="2" required="1"/>
                <field name="trans_email" widget="email" colspan="2"/>
                <field name="trans_pagina_web" colspan="2"/>
                <field name="trans_logo" colspan="2" />
              </group>
              <group col="2" string="Características del transporte">
                <field name="trans_tipo_ent" colspan="2" required="1"/>
                <field name="trans_tipo" placeholder="Tipo de transporte" widget="many2many_tags" nolabel="1" colspan="2" />
                <field name="trans_restriccion_elem" colspan="2"/>
                <!-- <field name="trans_pto_retiro" nolabel="1" colspan="2" /> -->
                <field name="trans_posee_ayu" colspan="2"/>
                <field name="trans_observ" colspan="2"/>
              </group>
              <group col="2" string="Puntos de retiro / Sucursales">
                <field name="trans_pto_retiro"  nolabel="1" widget="one2many"  >
                  <tree create="1"  edit="1" editable="bot" delete="1">
                      <field name="pr_nombre"  create_edit="1" create="1" editable="1"/>
                      <field name="pr_localidad" options="{'no_create': True, 'no_create_edit':True}"/>
                      <field name="pr_direccion"/>
                      <field name="pr_telefono" />
                      <button name="AbrirMe" class='btn btn-info' string="Ver detalles" type="object" />
                  </tree>
              </field>
              </group>
              <group col="2" string="Datos de usuario">
                <field name="trans_categoria" readonly="0" colspan="2"/>
              </group>
            </sheet>
          </form>
        </field>
      </record>

      <record model="ir.ui.view" id="hgt_transportar.trans_transportista_search">
        <field name="name">Transportista</field>
        <field name="model">trans.transportista</field>
        <field name="arch" type="xml">
          <search string="Busqueda de transportista">
            <field name="trans_nombre"/>
            <field name="trans_razon_social"/>
            <field name="trans_tipo_ent"/>
            <field name="trans_tipo"/>
            <field name="controlar_robot"/>
          </search>
        </field>
      </record>

      <!-- accion con reglas de acceso -->
      <record model="ir.actions.act_window" id="hgt_transportar.trans_transportista_action_window">
        <field name="name">Transportista</field>
        <field name="res_model">trans.transportista</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[["ejecutor","=",uid]]</field>
      </record>

      <!-- accion sin reglas para administrador -->
      <record model="ir.actions.act_window" id="hgt_transportar.trans_transportista_desdoblado_action_window">
        <field name="name">Transportista</field>
        <field name="res_model">trans.transportista</field>
        <field name="view_mode">tree,form</field>
      </record>

    </data>
</odoo>