Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4144 Visualizzazioni

Hello EveryOne I want to get path of file imported this field declared like this

attachment_ids = fields.Many2many('ir.attachment', string='Files')
file = fields.Binary('file',string='file')
@api.multi
def get_path_file(self):
    path =""
    path = pathof(self.file)# here i want to get the path
    shutil.copy2(path+name_of_file, '/desktop/folder_copy')

in onchange or any method when i make a breakpoint i want to get path like this

( /home/Desktop/backup/files/myfile.pdf) from any system (linux ,windows ,MacOs)

NB : Odoo 12 

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 20
4875
2
lug 24
14127
3
feb 25
3578
0
mag 24
46
1
apr 24
3367