How can I format local (not hosted) file links to be clickable?

Kevin Poli

Odoo v.12

Hello all,

I'm struggling against this :

I'm looking for a way that allow me to 

click on  the link underlined

(this link referes to a folder shared in a close net) of the field “Path Pratica”  ,then should be open a filesystem pop-up(  or something else)  that allow the users  to browse inside the directory and open/create/delete the file inside as normally do windows when we open the archive



 I hope I was clear,

I would be glad if someone could help me,

1 Comment
Harri Matero

Same issue here.
Dit you resolve this?

1 Answer
Alan Scott
Best Answer


To achieve the functionality you’ve described for Odoo v12, you can follow these steps:

  1. Create a new custom module in Odoo to add this feature.
  2. Add a new Python method in the model where the “Path Pratica” field is located. This method will handle opening the folder when the link is clicked.
from odoo import models, fields, api
import os

class YourModel(models.Model):
    _inherit = ''

    def open_folder(self):
        path = self.path_pratica
        if path:
            except Exception as e:
                raise Warning('An error occurred while opening the folder: {}'.format(e))
            raise Warning('No folder path specified.')
  1. Next, add a button on the form view of your model to invoke this function:
  1. (Optional) To make it appear like an underlined link, you may need to add some CSS styling to that button:

Just replace '' with the correct model name where the “Path Pratica” field is located.

Once implemented, users should be able to click on the underlined button/link in Odoo’s form view which will then open a file explorer window allowing them to browse and interact with files within the specified directory.

Please let me know if you have any questions or need further assistance!