Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

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

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

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

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
1 Responder
32333 Visualizações
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
Cancelar
Avatar
Jagdish Panchal
Melhor resposta

Hi,

You can try this

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

use this

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

1
Avatar
Cancelar
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',}

Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة 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 é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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