Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How to format a field as URL link (href)?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
1 Responder
32320 Vistas
Avatar
Anuradha

How to format a field as URL link (href)?

My code is

        <record id="voipdata_tree_view" model="ir.ui.view">
           <field name="name">File Details</field>
            <field name="model">filedata</field>
            <field name="priority" eval="1"/>
             <field name="type">tree</field>
                  <field name="arch" type="xml">
                          <tree string="File Names" create="false" edit="false">
                             <field name="file_name" widget="url" placeholder="www.openerp.com"/>
                             <field name="time_created" string="Time Created"/>
                              <field name="size" string="Size"/>
                             </tree>
                   </field>
    </record>

My fields are

 class filedata(osv.osv):
         _name = 'filedata'
       _log_access = False
       _columns = {
                            'file_name'     :   fields.char('Name'),
                            'time_created'  :   fields.datetime('Date Time'),
                            'size'          :   fields.char('Size')
                        }

I insert values to this fields from function "get_filenames" during button click from another form which is given below

 <form string="voip" version="7.0">
      <style>.openerp .oe_application .oe_breadcrumb_title  {display:none }</style>
      <style>.openerp .oe_view_manager table.oe_view_manager_header .oe_view_manager_buttons{display:none } </style>
      <header>
               <button name="get_filenames" type="object" string="List Files" onclick="display_change()" class="oe_highlight"/>
      </header>
 </form>

But its not working by giving widget="url" . please help!!

1
Avatar
Descartar
Avatar
Jagdish Panchal
Mejor respuesta

Hi,

You can try this

'file_name' : fields.char('Name'),

use this

'file_name' : fields.binary(string='Name'), thanks

1
Avatar
Descartar
Anuradha
Autor

@jack I changed my code but its not working . I will add code in my question. please check

Jagdish Panchal

@anuradha: give more details regarding your field..

Anuradha
Autor

@jack ok .i update the question

Jagdish Panchal

@anuradha; You want attached any file using this field ??

Anuradha
Autor

@jack i didnt get you :(. I want to attach a link to download mp3 file

Jagdish Panchal

I have update answer

Anuradha
Autor

@jack i changed code now it shows links eg:- "Download (21.00 bytes)" in my tree view .But I want to show my file names in each field and play my mp3 in browser on clicking that link. I also want an option to download file to users computer. Can you please help me to achieve this

Anuradha
Autor

@jack Using binary field help me to download file. Thank alot jack :). Do you help me on playing this mp3 file on clicking play buttton

Jagdish Panchal

@anuradha: I didnt get ? (Do you help me on playing this mp3 file on clicking play buttton)

Anuradha
Autor

@jack My files are mp3 files. Now i implimented "download" option for them, and i want a "Play" button/link which will play the file !! got me?

Jagdish Panchal

@anuradha: I think you have do python code for that create method and execute this method on button click

Anuradha
Autor

What should i do in create method? decode binary and return to form?

Jagdish Panchal

@anuradha: have finish download mp3 file and play it ..??

Jagdish Panchal

How's u download file in url ?

Anuradha
Autor

http://help.openerp.com/question/31568/how-to-display-field-as-hyperlink/

Anuradha
Autor

@ jack By giving ftp url

Jagdish Panchal

I have same problem, i have create one button export wizard "download zip" , when i click on button it download zip file of exported data , but i am not able downlaod file

Jagdish Panchal

I have same problem, i have create one button export wizard "download zip" , when i click on button it download zip file of exported data , but i am not able downlaod file

Anuradha
Autor

@jack sorry i will update tomorrow.my work time over

Jagdish Panchal

ok but its xml side wht from python side

Anuradha
Autor

@jack if you are using binary field no need to use python code .Just add that field in xml and you can download by clicking link.

Anuradha
Autor

@jack My py function returns a action url after that my button disables.Open erp adds an attribute disable="disable" to my button . I dnt want to disable button.Please help? My code is <button name="play_file" type="object" string="Play or download" />

def play_file(self, cr, uid, ids, context=None): res = self.read(cr, uid, ids, ['file_name'], context=context) file_name = res[0]['file_name'] return{ 'type': 'ir.actions.act_url', 'url':'ftp://test.claudion.com:123/'+file_name,

'target': 'new',}

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now