Skip to Content
Menu
This question has been flagged
1 Atsakyti
4599 Rodiniai

Hi All, 

I have a custom module which exports xlsx accounting reports.  When I export the report, it is saved in /var/lib/odoo directory instead in Downloads folder. Temporarily I set the path to home:

home = os.getenv("HOME")

When I print the home, the result is /var/lib/odoo. How do I get the home directory?


Thanks!

Portretas
Atmesti
Best Answer

try 

from os.path import expanduser
home = expanduser("~")

or if you are in python 3.5 + try

from pathlib import Path
home = str(Path.home())


Portretas
Atmesti
Autorius

Hi Hilar,

I've tried both but the output path is still /var/lib/odoo..

Related Posts Replies Rodiniai Veikla
1
liep. 25
1898
3
vas. 25
15099
1
bal. 25
2168
1
bal. 25
2126
0
spal. 23
1476