Compare commits
10 Commits
d18cef15f5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a22d984518 | |||
| b1f8e15530 | |||
| 049b1f697a | |||
| b4999f9640 | |||
| b6d78c54cb | |||
| e85dba34d5 | |||
| 05810b473b | |||
| db7ed16ec5 | |||
| 76fb479b67 | |||
| 9d591237ec |
26
.dev/dev.py
26
.dev/dev.py
@@ -8,29 +8,43 @@ import inotify.adapters
|
|||||||
|
|
||||||
logging.basicConfig(level=logging.INFO, stream=sys.stderr)
|
logging.basicConfig(level=logging.INFO, stream=sys.stderr)
|
||||||
|
|
||||||
SRC = os.environ['SRC']
|
SRC = os.environ['SRC'] + '/modules/'
|
||||||
MODULE_NAME = os.environ['MODULE_NAME']
|
MODULES = os.environ['MODULES'].split(':')
|
||||||
DB_NAME = os.environ['DB_NAME']
|
DB_NAME = os.environ['DB_NAME']
|
||||||
|
|
||||||
|
|
||||||
def _main():
|
def _main():
|
||||||
i = inotify.adapters.Inotify()
|
i = inotify.adapters.Inotify()
|
||||||
|
|
||||||
i.add_watch(SRC)
|
|
||||||
logging.info("MONITOREANDO ARCHIVOS EN %s", SRC)
|
logging.info("MONITOREANDO ARCHIVOS EN %s", SRC)
|
||||||
|
|
||||||
|
for module in MODULES:
|
||||||
|
logging.info('NOMBRE DEL MODULO A MONITOREAR%s', module)
|
||||||
|
i.add_watch(
|
||||||
|
SRC + module)
|
||||||
|
|
||||||
for event in i.event_gen(yield_nones=False):
|
for event in i.event_gen(yield_nones=False):
|
||||||
(_, type_names, path, filename) = event
|
(_, type_names, path, filename) = event
|
||||||
(_, ext) = os.path.splitext(filename)
|
(_, ext) = os.path.splitext(filename)
|
||||||
|
|
||||||
if 'IN_CLOSE_WRITE' not in type_names:
|
if 'IN_CLOSE_WRITE' not in type_names:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
module_name = path.split('/')[-1]
|
||||||
|
logging.info('NOMBRE DEL MODULO %s', module_name)
|
||||||
|
|
||||||
if ext in ['.py', '.xml', '.cfg']:
|
if ext in ['.py', '.xml', '.cfg']:
|
||||||
for _ in range(0, 10):
|
for _ in range(0, 10):
|
||||||
if os.system("trytond-admin -d {} -u {}".format(DB_NAME, MODULE_NAME)) != 0:
|
command = "trytond-admin -d {} -u {} --act -vv".format(
|
||||||
|
DB_NAME, module_name)
|
||||||
|
logging.debug("Ejecutando comando: %s", command)
|
||||||
|
update_module = os.system(command)
|
||||||
|
if update_module != 0:
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
logging.error("fallo trytond-admin")
|
logging.error("fallo trytond-admin")
|
||||||
else:
|
else:
|
||||||
logging.info("ACTUALIZADO TRYTOND POR CAMBIO DE ARCHIVO %s", filename)
|
logging.info(
|
||||||
|
"ACTUALIZADO TRYTOND POR CAMBIO DE ARCHIVO %s",
|
||||||
|
filename)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,30 @@
|
|||||||
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
|
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
|
||||||
|
|
||||||
# dependencias minimas
|
# dependencias minimas
|
||||||
pip3 install psycopg2 proteus==7.0.0 inotify honcho qrcode==6.1 pyshp==2.3.1 shapely==2.0.2
|
pip3 install psycopg2 proteus==${TRYTOND_VERSION} inotify honcho qrcode==6.1 pyshp==2.3.1 shapely==2.0.2 scipy==1.13.1 matplotlib==3.9.0
|
||||||
pip3 install trytond-party trytond-company trytond-product trytond-product_image trytond-currency trytond-notification_email
|
|
||||||
|
if [ "$FACHO" == "True" ]; then
|
||||||
|
pip3 install git+https://${GITEA_USER}:${GITEA_PASSWORD}@${GITEA_DOMAIN}/OneTeam/oc-facho.git@MigrationPython312Test
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip3 install trytond-country==${TRYTOND_VERSION}\
|
||||||
|
trytond-company==${TRYTOND_VERSION}\
|
||||||
|
trytond-party==${TRYTOND_VERSION} \
|
||||||
|
trytond-company==${TRYTOND_VERSION}\
|
||||||
|
trytond-currency==${TRYTOND_VERSION}\
|
||||||
|
trytond-account_product==${TRYTOND_VERSION}\
|
||||||
|
trytond-account_invoice_stock==${TRYTOND_VERSION}\
|
||||||
|
trytond-account_stock_continental==${TRYTOND_VERSION}\
|
||||||
|
trytond-account_statement==${TRYTOND_VERSION}\
|
||||||
|
trytond-bank==${TRYTOND_VERSION}\
|
||||||
|
trytond-product==${TRYTOND_VERSION}\
|
||||||
|
trytond-product_price_list==${TRYTOND_VERSION}\
|
||||||
|
trytond-purchase==${TRYTOND_VERSION}\
|
||||||
|
trytond-sale==${TRYTOND_VERSION}\
|
||||||
|
trytond-sale_price_list==${TRYTOND_VERSION}\
|
||||||
|
trytond-notification_email==${TRYTOND_VERSION}\
|
||||||
|
|
||||||
|
module_names=()
|
||||||
|
|
||||||
for module in modules/*/; do
|
for module in modules/*/; do
|
||||||
|
|
||||||
@@ -23,6 +45,10 @@ for module in modules/*/; do
|
|||||||
# instalar modulo
|
# instalar modulo
|
||||||
trytond_modules_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond/modules
|
trytond_modules_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond/modules
|
||||||
module_name=`cat "setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n'`
|
module_name=`cat "setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n'`
|
||||||
|
|
||||||
|
# Añadir el nombre del módulo al arreglo
|
||||||
|
module_names+=("$module_name")
|
||||||
|
|
||||||
[ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
|
[ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
|
||||||
ln -sf "$SRC/$module" "$trytond_modules_path/$module_name"
|
ln -sf "$SRC/$module" "$trytond_modules_path/$module_name"
|
||||||
rm -rf "$SRC/$module/$module_name"
|
rm -rf "$SRC/$module/$module_name"
|
||||||
@@ -33,6 +59,9 @@ done
|
|||||||
|
|
||||||
trytond_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond
|
trytond_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond
|
||||||
|
|
||||||
|
module_names=$(IFS=:; echo "${module_names[*]}")
|
||||||
|
|
||||||
|
|
||||||
if [ -d "locale_custom" ]; then
|
if [ -d "locale_custom" ]; then
|
||||||
cp -f "locale_custom/ir/pt.po" "$trytond_path/ir/locale/"
|
cp -f "locale_custom/ir/pt.po" "$trytond_path/ir/locale/"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
# este script fuerza que los cambios se vean reflejados
|
|
||||||
# directamente en trytond.
|
|
||||||
#
|
|
||||||
# variables exportadas:
|
|
||||||
# - module_name
|
|
||||||
|
|
||||||
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
|
|
||||||
|
|
||||||
# dependencias minimas
|
|
||||||
pip3 install psycopg2 proteus==7.0.0 inotify honcho qrcode==6.1 pyshp==2.3.1 shapely==2.0.2
|
|
||||||
pip3 install trytond-party trytond-company trytond-product trytond-product_image trytond-currency trytond-notification_email
|
|
||||||
|
|
||||||
for module in modules/*/; do
|
|
||||||
|
|
||||||
pushd "$module"
|
|
||||||
|
|
||||||
# instalar dependencias de tryton desde paquete
|
|
||||||
python3 setup.py install
|
|
||||||
|
|
||||||
# usamos enlace al paquete
|
|
||||||
python3 setup.py develop
|
|
||||||
|
|
||||||
# instalar modulo
|
|
||||||
trytond_modules_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond/modules
|
|
||||||
module_name=`cat "setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n'`
|
|
||||||
[ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
|
|
||||||
ln -sf "$SRC/$module" "$trytond_modules_path/$module_name"
|
|
||||||
rm -rf "$SRC/$module/$module_name"
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
trytond_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond
|
|
||||||
|
|
||||||
if [ -d "locale_custom" ]; then
|
|
||||||
cp -f "locale_custom/ir/pt.po" "$trytond_path/ir/locale/"
|
|
||||||
fi
|
|
||||||
@@ -24,7 +24,7 @@ yes admin | trytond-admin -d ${DB_NAME} --all --act
|
|||||||
|
|
||||||
# ejecutar servidor
|
# ejecutar servidor
|
||||||
export SCRIPT_DIR
|
export SCRIPT_DIR
|
||||||
export MODULE_NAME=$module_name
|
export MODULES=$module_names
|
||||||
export DB_NAME
|
export DB_NAME
|
||||||
export SRC
|
export SRC
|
||||||
|
|
||||||
|
|||||||
45
.env_exmple
Normal file
45
.env_exmple
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# version Trytond server example 6.0
|
||||||
|
TRYTOND_VERSION=6.8
|
||||||
|
TRYTON_ADMIN_PASS=admin
|
||||||
|
TRYTON_ADMIN_EMAIL=admin@admin.co
|
||||||
|
TRYTONADMINPASS=admin
|
||||||
|
TRYTONPASSFILE=/etc/trytond_admin_pass.conf
|
||||||
|
|
||||||
|
# TRYTOND operation mode
|
||||||
|
TRYTON_PORT=8000
|
||||||
|
DEVELOP=True
|
||||||
|
WORKER=False
|
||||||
|
|
||||||
|
# Facho
|
||||||
|
FACHO=True
|
||||||
|
FACHO_BRANCH=MigrationPython312Test
|
||||||
|
|
||||||
|
# if the module repository is private
|
||||||
|
GITEA_USER=USER
|
||||||
|
GITEA_PASSWORD=PASSWORD
|
||||||
|
GITEA_ACCESS_TOKEN=TOKEN
|
||||||
|
GITEA_DOMAIN=git.domain.org
|
||||||
|
|
||||||
|
# Choise a valid file seed from into folder ./sets
|
||||||
|
SET=./sets/modules.txt
|
||||||
|
|
||||||
|
# Database configuration
|
||||||
|
DB_PASSWORD=SUp3r-pass*DB
|
||||||
|
POSTGRES_DB=tryton
|
||||||
|
DB_HOSTNAME=db
|
||||||
|
POSTGRES_PASSWORD=SUp3r-pass*DB
|
||||||
|
|
||||||
|
#SMTP This value is True or False
|
||||||
|
SMTP=False
|
||||||
|
SMTP_TYPE=smtps+ssl
|
||||||
|
SMTP_USER=email@example.com
|
||||||
|
SMTP_PASSWORD=PASSWORD
|
||||||
|
SMTP_DOMAIN=mail.example.org
|
||||||
|
SMTP_PORT=465
|
||||||
|
SMTP_FROM="NAME_FROM <email@example.com>"
|
||||||
|
SMTP_EMAIL=email@example.org
|
||||||
|
|
||||||
|
#NGINX
|
||||||
|
SERVER_NAME=localhost.example
|
||||||
|
NGINX_PORT=10000
|
||||||
|
VARIABLE=$
|
||||||
3
.flake8
Normal file
3
.flake8
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[flake8]
|
||||||
|
ignore=E123,E124,E126,E128,E741,W503,E204
|
||||||
|
exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,.dev
|
||||||
231
.gitignore
vendored
Normal file
231
.gitignore
vendored
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
# ---> Python
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
*.bk
|
||||||
|
|
||||||
|
/.vscode
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Deploy Modules
|
||||||
|
modules/
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
bin/
|
||||||
|
include/
|
||||||
|
wheels/
|
||||||
|
__pycache__
|
||||||
|
trytond_miac.egg-info/
|
||||||
|
pip-wheel-metadata/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script fkrom a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
*.py,cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# ---> Emacs
|
||||||
|
# -*- mode: gitignore; -*-
|
||||||
|
*~
|
||||||
|
.~*
|
||||||
|
*#
|
||||||
|
\#*\#
|
||||||
|
/.emacs.desktop
|
||||||
|
/.emacs.desktop.lock
|
||||||
|
*.elc
|
||||||
|
auto-save-list
|
||||||
|
tramp
|
||||||
|
.\#*
|
||||||
|
|
||||||
|
# Org-mode
|
||||||
|
.org-id-locations
|
||||||
|
*_archive
|
||||||
|
|
||||||
|
# flymake-mode
|
||||||
|
*_flymake.*
|
||||||
|
|
||||||
|
# eshell files
|
||||||
|
/eshell/history
|
||||||
|
/eshell/lastdir
|
||||||
|
|
||||||
|
# elpa packages
|
||||||
|
/elpa/
|
||||||
|
|
||||||
|
# reftex files
|
||||||
|
*.rel
|
||||||
|
|
||||||
|
# AUCTeX auto folder
|
||||||
|
/auto/
|
||||||
|
|
||||||
|
# cask packages
|
||||||
|
.cask/
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# Flycheck
|
||||||
|
flycheck_*.el
|
||||||
|
|
||||||
|
# server auth directory
|
||||||
|
/server/
|
||||||
|
|
||||||
|
# projectiles files
|
||||||
|
.projectile
|
||||||
|
|
||||||
|
# directory configuration
|
||||||
|
.dir-locals.el
|
||||||
|
|
||||||
|
# network security
|
||||||
|
/network-security.data
|
||||||
|
|
||||||
|
|
||||||
|
# ---> Vim
|
||||||
|
# Swap
|
||||||
|
[._]*.s[a-v][a-z]
|
||||||
|
!*.svg # comment out if you don't need vector files
|
||||||
|
[._]*.sw[a-p]
|
||||||
|
[._]s[a-rt-v][a-z]
|
||||||
|
[._]ss[a-gi-z]
|
||||||
|
[._]sw[a-p]
|
||||||
|
|
||||||
|
# Session
|
||||||
|
Session.vim
|
||||||
|
Sessionx.vim
|
||||||
|
|
||||||
|
# Temporary
|
||||||
|
.netrwhist
|
||||||
|
*~
|
||||||
|
# Auto-generated tag files
|
||||||
|
tags
|
||||||
|
# Persistent undo
|
||||||
|
[._]*.un~
|
||||||
|
|
||||||
|
# ---> VirtualEnv
|
||||||
|
# Virtualenv
|
||||||
|
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
||||||
|
.Python
|
||||||
|
[Bb]in
|
||||||
|
[Ii]nclude
|
||||||
|
[Ll]ib
|
||||||
|
[Ll]ib64
|
||||||
|
[Ll]ocal
|
||||||
|
[Ss]cripts
|
||||||
|
pyvenv.cfg
|
||||||
|
.venv
|
||||||
|
pip-selfcheck.json
|
||||||
|
|
||||||
|
.tdd_cache
|
||||||
|
app
|
||||||
33
.woodpecker.yml
Executable file
33
.woodpecker.yml
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# variables que puedo usar? https://woodpecker-ci.org/docs/0.15/usage/environment#built-in-environment-variables
|
||||||
|
|
||||||
|
steps:
|
||||||
|
style:
|
||||||
|
image: python:3.9
|
||||||
|
commands:
|
||||||
|
- pip3 install flake8
|
||||||
|
- flake8
|
||||||
|
|
||||||
|
tests:
|
||||||
|
image: python:3.9
|
||||||
|
environment:
|
||||||
|
- SRC=/app
|
||||||
|
- DB_CACHE=/tmp
|
||||||
|
- DB_NAME=trytontest
|
||||||
|
- TRYTOND_DATABASE_URI=postgresql://tryton:tryton@postgres:5432/
|
||||||
|
commands:
|
||||||
|
- pip3 install psycopg2 proteus qrcode==6.1 image==1.5.33
|
||||||
|
- mkdir /app
|
||||||
|
- mv modules /app
|
||||||
|
- mv .dev /app
|
||||||
|
- cd /app
|
||||||
|
- /bin/bash .dev/install_module.sh
|
||||||
|
- python -m unittest discover -s modules
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:12
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=tryton
|
||||||
|
- POSTGRES_PASSWORD=tryton
|
||||||
|
- POSTGRES_DB=demo
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
argcomplete==2.0.0
|
|
||||||
argon2-cffi==21.1.0
|
|
||||||
asttokens==2.2.1
|
|
||||||
attrs==22.2.0
|
|
||||||
backcall==0.2.0
|
|
||||||
bcrypt==3.2.2
|
|
||||||
beautifulsoup4==4.11.2
|
|
||||||
braintree==4.24.0
|
|
||||||
cached-property==1.5.2
|
|
||||||
certifi==2022.9.24
|
|
||||||
cffi==1.15.1
|
|
||||||
chardet==5.1.0
|
|
||||||
charset-normalizer==3.0.1
|
|
||||||
click==8.1.3
|
|
||||||
colorama==0.4.6
|
|
||||||
cryptography==41.0.5
|
|
||||||
csb43==0.9.2
|
|
||||||
decorator==5.1.1
|
|
||||||
defusedxml==0.7.1
|
|
||||||
efficient-apriori==2.0.3
|
|
||||||
elastic-transport==8.10.0
|
|
||||||
elasticsearch==8.11.0
|
|
||||||
elementpath==4.1.5
|
|
||||||
executing==1.2.0
|
|
||||||
febelfin-coda==0.2.0
|
|
||||||
freezegun==1.2.1
|
|
||||||
Genshi==0.7.7
|
|
||||||
gevent==22.10.2
|
|
||||||
greenlet==2.0.2
|
|
||||||
gunicorn==20.1.0
|
|
||||||
html2text==2020.1.16
|
|
||||||
httplib2==0.20.4
|
|
||||||
idna==3.3
|
|
||||||
importlib-metadata==6.8.0
|
|
||||||
ipython==8.5.0
|
|
||||||
iso3166==2.1.1
|
|
||||||
isodate==0.6.1
|
|
||||||
jedi==0.18.2
|
|
||||||
ldap3==2.9.1
|
|
||||||
lxml==4.9.2
|
|
||||||
MarkupSafe==2.1.2
|
|
||||||
matplotlib-inline==0.1.6
|
|
||||||
mt940==0.6.0
|
|
||||||
oauthlib==3.2.2
|
|
||||||
ofxparse==0.21
|
|
||||||
parso==0.8.3
|
|
||||||
passlib==1.7.4
|
|
||||||
pexpect==4.8.0
|
|
||||||
phonenumbers==8.13.26
|
|
||||||
pickleshare==0.7.5
|
|
||||||
Pillow==9.4.0
|
|
||||||
platformdirs==2.6.0
|
|
||||||
ply==3.11
|
|
||||||
polib==1.1.1
|
|
||||||
prompt-toolkit==3.0.36
|
|
||||||
proteus==7.0.0
|
|
||||||
psycopg2==2.9.5
|
|
||||||
ptyprocess==0.7.0
|
|
||||||
pure-eval==0.0.0
|
|
||||||
pyactiveresource==2.2.2
|
|
||||||
pyasn1==0.4.8
|
|
||||||
pycountry==22.3.5
|
|
||||||
pycparser==2.21
|
|
||||||
pycurl==7.45.2
|
|
||||||
pydot==1.4.2
|
|
||||||
pygal==3.0.4
|
|
||||||
Pygments==2.14.0
|
|
||||||
PyJWT==2.8.0
|
|
||||||
pyOpenSSL==23.3.0
|
|
||||||
pyparsing==3.0.9
|
|
||||||
pypdf==3.4.1
|
|
||||||
pypng==0.20220715.0
|
|
||||||
pysaml2==7.4.2
|
|
||||||
PySimpleSOAP==1.16.2
|
|
||||||
python-barcode==0.15.1
|
|
||||||
python-dateutil==2.8.2
|
|
||||||
python-Levenshtein==0.12.2
|
|
||||||
python-magic==0.4.26
|
|
||||||
python-sql==1.4.2
|
|
||||||
python-stdnum==1.19
|
|
||||||
pytz==2022.7.1
|
|
||||||
PyYAML==6.0
|
|
||||||
qrcode==7.4.2
|
|
||||||
relatorio==0.10.1
|
|
||||||
requests==2.28.1
|
|
||||||
requests-file==1.5.1
|
|
||||||
requests-oauthlib==1.3.1
|
|
||||||
requests-toolbelt==0.10.1
|
|
||||||
schwifty==2023.11.0
|
|
||||||
ShopifyAPI==12.3.0
|
|
||||||
simpleeval==0.9.12
|
|
||||||
six==1.16.0
|
|
||||||
soupsieve==2.3.2
|
|
||||||
stack-data==0.6.2
|
|
||||||
stripe==7.6.0
|
|
||||||
traitlets==5.5.0
|
|
||||||
typing_extensions==4.8.0
|
|
||||||
urllib3==1.26.12
|
|
||||||
wcwidth==0.2.5
|
|
||||||
webcolors==1.13
|
|
||||||
Werkzeug==2.2.2
|
|
||||||
wrapt==1.14.1
|
|
||||||
xmlschema==2.5.0
|
|
||||||
zeep==4.2.1
|
|
||||||
zipp==3.17.0
|
|
||||||
zope.event==4.4
|
|
||||||
zope.interface==5.5.2
|
|
||||||
tabulate==0.9.0
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
# CONTRIBUIR
|
|
||||||
---
|
|
||||||
|
|
||||||
>`Para conferir o estado atual do repositório deve ser usada VPN`
|
|
||||||
|
|
||||||
### Requerimentos técnicos
|
|
||||||
|
|
||||||
* `python >= 3.9`
|
|
||||||
* `docker >= 20`
|
|
||||||
* `docker-compose >= 2`
|
|
||||||
* `pre-commit >= 2`
|
|
||||||
* `git >= 2.30`
|
|
||||||
* `rake >= 13`
|
|
||||||
|
|
||||||
### Procedimentos para testes
|
|
||||||
|
|
||||||
1. Iniciar entorno `rake init`
|
|
||||||
2. Iterar con `rake tdd`
|
|
||||||
3. Deter entorno `rake down`
|
|
||||||
4. limpar cache `git clean -xdf`
|
|
||||||
|
|
||||||
### Entorno vivo de desenvolvimento
|
|
||||||
|
|
||||||
0. Crear archivo .env y agregar variable TRYTON_PORT_LIVE="Un puerto libre del sistema"
|
|
||||||
1. Iniciar entorno `rake live:up`
|
|
||||||
2. Conectar cliente Tryton a `localhost:puerto_configurado` **usuário:** `admin` e **senha:** `admin`
|
|
||||||
1. Também pode ser usado o cliente web no `http://localhost:puerto_configurado`
|
|
||||||
2. Para ver saída de `trytond` use `rake live:tail`
|
|
||||||
3. Deter entorno `rake live:down`
|
|
||||||
|
|
||||||
### Despliegue en producción
|
|
||||||
|
|
||||||
0. Copiar .env_sample a .env y configurar las variables de entorno
|
|
||||||
1. Iniciar entorno `rake deploy:up`
|
|
||||||
2. Conectar cliente Tryton a `localhost:puerto_configurado` **usuário:** `admin` e **senha:** `admin`
|
|
||||||
1. Também pode ser usado o cliente web no `http://localhost:puerto_configurado`
|
|
||||||
3. Para ver saída de `trytond` use `rake deploy:tail`
|
|
||||||
4. Deter entorno `rake live:down`
|
|
||||||
5. Eliminar entorno (borrará todos los registros) `rake deploy:del`
|
|
||||||
6. Entrar a la bash del docker `rake deploy:sh_tryton` (otras opciones, sh_cron, sh_worker, sh_nginx, sh_db)
|
|
||||||
7. Ver top de todos los dockers `rake deploy:top`
|
|
||||||
|
|
||||||
### Considerações
|
|
||||||
|
|
||||||
* Evitar trabalho desnecessário
|
|
||||||
* Evitar generalizar: realizar testes inicialmente e depois eliminar duplicidade.
|
|
||||||
* Evitar redundância: automatizar os processos que sejam necessários.
|
|
||||||
* Evitar usar `git add .`
|
|
||||||
* Fazer expressivo o escrito: renomear, realocar ou deletar.
|
|
||||||
* Os testes devem ser executados em todo momento.
|
|
||||||
* O programa deve se manter em execução durante o tempo todo.
|
|
||||||
* Especular, estudar e aprender durante o tempo todo.
|
|
||||||
|
|
||||||
### Considerações sobre os testes
|
|
||||||
|
|
||||||
* Os cenários (`*.rst`) de teste devem ser escritos em português.
|
|
||||||
* Escrever em português o texto para identificador de classe e método em arquivos `*.py`
|
|
||||||
|
|
||||||
### Convenção de `commit`
|
|
||||||
|
|
||||||
As mensagens de `commit` se classificam como:
|
|
||||||
|
|
||||||
* **feat(\<COMPONENTE\>)**
|
|
||||||
* Nova funcionalidade disponibilizada para usuários do Sistema
|
|
||||||
* **fix(\<COMPONENTE\>)**
|
|
||||||
* Corrigir funcionalidades previamente entregues
|
|
||||||
* **chore(\<COMPONENTE\>)**
|
|
||||||
* Outras modificações que não chegam diretamente aos usuários.
|
|
||||||
* Exemplo: renomear arquivos, classes, métodos, variáveis, diretórios, scripts, documentação, recursos digitais e outros.
|
|
||||||
|
|
||||||
> `COMPONENTE` se refere ao nome do diretório
|
|
||||||
|
|
||||||
**Exemplos de `commit`:**
|
|
||||||
|
|
||||||
`git commit -m 'feat(<COMPONENTE>): rutas críticas`
|
|
||||||
|
|
||||||
`git commit -m 'fix(<COMPONENTE>): se adiciona boton faltante`
|
|
||||||
|
|
||||||
`git commit -m 'chore(<COMPONENTE>): cambio de color en columna Cargo`
|
|
||||||
105
Dockerfile
105
Dockerfile
@@ -1,97 +1,22 @@
|
|||||||
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
FROM node as builder-node
|
FROM node as builder-node
|
||||||
ENV SERIES 6.8
|
|
||||||
|
ARG TRYTOND_VERSION
|
||||||
|
ARG GITEA_USER
|
||||||
|
ARG GITEA_PASSWORD
|
||||||
|
ARG GITEA_DOMAIN
|
||||||
|
ARG FACHO
|
||||||
|
ARG FACHO_BRANCH
|
||||||
|
|
||||||
|
ENV SERIES=${TRYTOND_VERSION}
|
||||||
RUN npm install -g bower
|
RUN npm install -g bower
|
||||||
RUN curl -L https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf - -C /
|
RUN curl https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf - -C /
|
||||||
RUN cd /package && bower install --allow-root
|
RUN cd /package && bower install --allow-root
|
||||||
|
|
||||||
FROM debian:11-slim
|
FROM python:3.11-bullseye
|
||||||
LABEL maintainer="Tryton <foundation@tryton.org>" \
|
|
||||||
org.label-schema.name="Tryton" \
|
|
||||||
org.label-schema.url="http://www.tryton.org/" \
|
|
||||||
org.label-schema.vendor="Tryton" \
|
|
||||||
org.label-schema.version="6.8" \
|
|
||||||
org.label-schema.schema-version="1.0"
|
|
||||||
|
|
||||||
ENV SERIES 6.8
|
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
||||||
ENV LANG C.UTF-8
|
RUN apt-get update && apt-get install -y postgresql-client
|
||||||
|
|
||||||
RUN groupadd -r trytond \
|
|
||||||
&& useradd --no-log-init -r -d /var/lib/trytond -m -g trytond trytond \
|
|
||||||
&& mkdir /var/lib/trytond/db && chown trytond:trytond /var/lib/trytond/db \
|
|
||||||
&& mkdir /var/lib/trytond/www \
|
|
||||||
&& mkdir -p /etc/python3 \
|
|
||||||
&& echo "[DEFAULT]\nbyte-compile = standard, optimize" \
|
|
||||||
> /etc/python3/debian_config
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
curl \
|
|
||||||
python3 \
|
|
||||||
python3-pip \
|
|
||||||
python3-setuptools \
|
|
||||||
python3-wheel \
|
|
||||||
uwsgi \
|
|
||||||
uwsgi-plugin-python3 \
|
|
||||||
python3-argcomplete \
|
|
||||||
# trytond
|
|
||||||
python3-argon2 \
|
|
||||||
python3-bcrypt \
|
|
||||||
python3-cffi \
|
|
||||||
python3-genshi \
|
|
||||||
python3-gevent \
|
|
||||||
python3-html2text \
|
|
||||||
python3-pil \
|
|
||||||
python3-levenshtein \
|
|
||||||
python3-lxml \
|
|
||||||
python3-passlib \
|
|
||||||
python3-polib \
|
|
||||||
python3-psycopg2 \
|
|
||||||
python3-pydot \
|
|
||||||
python3-werkzeug \
|
|
||||||
python3-wrapt \
|
|
||||||
# modules
|
|
||||||
python3-dateutil \
|
|
||||||
python3-ldap3 \
|
|
||||||
python3-magic \
|
|
||||||
python3-ofxparse \
|
|
||||||
python3-pypdf2 \
|
|
||||||
python3-pysimplesoap \
|
|
||||||
python3-requests \
|
|
||||||
python3-simpleeval \
|
|
||||||
python3-tz \
|
|
||||||
python3-yaml \
|
|
||||||
python3-zeep \
|
|
||||||
weasyprint \
|
|
||||||
libpango-1.0-0 \
|
|
||||||
libpangoft2-1.0-0 \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN pip3 install --no-cache-dir \
|
|
||||||
"trytond == ${SERIES}.*" \
|
|
||||||
"proteus == ${SERIES}.*" \
|
|
||||||
&& for module in `curl -L https://downloads.tryton.org/${SERIES}/modules.txt`; do \
|
|
||||||
pip3 install --no-cache-dir "trytond_${module} == ${SERIES}.*" || exit 1; \
|
|
||||||
done \
|
|
||||||
&& pip3 install --no-cache-dir \
|
|
||||||
python-barcode[images] \
|
|
||||||
qrcode[pil] \
|
|
||||||
webcolors \
|
|
||||||
phonenumbers \
|
|
||||||
pycountry \
|
|
||||||
pygal \
|
|
||||||
python-stdnum[SOAP] \
|
|
||||||
schwifty \
|
|
||||||
&& python3 -c "import compileall; compileall.compile_path(maxlevels=10, optimize=1)"
|
|
||||||
|
|
||||||
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
COPY --from=builder-node /package /var/lib/trytond/www
|
COPY --from=builder-node /package /var/lib/trytond/www
|
||||||
COPY entrypoint.sh /
|
|
||||||
COPY trytond.conf /etc/trytond.conf
|
|
||||||
COPY uwsgi.conf /etc/uwsgi.conf
|
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
VOLUME ["/var/lib/trytond/db"]
|
|
||||||
ENV TRYTOND_CONFIG=/etc/trytond.conf
|
|
||||||
USER trytond
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
CMD ["uwsgi", "--ini", "/etc/uwsgi.conf"]
|
|
||||||
15
Dockerfile_Test
Executable file
15
Dockerfile_Test
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
|
FROM python:3.11-bullseye
|
||||||
|
|
||||||
|
ARG TRYTOND_VERSION
|
||||||
|
ARG GITEA_USER
|
||||||
|
ARG GITEA_PASSWORD
|
||||||
|
ARG GITEA_DOMAIN
|
||||||
|
ARG FACHO
|
||||||
|
ARG FACHO_BRANCH
|
||||||
|
|
||||||
|
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
||||||
|
RUN apt-get update && apt-get install -y postgresql-client
|
||||||
|
|
||||||
|
# Instalar psycopg2, flake8 y trytond
|
||||||
|
RUN pip install psycopg2 flake8 trytond==${TRYTOND_VERSION}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
|
||||||
FROM node as builder-node
|
|
||||||
|
|
||||||
ENV SERIES 7.0
|
|
||||||
RUN npm install -g bower
|
|
||||||
RUN curl https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf - -C /
|
|
||||||
RUN cd /package && bower install --allow-root
|
|
||||||
|
|
||||||
FROM python:3.11-bullseye
|
|
||||||
|
|
||||||
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
|
||||||
RUN apt-get update && apt-get install -y postgresql-client
|
|
||||||
|
|
||||||
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
|
||||||
COPY --from=builder-node /package /var/lib/trytond/www
|
|
||||||
53
Rakefile
53
Rakefile
@@ -6,18 +6,17 @@ DOCKER_COMPOSE='compose.test.yml'
|
|||||||
|
|
||||||
desc 'iniciar entorno'
|
desc 'iniciar entorno'
|
||||||
task :up do
|
task :up do
|
||||||
compose('up', '--build', '-d', compose: 'compose.test.yml')
|
compose('up', '--build', '-d')
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'poblar entorno'
|
desc 'poblar entorno'
|
||||||
task :init => [:up] do
|
task :init => [:up] do
|
||||||
compose('exec', 'test.dev', 'pip3 install psycopg2 flake8 trytond==7.0.0')
|
compose('exec', 'app.dev', "bash .dev/install_module.sh")
|
||||||
compose('exec', 'test.dev', "bash .dev/install_module.sh")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'terminal'
|
desc 'terminal'
|
||||||
task :sh do
|
task :sh do
|
||||||
compose('exec', 'test.dev', 'bash')
|
compose('exec', 'app.dev', 'bash')
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'iterar'
|
desc 'iterar'
|
||||||
@@ -27,23 +26,18 @@ task :tdd, [:name] do |_, args|
|
|||||||
test_dir = ''
|
test_dir = ''
|
||||||
if args.name
|
if args.name
|
||||||
test_dir = "modules/#{args.name}"
|
test_dir = "modules/#{args.name}"
|
||||||
compose('exec', 'test.dev', "bash -c 'cd #{test_dir} && flake8'")
|
compose('exec', 'app.dev', "bash -c 'cd #{test_dir} && flake8'")
|
||||||
compose('exec', 'test.dev', "bash -c 'cd #{test_dir}/tests && python3 -m unittest'")
|
compose('exec', 'app.dev', "bash -c 'cd #{test_dir}/tests && python3 -m unittest'")
|
||||||
else
|
else
|
||||||
compose('exec', 'test.dev', "bash -c 'cd modules && flake8 *'")
|
compose('exec', 'app.dev', "bash -c 'cd modules && flake8 *'")
|
||||||
compose('exec', 'test.dev', "bash -c 'python -m unittest discover -s modules'")
|
compose('exec', 'app.dev', "bash -c 'python -m unittest discover -s modules'")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'detener entorno'
|
desc 'detener entorno'
|
||||||
task :down do
|
task :down do
|
||||||
compose('down', compose: 'compose.test.yml')
|
compose('down')
|
||||||
end
|
|
||||||
|
|
||||||
desc 'eliminar entorno'
|
|
||||||
task :del do
|
|
||||||
compose('down', '-v', '--rmi', 'all', compose: 'compose.test.yml')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'entorno vivo'
|
desc 'entorno vivo'
|
||||||
@@ -51,38 +45,22 @@ namespace :live do
|
|||||||
|
|
||||||
desc 'iniciar entorno'
|
desc 'iniciar entorno'
|
||||||
task :up do
|
task :up do
|
||||||
compose('up', '--build', '-d', compose: 'compose.live.yml')
|
compose('up', '--build', '-d', compose: 'compose.yml')
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'monitorear salida'
|
desc 'monitorear salida'
|
||||||
task :tail do
|
task :tail do
|
||||||
compose('logs', '-f', 'live.dev', compose: 'compose.live.yml')
|
compose('logs', '-f', 'live.dev', compose: 'compose.yml')
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'monitorear salida'
|
|
||||||
task :tail_end do
|
|
||||||
compose('logs', '-f', '-n 50', 'live.dev', compose: 'compose.live.yml')
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
desc 'detener entorno'
|
desc 'detener entorno'
|
||||||
task :down do
|
task :down do
|
||||||
compose('down', compose: 'compose.live.yml')
|
compose('down', compose: 'compose.yml')
|
||||||
end
|
|
||||||
|
|
||||||
desc 'detener entorno'
|
|
||||||
task :stop do
|
|
||||||
compose('stop', compose: 'compose.live.yml')
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'eliminar entorno'
|
|
||||||
task :del do
|
|
||||||
compose('down', '-v', '--rmi', 'all', compose: 'compose.live.yml')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'reiniciar entorno'
|
desc 'reiniciar entorno'
|
||||||
task :restart do
|
task :restart do
|
||||||
compose('restart', compose: 'compose.live.yml')
|
compose('restart', compose: 'compose.yml')
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'terminal'
|
desc 'terminal'
|
||||||
@@ -149,7 +127,6 @@ namespace :deploy do
|
|||||||
task :top do
|
task :top do
|
||||||
compose('top', compose: 'docker-compose.yml')
|
compose('top', compose: 'docker-compose.yml')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -170,7 +147,7 @@ def refresh_cache
|
|||||||
if try_fossil
|
if try_fossil
|
||||||
changes = %x{fossil diff}.split("\n").grep(/^[-+]/)
|
changes = %x{fossil diff}.split("\n").grep(/^[-+]/)
|
||||||
elsif try_git
|
elsif try_git
|
||||||
changes = %x{git diff}.split("\n").grep(/^[-+]/)
|
changes = %x{git diff -- '*.xml' ':!*view*'}.split("\n").grep(/^[-+index]/)
|
||||||
else
|
else
|
||||||
warn <<WARN
|
warn <<WARN
|
||||||
no se detecta repositorio en control de versiones, debe manualmente
|
no se detecta repositorio en control de versiones, debe manualmente
|
||||||
@@ -184,7 +161,7 @@ WARN
|
|||||||
end
|
end
|
||||||
|
|
||||||
def refresh_trytond_cache(changes)
|
def refresh_trytond_cache(changes)
|
||||||
num = changes.grep(/fields/).length
|
num = changes.grep(//).length
|
||||||
hash = Digest::MD5.hexdigest(changes.flatten.join(''))
|
hash = Digest::MD5.hexdigest(changes.flatten.join(''))
|
||||||
|
|
||||||
# touch
|
# touch
|
||||||
@@ -194,7 +171,7 @@ def refresh_trytond_cache(changes)
|
|||||||
tdd_cache = cache.read()
|
tdd_cache = cache.read()
|
||||||
|
|
||||||
if num > 0 && (tdd_cache != hash)
|
if num > 0 && (tdd_cache != hash)
|
||||||
compose('exec', 'test.dev', 'bash -c "rm -f /tmp/*.dump"')
|
compose('exec', 'app.dev', 'bash -c "rm -f /tmp/*.dump"')
|
||||||
cache.seek(0); cache.write(hash)
|
cache.seek(0); cache.write(hash)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
401715
common_password.txt
401715
common_password.txt
File diff suppressed because one or more lines are too long
0
compose.deploy.yml
Normal file
0
compose.deploy.yml
Normal file
@@ -1,11 +1,16 @@
|
|||||||
version: '3.9'
|
version: '3.9'
|
||||||
services:
|
services:
|
||||||
test.dev:
|
app.dev:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile_test
|
dockerfile: Dockerfile_Test
|
||||||
args:
|
args:
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||||
|
GITEA_USER: ${GITEA_USER}
|
||||||
|
GITEA_PASSWORD: ${GITEA_PASSWORD}
|
||||||
|
GITEA_DOMAIN: ${GITEA_DOMAIN}
|
||||||
|
FACHO: ${FACHO}
|
||||||
|
FACHO_BRANCH: ${FACHO_BRANCH}
|
||||||
environment:
|
environment:
|
||||||
SRC: /app
|
SRC: /app
|
||||||
DB_CACHE: /tmp
|
DB_CACHE: /tmp
|
||||||
@@ -14,6 +19,6 @@ services:
|
|||||||
command: sleep 10h
|
command: sleep 10h
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
working_dir: /app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
working_dir: /app
|
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ services:
|
|||||||
live.dev:
|
live.dev:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
args:
|
||||||
|
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||||
|
GITEA_USER: ${GITEA_USER}
|
||||||
|
GITEA_PASSWORD: ${GITEA_PASSWORD}
|
||||||
|
GITEA_DOMAIN: ${GITEA_DOMAIN}
|
||||||
|
FACHO: ${FACHO}
|
||||||
|
FACHO_BRANCH: ${FACHO_BRANCH}
|
||||||
depends_on:
|
depends_on:
|
||||||
- db.dev
|
- db.dev
|
||||||
command: bash .dev/run.sh
|
command: bash .dev/run.sh
|
||||||
@@ -19,7 +26,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
ports:
|
ports:
|
||||||
- "${TRYTON_PORT_LIVE:-28000}:8000"
|
- "${TRYTON_PORT:-8000}:8000"
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
sale_one_click
|
|
||||||
sale_printer
|
|
||||||
electronic_mail_imap
|
|
||||||
patches
|
|
||||||
sale
|
|
||||||
purchase
|
|
||||||
product
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
hostname:
|
|
||||||
${DB_HOSTNAME}
|
|
||||||
volumes:
|
|
||||||
- postgres:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
|
||||||
tryton:
|
|
||||||
build:
|
|
||||||
context: ./
|
|
||||||
dockerfile: Dockerfile_Deploy
|
|
||||||
args:
|
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
|
||||||
PYTHON_VERSION: ${PYTHON_VERSION}
|
|
||||||
Provider: ${Provider}
|
|
||||||
URL_MULTI_MIGRATE: ${URL_MULTI_MIGRATE}
|
|
||||||
GITEA_DOMAIN: ${GITEA_DOMAIN}
|
|
||||||
GITEA_USER: ${GITEA_USER}
|
|
||||||
GITEA_PASSWORD: ${GITEA_PASSWORD}
|
|
||||||
GITEA_ACCESS_TOKEN: ${GITEA_ACCESS_TOKEN}
|
|
||||||
DIR_MODULES: ${DIR_MODULES}
|
|
||||||
WORKER: ${WORKER}
|
|
||||||
TRYTONPASSFILE: ${TRYTONPASSFILE}
|
|
||||||
SMTP: ${SMTP}
|
|
||||||
SMTP_TYPE: ${SMTP_TYPE}
|
|
||||||
SMTP_USER: ${SMTP_USER}
|
|
||||||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
|
||||||
SMTP_DOMAIN: ${SMTP_DOMAIN}
|
|
||||||
SMTP_PORT: ${SMTP_PORT}
|
|
||||||
SMTP_FROM: ${SMTP_FROM}
|
|
||||||
SMTP_EMAIL: ${SMTP_EMAIL}
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
healthcheck:
|
|
||||||
test: curl --fail localhost:8000 || exit 1
|
|
||||||
interval: 30s
|
|
||||||
retries: 5
|
|
||||||
start_period: 30s
|
|
||||||
timeout: 20s
|
|
||||||
ports:
|
|
||||||
- "${TRYTON_PORT:-8000}:8000"
|
|
||||||
volumes:
|
|
||||||
- modules:${DIR_MODULES}
|
|
||||||
- var:/var
|
|
||||||
- attachment:/mnt/attachment
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
nginx:
|
|
||||||
image: nginx:1.23.3
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
|
||||||
ports:
|
|
||||||
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
depends_on:
|
|
||||||
- tryton
|
|
||||||
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
|
||||||
tryton_worker:
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
depends_on:
|
|
||||||
tryton:
|
|
||||||
condition: service_healthy
|
|
||||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"]
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
tryton_cron:
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
depends_on:
|
|
||||||
tryton:
|
|
||||||
condition: service_healthy
|
|
||||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"]
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
volumes:
|
|
||||||
modules:
|
|
||||||
var:
|
|
||||||
postgres:
|
|
||||||
attachment:
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
: ${DB_USER:=${POSTGRES_ENV_POSTGRES_USER:='postgres'}}
|
|
||||||
: ${DB_PASSWORD:=${POSTGRES_ENV_POSTGRES_PASSWORD}}
|
|
||||||
: ${DB_HOSTNAME:=${POSTGRES_PORT_5432_TCP_ADDR:='postgres'}}
|
|
||||||
: ${DB_PORT:=${POSTGRES_PORT_5432_TCP_PORT:='5432'}}
|
|
||||||
: ${TRYTOND_DATABASE_URI:="postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}/"}
|
|
||||||
: ${PYTHONOPTIMIZE:=1}
|
|
||||||
|
|
||||||
export TRYTOND_DATABASE_URI PYTHONOPTIMIZE
|
|
||||||
|
|
||||||
if [ "${1:0:1}" = '-' ]; then
|
|
||||||
set -- uwsgi --ini /etc/uwsgi.conf "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
||||||
@@ -22,7 +22,8 @@ parser.add_argument(
|
|||||||
nargs='+', # Permitir múltiples valores
|
nargs='+', # Permitir múltiples valores
|
||||||
type=str,
|
type=str,
|
||||||
choices=empresas_permitidos,
|
choices=empresas_permitidos,
|
||||||
help='Empresas (debe elegir algunas de de las siguientes: OneTeam, NaNtic, Tekopora)')
|
help='Empresas (debe elegir algunas de de las siguientes: OneTeam, NaNtic)'
|
||||||
|
)
|
||||||
|
|
||||||
# Parsear los argumentos de la línea de comandos
|
# Parsear los argumentos de la línea de comandos
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@@ -39,8 +40,9 @@ PREFIX_ORG = {'NaNtic': 'trytond-',
|
|||||||
'OneTeam': 'trytondo-',
|
'OneTeam': 'trytondo-',
|
||||||
'Trytond': 'trytond'}
|
'Trytond': 'trytond'}
|
||||||
|
|
||||||
with open('deployes/modules.txt', 'r') as file_txt:
|
with open('sets/modules.txt', 'r') as file_txt:
|
||||||
selected_modules: list = [m.replace('\n', '')
|
selected_modules: list = [
|
||||||
|
m.replace('\n', '')
|
||||||
for m in file_txt.readlines()]
|
for m in file_txt.readlines()]
|
||||||
file_txt.close()
|
file_txt.close()
|
||||||
|
|
||||||
@@ -54,7 +56,6 @@ try:
|
|||||||
|
|
||||||
for modulo in list_modules:
|
for modulo in list_modules:
|
||||||
if modulo in selected_modules:
|
if modulo in selected_modules:
|
||||||
|
|
||||||
PREFIX = PREFIX_ORG[empresa]
|
PREFIX = PREFIX_ORG[empresa]
|
||||||
link_module = f'{URL_GITEA}{empresa}/{PREFIX}{modulo}'
|
link_module = f'{URL_GITEA}{empresa}/{PREFIX}{modulo}'
|
||||||
|
|
||||||
|
|||||||
19
nginx.conf
19
nginx.conf
@@ -1,19 +0,0 @@
|
|||||||
server {
|
|
||||||
server_name ${SERVER_NAME};
|
|
||||||
listen ${NGINX_PORT};
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
send_timeout 500s;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://tryton:8000/; # "trytond" is the service name of another Docker container on port 8000
|
|
||||||
proxy_read_timeout 500;
|
|
||||||
proxy_connect_timeout 500;
|
|
||||||
proxy_send_timeout 500;
|
|
||||||
proxy_set_header Host ${VARIABLE}host;
|
|
||||||
proxy_set_header X-Real-IP ${VARIABLE}remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For ${VARIABLE}proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Host ${VARIABLE}server_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
4
production/entrypoint.sh
Normal file
4
production/entrypoint.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
19
production/nginx.conf
Normal file
19
production/nginx.conf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
server {
|
||||||
|
server_name ${SERVER_NAME};
|
||||||
|
listen ${NGINX_PORT};
|
||||||
|
client_max_body_size 50M;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
send_timeout 300s;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://tryton:8000/; # "trytond" is the service name of another Docker container on port 8000
|
||||||
|
proxy_read_timeout 300;
|
||||||
|
proxy_connect_timeout 300;
|
||||||
|
proxy_send_timeout 300;
|
||||||
|
proxy_set_header Host ${INIT_VAR_NAME}host;
|
||||||
|
proxy_set_header X-Real-IP ${INIT_VAR_NAME}remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For ${INIT_VAR_NAME}proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host ${INIT_VAR_NAME}server_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
production/start.sh
Normal file
21
production/start.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -s /etc/trytond_populate.conf ]; then
|
||||||
|
if [ "$DEVELOP" == "True" ]; then
|
||||||
|
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf
|
||||||
|
else
|
||||||
|
uwsgi --ini /etc/uwsgi.conf
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
sleep $SLEEP_TRYTOND_ADMIN &&
|
||||||
|
echo $TRYTONADMINPASS > $TRYTONPASSFILE
|
||||||
|
if [ "$Provider" == "Kalenis" ]; then
|
||||||
|
trytond-admin -c /etc/trytond.conf -d $POSTGRES_DB --all --email $EMAIL -u user_view -vv
|
||||||
|
else
|
||||||
|
trytond-admin -c /etc/trytond.conf -d $POSTGRES_DB --all --email $EMAIL -vv
|
||||||
|
fi
|
||||||
|
echo "1" > /etc/trytond_populate.conf &&
|
||||||
|
/bin/bash /opt/start.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
7
production/trytond.conf
Normal file
7
production/trytond.conf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[web]
|
||||||
|
listen=0.0.0.0:8000
|
||||||
|
root=/var/lib/trytond/www
|
||||||
|
|
||||||
|
[database]
|
||||||
|
list=False
|
||||||
|
path=/mnt/attachment
|
||||||
52
sets/deploy_tpv.txt
Normal file
52
sets/deploy_tpv.txt
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
account
|
||||||
|
account_co_co
|
||||||
|
account_co_pyme
|
||||||
|
account_co_reports
|
||||||
|
account_exo
|
||||||
|
account_invoice
|
||||||
|
account_invoice_discount
|
||||||
|
account_invoice_facho
|
||||||
|
account_invoice_stock
|
||||||
|
account_invoice_subtype
|
||||||
|
account_product
|
||||||
|
account_statement
|
||||||
|
account_stock_continental
|
||||||
|
analytic_account
|
||||||
|
analytic_account_co
|
||||||
|
analytic_invoice
|
||||||
|
analytic_operations
|
||||||
|
analytic_purchase
|
||||||
|
analytic_sale
|
||||||
|
bank
|
||||||
|
company
|
||||||
|
country
|
||||||
|
currency
|
||||||
|
notification_email
|
||||||
|
party
|
||||||
|
party_customer
|
||||||
|
product
|
||||||
|
product_image
|
||||||
|
production
|
||||||
|
product_price_list
|
||||||
|
purchase
|
||||||
|
purchase_discount
|
||||||
|
purchase_facho
|
||||||
|
purchase_one_click
|
||||||
|
purchase_request
|
||||||
|
sale
|
||||||
|
sale_discount
|
||||||
|
sale_facho
|
||||||
|
sale_fast_food
|
||||||
|
sale_invoice_grouping
|
||||||
|
sale_one_click
|
||||||
|
sale_payment
|
||||||
|
sale_pos
|
||||||
|
sale_pos_extras
|
||||||
|
sale_pos_table
|
||||||
|
sale_price_list
|
||||||
|
sale_printer
|
||||||
|
sale_shop
|
||||||
|
sale_supply
|
||||||
|
sale_supply_production
|
||||||
|
sale_w_tax
|
||||||
|
stock
|
||||||
14
sets/modules.txt
Normal file
14
sets/modules.txt
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
account_co_co
|
||||||
|
account_co_pyme
|
||||||
|
account_co_reports
|
||||||
|
account_exo
|
||||||
|
account_invoice_facho
|
||||||
|
account_invoice_subtype
|
||||||
|
account_stock_continental
|
||||||
|
purchase
|
||||||
|
purchase_facho
|
||||||
|
sale
|
||||||
|
sale_price_list
|
||||||
|
sale_shop
|
||||||
|
sale_facho
|
||||||
|
notification_email
|
||||||
32
start.sh
32
start.sh
@@ -1,32 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ -s /etc/trytond_populate.conf ]; then
|
|
||||||
if [ "$DEVELOP" == "True" ]; then
|
|
||||||
if [ "$WORKER" == "True" ]; then
|
|
||||||
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf
|
|
||||||
#trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf &
|
|
||||||
#trytond-worker -c /etc/trytond.conf -d miac --dev --logconf /etc/trytond_worker_logging.conf
|
|
||||||
else
|
|
||||||
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf
|
|
||||||
#trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf
|
|
||||||
fi
|
|
||||||
elif [ "$WORKER" == "True" ]; then
|
|
||||||
#trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf &
|
|
||||||
#trytond-worker -c /etc/trytond.conf -d miac --logconf /etc/trytond_worker_logging.conf &
|
|
||||||
uwsgi --ini /etc/uwsgi.conf
|
|
||||||
else
|
|
||||||
uwsgi --ini /etc/uwsgi.conf
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
sleep $SLEEP_TRYTOND_ADMIN &&
|
|
||||||
echo $TRYTONADMINPASS > $TRYTONPASSFILE
|
|
||||||
if [ "$Provider" == "Kalenis" ]; then
|
|
||||||
trytond-admin -c /etc/trytond.conf -d $POSTGRES_DB --all --email $EMAIL -u user_view -vv
|
|
||||||
else
|
|
||||||
trytond-admin -c /etc/trytond.conf -d $POSTGRES_DB --all --email $EMAIL -vv
|
|
||||||
fi
|
|
||||||
echo "1" > /etc/trytond_populate.conf &&
|
|
||||||
/bin/bash /opt/start.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,561 +0,0 @@
|
|||||||
#!/usr/bin/bash
|
|
||||||
gitea_url="https://${GITEA_USER}:${GITEA_PASSWORD}@${GITEA_DOMAIN}/"
|
|
||||||
|
|
||||||
cd /tmp
|
|
||||||
git clone ${URL_MULTI_MIGRATE}
|
|
||||||
multi_migrate="/tmp/oc-multi_migrate_to_gitea/migrate_to_gitea.py"
|
|
||||||
cd ${DIR_MODULES}
|
|
||||||
PYTHON_VERSION="python"${PYTHON_VERSION}
|
|
||||||
|
|
||||||
if [ "$WORKER" == "True" ]; then
|
|
||||||
cat <<EOF >>/etc/trytond.conf
|
|
||||||
|
|
||||||
|
|
||||||
[queue]
|
|
||||||
worker = True
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$SMTP" == "True" ]; then
|
|
||||||
cat <<EOF >>/etc/trytond.conf
|
|
||||||
|
|
||||||
[email]
|
|
||||||
uri = ${SMTP_TYPE}://${SMTP_USER}:${SMTP_PASSWORD}@${SMTP_DOMAIN}:${SMTP_PORT}
|
|
||||||
from = ${SMTP_FROM} <${SMTP_EMAIL}>
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
clone_module() {
|
|
||||||
cd ${DIR_MODULES}
|
|
||||||
local org=$1
|
|
||||||
local branch=$2
|
|
||||||
local prefix=$3
|
|
||||||
shift
|
|
||||||
local Array=("${@}")
|
|
||||||
url=${gitea_url}${org}"/"
|
|
||||||
for module in "${Array[@]}"; do
|
|
||||||
if [ ${prefix} = 'False' ]; then
|
|
||||||
if [ ${branch} != "False" ]; then
|
|
||||||
if [ -d $module ]; then
|
|
||||||
echo "Module $module already exists"
|
|
||||||
else
|
|
||||||
git clone -b ${branch} $url$module
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elif [ `echo $module | awk /${prefix}/` ]; then
|
|
||||||
name=`echo $modules$module | cut --complement -f 1 -d '-'`
|
|
||||||
if [ ${branch} != "False" ]; then
|
|
||||||
if [ -d $module ]; then
|
|
||||||
echo "Module $module already exists"
|
|
||||||
else
|
|
||||||
git clone -b ${branch} $url$module
|
|
||||||
mv $module $name
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
git clone $url$module
|
|
||||||
cd $module
|
|
||||||
${PYTHON_VERSION} setup.py install
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inactive_module() {
|
|
||||||
cd ${DIR_MODULES}
|
|
||||||
local prefix=$1
|
|
||||||
local pip=$2
|
|
||||||
shift
|
|
||||||
local Array=("${@}")
|
|
||||||
for module in "${Array[@]}"; do
|
|
||||||
if [ $pip = "True" ]; then
|
|
||||||
pip uninstall -y $prefix$module --break-system-packages
|
|
||||||
rm -rf $module
|
|
||||||
else
|
|
||||||
rm -rf $module
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "OneTeam" ]; then
|
|
||||||
pip="True"
|
|
||||||
|
|
||||||
inactive_modules_trytondo=(
|
|
||||||
account
|
|
||||||
account_asset
|
|
||||||
account_be
|
|
||||||
account_budget
|
|
||||||
account_cash_rounding
|
|
||||||
account_consolidation
|
|
||||||
account_credit_limit
|
|
||||||
account_deposit
|
|
||||||
account_de_skr03
|
|
||||||
account_dunning
|
|
||||||
account_dunning_email
|
|
||||||
account_dunning_fee
|
|
||||||
account_dunning_letter
|
|
||||||
account_es
|
|
||||||
account_es_sii
|
|
||||||
account_eu
|
|
||||||
account_fr
|
|
||||||
account_fr_chorus
|
|
||||||
account_invoice
|
|
||||||
account_invoice_correction
|
|
||||||
account_invoice_defer
|
|
||||||
account_invoice_history
|
|
||||||
account_invoice_line_standalone
|
|
||||||
account_invoice_secondary_unit
|
|
||||||
account_invoice_stock
|
|
||||||
account_invoice_watermark
|
|
||||||
account_move_line_grouping
|
|
||||||
account_payment
|
|
||||||
account_payment_braintree
|
|
||||||
account_payment_clearing
|
|
||||||
account_payment_sepa
|
|
||||||
account_payment_sepa_cfonb
|
|
||||||
account_payment_stripe
|
|
||||||
account_product
|
|
||||||
account_receivable_rule
|
|
||||||
account_rule
|
|
||||||
account_statement
|
|
||||||
account_statement_aeb43
|
|
||||||
account_statement_coda
|
|
||||||
account_statement_mt940
|
|
||||||
account_statement_ofx
|
|
||||||
account_statement_rule
|
|
||||||
account_statement_sepa
|
|
||||||
account_stock_anglo_saxon
|
|
||||||
account_stock_continental
|
|
||||||
account_stock_eu
|
|
||||||
account_stock_landed_cost
|
|
||||||
account_stock_landed_cost_weight
|
|
||||||
account_stock_shipment_cost
|
|
||||||
account_stock_shipment_cost_weight
|
|
||||||
account_tax_cash
|
|
||||||
account_tax_non_deductible
|
|
||||||
account_tax_rule_country
|
|
||||||
analytic_account
|
|
||||||
analytic_budget
|
|
||||||
analytic_invoice
|
|
||||||
analytic_purchase
|
|
||||||
analytic_sale
|
|
||||||
attendance
|
|
||||||
authentication_saml
|
|
||||||
authentication_sms
|
|
||||||
bank
|
|
||||||
carrier
|
|
||||||
carrier_carriage
|
|
||||||
carrier_percentage
|
|
||||||
carrier_subdivision
|
|
||||||
carrier_weight
|
|
||||||
commission
|
|
||||||
commission_waiting
|
|
||||||
company
|
|
||||||
company_work_time
|
|
||||||
currency
|
|
||||||
currency_ro
|
|
||||||
currency_rs
|
|
||||||
customs
|
|
||||||
dashboard
|
|
||||||
document_incoming
|
|
||||||
document_incoming_invoice
|
|
||||||
document_incoming_ocr
|
|
||||||
document_incoming_ocr_typless
|
|
||||||
edocument_uncefact
|
|
||||||
edocument_unece
|
|
||||||
google_maps
|
|
||||||
inbound_email
|
|
||||||
incoterm
|
|
||||||
ldap_authentication
|
|
||||||
marketing
|
|
||||||
marketing_automation
|
|
||||||
marketing_campaign
|
|
||||||
marketing_email
|
|
||||||
party
|
|
||||||
party_avatar
|
|
||||||
party_relationship
|
|
||||||
party_siret
|
|
||||||
product
|
|
||||||
product_attribute
|
|
||||||
product_classification
|
|
||||||
product_classification_taxonomic
|
|
||||||
product_cost_fifo
|
|
||||||
product_cost_history
|
|
||||||
product_cost_warehouse
|
|
||||||
product_image
|
|
||||||
product_image_attribute
|
|
||||||
production
|
|
||||||
production_outsourcing
|
|
||||||
production_routing
|
|
||||||
production_split
|
|
||||||
production_work
|
|
||||||
production_work_timesheet
|
|
||||||
product_kit
|
|
||||||
product_measurements
|
|
||||||
product_price_list
|
|
||||||
product_price_list_cache
|
|
||||||
product_price_list_dates
|
|
||||||
product_price_list_parent
|
|
||||||
project
|
|
||||||
project_invoice
|
|
||||||
project_plan
|
|
||||||
project_revenue
|
|
||||||
purchase
|
|
||||||
purchase_amendment
|
|
||||||
purchase_blanket_agreement
|
|
||||||
purchase_history
|
|
||||||
purchase_invoice_line_standalone
|
|
||||||
purchase_price_list
|
|
||||||
purchase_product_quantity
|
|
||||||
purchase_request
|
|
||||||
purchase_request_quotation
|
|
||||||
purchase_requisition
|
|
||||||
purchase_secondary_unit
|
|
||||||
purchase_shipment_cost
|
|
||||||
quality
|
|
||||||
sale
|
|
||||||
sale_advance_payment
|
|
||||||
sale_amendment
|
|
||||||
sale_blanket_agreement
|
|
||||||
sale_complaint
|
|
||||||
sale_credit_limit
|
|
||||||
sale_discount
|
|
||||||
sale_extra
|
|
||||||
sale_gift_card
|
|
||||||
sale_history
|
|
||||||
sale_invoice_date
|
|
||||||
sale_invoice_grouping
|
|
||||||
sale_opportunity
|
|
||||||
sale_payment
|
|
||||||
sale_point
|
|
||||||
sale_price_list
|
|
||||||
sale_product_customer
|
|
||||||
sale_product_quantity
|
|
||||||
sale_product_recommendation
|
|
||||||
sale_product_recommendation_association_rule
|
|
||||||
sale_promotion
|
|
||||||
sale_promotion_coupon
|
|
||||||
sale_promotion_coupon_payment
|
|
||||||
sale_secondary_unit
|
|
||||||
sale_shipment_cost
|
|
||||||
sale_shipment_grouping
|
|
||||||
sale_shipment_tolerance
|
|
||||||
sale_stock_quantity
|
|
||||||
sale_subscription
|
|
||||||
sale_subscription_asset
|
|
||||||
sale_supply
|
|
||||||
sale_supply_drop_shipment
|
|
||||||
sale_supply_production
|
|
||||||
stock
|
|
||||||
stock_assign_manual
|
|
||||||
stock_consignment
|
|
||||||
stock_forecast
|
|
||||||
stock_inventory_location
|
|
||||||
stock_location_move
|
|
||||||
stock_location_sequence
|
|
||||||
stock_lot
|
|
||||||
stock_lot_sled
|
|
||||||
stock_lot_unit
|
|
||||||
stock_package
|
|
||||||
stock_package_shipping
|
|
||||||
stock_package_shipping_dpd
|
|
||||||
stock_package_shipping_mygls
|
|
||||||
stock_package_shipping_sendcloud
|
|
||||||
stock_package_shipping_ups
|
|
||||||
stock_product_location
|
|
||||||
stock_quantity_early_planning
|
|
||||||
stock_quantity_issue
|
|
||||||
stock_secondary_unit
|
|
||||||
stock_shipment_cost
|
|
||||||
stock_shipment_cost_weight
|
|
||||||
stock_shipment_measurements
|
|
||||||
stock_split
|
|
||||||
stock_supply
|
|
||||||
stock_supply_day
|
|
||||||
stock_supply_forecast
|
|
||||||
stock_supply_production
|
|
||||||
timesheet
|
|
||||||
timesheet_cost
|
|
||||||
user_role
|
|
||||||
web_shop
|
|
||||||
web_shop_shopify
|
|
||||||
web_shop_vue_storefront
|
|
||||||
web_shop_vue_storefront_stripe
|
|
||||||
web_shortener
|
|
||||||
web_user
|
|
||||||
)
|
|
||||||
|
|
||||||
inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "OneTeam_Pos" ]; then
|
|
||||||
apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
git \
|
|
||||||
pkg-config \
|
|
||||||
libxml2-dev \
|
|
||||||
libxmlsec1-dev \
|
|
||||||
libxmlsec1-openssl \
|
|
||||||
libffi-dev \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
python3-qrcode \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt \
|
|
||||||
&& pip3 install "git+https://git.disroot.org/OneTeam/facho.git@documento_soporte" \
|
|
||||||
&& cd ${DIR_MODULES}
|
|
||||||
|
|
||||||
prefix="trytondo-"
|
|
||||||
team_org="OneTeam"
|
|
||||||
pip="False"
|
|
||||||
get_one_team=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
|
|
||||||
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_one_team[@]}"
|
|
||||||
|
|
||||||
inactive_modules_trytondo=(
|
|
||||||
purchase_coffee
|
|
||||||
sale_payment
|
|
||||||
)
|
|
||||||
|
|
||||||
inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"
|
|
||||||
|
|
||||||
modules_nantic=(
|
|
||||||
trytond-sale_w_tax
|
|
||||||
trytond-purchase_discount
|
|
||||||
trytond-sale_w_tax
|
|
||||||
trytond-sale_pos
|
|
||||||
trytond-sale_shop
|
|
||||||
trytond-sale_payment
|
|
||||||
trytond-purchase_discount
|
|
||||||
trytond-account_invoice_discount )
|
|
||||||
clone_module "NaNtic" ${TRYTOND_VERSION} "trytond-" "${modules_nantic[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "Presik" ]; then
|
|
||||||
prefix="trytonpsk-"
|
|
||||||
team_org="Presik"
|
|
||||||
pip="True"
|
|
||||||
pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt
|
|
||||||
get_presik=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org ${Provider} --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
|
|
||||||
clone_module $Provider "False" $prefix "${get_presik[@]}"
|
|
||||||
inactive_modules_presik=(
|
|
||||||
document
|
|
||||||
document_collection
|
|
||||||
document_expiration
|
|
||||||
document_communication
|
|
||||||
staff_document
|
|
||||||
staff_document_alert
|
|
||||||
sale_pos_frontend
|
|
||||||
sale_pos_frontend_rest
|
|
||||||
sale_pos_commission
|
|
||||||
maintenance-indicators
|
|
||||||
health
|
|
||||||
health_ambulance
|
|
||||||
health_calendar
|
|
||||||
health_co
|
|
||||||
health_functional
|
|
||||||
health_gloss
|
|
||||||
health_gyneco
|
|
||||||
health_history
|
|
||||||
health_icd10
|
|
||||||
health_inpatient
|
|
||||||
health_lab
|
|
||||||
health_lifestyle
|
|
||||||
health_nursing
|
|
||||||
health_optometry
|
|
||||||
health_orthanc
|
|
||||||
health_pediatrics
|
|
||||||
health_services
|
|
||||||
health_socioeconomics
|
|
||||||
health_stock
|
|
||||||
health_who_essential_medicines
|
|
||||||
smtp
|
|
||||||
sms
|
|
||||||
)
|
|
||||||
inactive_module $prefix $pip "${inactive_modules_presik[@]}"
|
|
||||||
|
|
||||||
modules_nantic=(trytond-smtp)
|
|
||||||
clone_module "NaNtic" ${TRYTOND_VERSION} "trytond-" "${modules_nantic[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "Datalife" ]; then
|
|
||||||
prefix="trytond-"
|
|
||||||
team_org="Datalife"
|
|
||||||
pip="False"
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
libffi-dev \
|
|
||||||
&& pip3 uninstall -y trytond-incoterm \
|
|
||||||
&& cd /usr/local \
|
|
||||||
&& git clone -b main https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/NaNtic/python-edifact.git \
|
|
||||||
&& cd python-edifact \
|
|
||||||
&& ${PYTHON_VERSION} setup.py install \
|
|
||||||
&& cd /usr/local \
|
|
||||||
&& git clone -b ${TRYTOND_VERSION} https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/Datalife/tryton_replication.git \
|
|
||||||
&& cd tryton_replication \
|
|
||||||
&& ${PYTHON_VERSION} setup.py install \
|
|
||||||
&& cd /usr/local \
|
|
||||||
&& git clone -b ${TRYTOND_VERSION} https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/Datalife/tryton_rpc.git \
|
|
||||||
&& cd tryton_rpc \
|
|
||||||
&& ${PYTHON_VERSION} setup.py install \
|
|
||||||
&& cd $DIR_MODULES \
|
|
||||||
&& rm -rf incoterm \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt
|
|
||||||
|
|
||||||
inactive_modules_trytond=(
|
|
||||||
sale_payment)
|
|
||||||
inactive_module "trytond-" $pip "${inactive_modules_trytond[@]}"
|
|
||||||
|
|
||||||
get_datalife=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
|
|
||||||
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_datalife[@]}"
|
|
||||||
inactive_modules_datalife=(
|
|
||||||
edw_mssql
|
|
||||||
sale_cost_apply_purchase
|
|
||||||
agro_sale_board_harvest_request
|
|
||||||
label_printer
|
|
||||||
stock_label_printer
|
|
||||||
account_payment_confirming_n68
|
|
||||||
electronic_mail_scheduler
|
|
||||||
electronic_mail_wizard )
|
|
||||||
inactive_module $prefix $pip "${inactive_modules_datalife[@]}"
|
|
||||||
|
|
||||||
modules_nantic=(
|
|
||||||
trytond-account_payment_type
|
|
||||||
trytond-company_bank
|
|
||||||
trytond-account_invoice_company_currency
|
|
||||||
trytond-jasper_reports
|
|
||||||
trytond-stock_scanner
|
|
||||||
trytond-stock_valued
|
|
||||||
trytond-stock_kit
|
|
||||||
trytond-sale_kit
|
|
||||||
trytond-account_payment_type
|
|
||||||
trytond-edocument_unedifact
|
|
||||||
trytond-account_move_draft
|
|
||||||
trytond-account_payment_receipt
|
|
||||||
trytond-product_barcode )
|
|
||||||
clone_module "NaNtic" ${TRYTOND_VERSION} $prefix "${modules_nantic[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "NaNtic" ]; then
|
|
||||||
prefix="trytond-"
|
|
||||||
team_org="NaNtic"
|
|
||||||
pip="False"
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
libffi-dev \
|
|
||||||
libldap2-dev \
|
|
||||||
libsasl2-dev \
|
|
||||||
libcups2-dev \
|
|
||||||
libpq-dev \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& cd /opt \
|
|
||||||
&& git clone --branch ${TRYTOND_VERSION} ${gitea_url}${Provider}/tryton-config.git \
|
|
||||||
&& pip3 install -r tryton-config/requirements.txt \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt
|
|
||||||
get_nantic=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $Provider --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
|
|
||||||
clone_module $Provider ${TRYTOND_VERSION} $prefix "${get_nantic[@]}"
|
|
||||||
inactive_modules_nantic=(patches
|
|
||||||
tryton-config
|
|
||||||
)
|
|
||||||
inactive_module $prefix $pip "${inactive_modules_nantic[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "Kalenis" ]; then
|
|
||||||
team_org="kalenis"
|
|
||||||
branch="master"
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
wget \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt \
|
|
||||||
&& git clone -b ${branch} ${gitea_url}${Provider}/kalenislims.git \
|
|
||||||
&& mv kalenislims/lims* ${DIR_MODULES} \
|
|
||||||
&& rm -rf kalenislims \
|
|
||||||
&& git clone -b ${branch} ${gitea_url}${Provider}/kalenis_user_view.git \
|
|
||||||
&& mv kalenis_user_view ${DIR_MODULES}/user_view \
|
|
||||||
&& wget https://downloads.kalenislims.com/frontend_dist_${TRYTOND_VERSION}.tar.gz \
|
|
||||||
&& tar -xzf frontend_dist_${TRYTOND_VERSION}.tar.gz \
|
|
||||||
&& rm -rf /var/lib/trytond/www \
|
|
||||||
&& mv frontend_dist_${TRYTOND_VERSION} /var/lib/trytond/www
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "GnuHealth" ]; then
|
|
||||||
name_tar="gnuhealth-4.0.4"
|
|
||||||
if [ "$TRYTOND_VERSION" == "5.0" ]; then
|
|
||||||
name_tar="gnuhealth-3.8.0"
|
|
||||||
fi
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
wget \
|
|
||||||
libldap2-dev \
|
|
||||||
libsasl2-dev \
|
|
||||||
ldap-utils \
|
|
||||||
tox \
|
|
||||||
lcov \
|
|
||||||
valgrind \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt \
|
|
||||||
&& cd /tmp \
|
|
||||||
&& wget https://ftp.gnu.org/gnu/health/${name_tar}.tar.gz \
|
|
||||||
&& tar -xzf ${name_tar}.tar.gz \
|
|
||||||
&& mv ${name_tar}/health* ${DIR_MODULES} \
|
|
||||||
&& rm -rf ${name_tar}
|
|
||||||
if [ "$TRYTOND_VERSION" == "5.0" ]; then
|
|
||||||
mv ${DIR_MODULES}/health_webdav3_server ${DIR_MODULES}/webdav
|
|
||||||
mv ${DIR_MODULES}/health_caldav ${DIR_MODULES}/calendar
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$Provider" == "Trytonar" ]; then
|
|
||||||
prefix="False"
|
|
||||||
team_org="tryton-ar"
|
|
||||||
pip="False"
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
wget \
|
|
||||||
unzip \
|
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
|
||||||
libxslt-dev \
|
|
||||||
libffi-dev \
|
|
||||||
libssl-dev \
|
|
||||||
swig \
|
|
||||||
unzip \
|
|
||||||
&& cd /opt \
|
|
||||||
&& git clone https://github.com/reingart/pyafipws.git \
|
|
||||||
&& cd pyafipws \
|
|
||||||
&& ${PYTHON_VERSION} setup.py install \
|
|
||||||
&& pip3 install --upgrade pip \
|
|
||||||
&& pip3 install -r /opt/requirements_${Provider}.txt \
|
|
||||||
&& cd ${DIR_MODULES}
|
|
||||||
|
|
||||||
get_trytonar=( `${PYTHON_VERSION} $multi_migrate list-repo-token --domain ${GITEA_DOMAIN} --team_org $team_org --access_token ${GITEA_ACCESS_TOKEN} --verbose True` )
|
|
||||||
clone_module $team_org ${TRYTOND_VERSION} $prefix "${get_trytonar[@]}"
|
|
||||||
inactive_modules_trytonar=(
|
|
||||||
documentacion-tryton-ar
|
|
||||||
tryton-demo-ar
|
|
||||||
tryton-capacitacion-tecnica
|
|
||||||
company_ar_NO_USAR
|
|
||||||
tryton-ar.github.io
|
|
||||||
deploy-localizacion-argentina_DEPRECATE
|
|
||||||
TUBA2015
|
|
||||||
padron_afip_ar_DEPRECATE
|
|
||||||
)
|
|
||||||
inactive_module $prefix $pip "${inactive_modules_trytonar[@]}"
|
|
||||||
fi
|
|
||||||
11
trytond.conf
11
trytond.conf
@@ -1,11 +0,0 @@
|
|||||||
[web]
|
|
||||||
listen=0.0.0.0:8000
|
|
||||||
root=/var/lib/trytond/www
|
|
||||||
|
|
||||||
[database]
|
|
||||||
list=True
|
|
||||||
path=/mnt/attachment
|
|
||||||
lenguage=es
|
|
||||||
|
|
||||||
[password]
|
|
||||||
forbidden=/etc/common_password.txt
|
|
||||||
Reference in New Issue
Block a user