feat: Add Populate Scripts
This commit is contained in:
24
demo/populate_scripts/country.py
Normal file
24
demo/populate_scripts/country.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
try:
|
||||
import pycountry
|
||||
except ImportError:
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'pycountry'])
|
||||
import pycountry
|
||||
|
||||
|
||||
try:
|
||||
from trytond.modules.country.scripts.import_countries import do_import
|
||||
except ImportError:
|
||||
def do_import(*args, **kwargs):
|
||||
pass
|
||||
|
||||
__all__ = [do_import]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
do_import()
|
||||
Reference in New Issue
Block a user