Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

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

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
1 Rispondi
32331 Visualizzazioni
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
Abbandona
Avatar
Jagdish Panchal
Risposta migliore

Hi,

You can try this

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

use this

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

1
Avatar
Abbandona
Anuradha
Autore

@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
Autore

@jack ok .i update the question

Jagdish Panchal

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

Anuradha
Autore

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

Jagdish Panchal

I have update answer

Anuradha
Autore

@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
Autore

@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
Autore

@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
Autore

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
Autore

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

Anuradha
Autore

@ 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
Autore

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

Jagdish Panchal

ok but its xml side wht from python side

Anuradha
Autore

@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
Autore

@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',}

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

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