Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4747 Zobrazení

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!

Avatar
Zrušit
Nejlepší odpověď

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())


Avatar
Zrušit
Autor

Hi Hilar,

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

Related Posts Odpovědi Zobrazení Aktivita
1
čvc 25
2186
3
úno 25
15461
1
dub 25
2399
Export Import Vyřešeno
1
dub 25
2401
0
říj 23
1700