add script migration cloud6

This commit is contained in:
wilson gomez 2021-07-21 18:23:50 -05:00
parent d72867d9db
commit 9f70751e63
2 changed files with 279 additions and 3 deletions

View File

@ -17,7 +17,7 @@ DELETE FROM "ir_model_data" WHERE model = 'res.user' AND "fs_id" = 'user_trigger
UPDATE project_work SET status = db_id FROM ir_model_data WHERE module = 'project' AND fs_id = 'work_open_status' AND state = 'opened';
UPDATE project_work SET status = db_id FROM ir_model_data WHERE module = 'project' and fs_id = 'work_done_status' AND state = 'done';
ALTER TABLE sale_amendment_line DROP CONSTRAINT sale_amendment_line_shipment_party_fkey;
@ -39,12 +39,55 @@ DELETE FROM "ir_module" WHERE "name"= 'smtp';
DESPUES
ALTER table ir_sequence_type DROP COLUMN code;
UPDATE account_account_type SET statement='balance' WHERE sequence<30000 and sequence>1;
UPDATE account_account_type SET statement='income' WHERE sequence<80000 and sequence>30000;
UPDATE account_account_type SET revenue='true' WHERE sequence in (44100, 44700, 30100, 45700, 45100);
UPDATE account_account_type SET expense='true' WHERE sequence in (44200, 44300, 44400, 44500, 44600, 30200)
UPDATE account_account_type SET stock='true' WHERE sequence in (11070,
11080,
11090,
11100,
12080,
12090,
12100,
12110,
12120,
12130,
12160
)
UPDATE account_account_type SET payable='true' WHERE sequence in (22101,
22102,
22103,
22104,
22105,
22106,
22107,
22108,
22109,
22110,
22111,
22112,
22113,
22114,
22115,
22201,
22202,
22203,
22204,
22205,
22206,
22207,
22208,
22209,
22210,
22211
)
UPDATE account_account SET party_required=true WHERE code >'37' and type is not null;
UPDATE product_template pt SET code=pp.code FROM product_product pp WHERE pt.id=pp.template;
Hola esta es la nueva version de Tryton ERP 6.0 a partir de hoy, deben descaragarla e instalarla
https://downloads.tryton.org/lts/tryton-64bit-last.exe
pip3 install tryton==6.0.3

233
migrate_cloud6.sh Normal file
View File

@ -0,0 +1,233 @@
#!/bin/sh
#---------------------------------------------------------
# Script Install Tryton for Home Intance
# --------------------------------------------------------
# Main functions/variables declaration
# Colors constants
NONE="$(tput sgr0)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="\n$(tput setaf 3)"
BLUE="\n$(tput setaf 4)"
message () {
# $1 : Message
# $2 : Color
# return : Message colorized
local NOW="[$(date +%H:%M:%S)] "
echo "${2}${NOW}${1}${NONE}"
}
echo '----------------------------------------------------------'
#read -p 'Introduce the tryton name user: ' nameuser
version='6.0'
max_version='6.1'
integer_version='60'
venv='tryton61'
nameuser='psk'
file_bashrc=${HOME}'/.bashrc'
# Install new apt packages
sudo apt install python3-gi-cairo
sudo apt install python-suds
# Create Virtualenv
message "[INFO] Creating virtualenv... $venv " ${BLUE}
python3 -m venv ${HOME}/.virtualenvs/${venv}
source_="\nalias workon61='source ~/.virtualenvs/$venv/bin/activate'"
echo $source_ >> $file_bashrc
message "se realiza source"
message "[INFO] Done." ${YELLOW}
read -p "Was created virtualenv $venv? " response
echo workon61
message "[INFO] Your Virtualenv $venv is ready...!" ${YELLOW}
PYT_CMD=${HOME}/.virtualenvs/${venv}/bin/python3
# Install PIP packages
PIP_CMD=${HOME}/.virtualenvs/${venv}/bin/pip3
message "[INFO] Installing main PIP3 packages..." ${BLUE}
pippackages="
bcrypt
pytz
wrapt
qrcode
cryptography
pyOpenssl
polib
python-stdnum
jinja2
python-sql
zeep
psk_numword
vobject
simpleeval
cached-property
relatorio
chardet
passlib
requests
python-magic
flask==1.1.4
flask_tryton
flask_cors
gunicorn
Werkzeug==1.0.1
psycopg2-binary
psycopg2
psycopg2cffi
wheel
sendgrid
simplejson
pycrypto
pycountry
"
for i in ${pippackages}
do
${PIP_CMD} install $i
done
tryton_modules="
country
party
currency
company
product
stock
account
account_product
account_invoice
account_invoice_history
account_statement
account_invoice_stock
account_asset
bank
account_payment
product_cost_fifo
product_cost_history
product_price_list
product_attribute
stock_forecast
stock_inventory_location
stock_product_location
stock_location_sequence
stock_product_location
purchase
purchase_request
purchase_requisition
purchase_shipment_cost
production
stock_supply
stock_supply_day
stock_supply_forecast
sale
sale_supply
sale_opportunity
sale_price_list
sale_invoice_grouping
sale_credit_limit
analytic_account
analytic_invoice
analytic_purchase
analytic_sale
account_credit_limit
commission
timesheet
company_work_time
project
"
pip3 install trytond==6.0.3
message "[INFO] Installing official Tryton packages..." ${BLUE}
for i in ${tryton_modules}
do
${PIP_CMD} install "trytond_$i"
done
message "[INFO] Done. " ${YELLOW}
message "[INFO] Installing psk Tryton packages..." ${BLUE}
modules="
account_co_pyme
account_col
account_exo
electronic_invoice_co
account_voucher
account_bank_statement
party_personal
company_department
reports
staff
staff_co
staff_event
staff_payroll
staff_payroll_co
staff_contracting
staff_access
staff_access_extratime
sale_goal
invoice_report
account_invoice_update
company_timezone
company_location
stock_duration
account_invoice_discount
product_onebarcode
product_reference
product_image
purchase_discount
purchase_editable_line
sale_discount
sale_shop
sale_salesman
sale_pos
sale_contract
sale_pos_frontend
purchase_report
purchase_suggested
account_invoice_discount
surveillance
email
crm
dash
dash_sale
# dash_stock
sale_web_channel
"
for i in ${modules}
do
git clone https://presik@bitbucket.org/presik/trytonpsk-$i.git
cd trytonpsk-$i
${PYT_CMD} setup.py install
cd ..
done
message "[INFO] Done. " ${YELLOW}
# Changing owner of new virtualenv
message "[INFO] Changing owner of virtualenv... " ${BLUE}
chown $nameuser:$nameuser -R ${HOME}/.virtualenvs/
message "[INFO] Done." ${YELLOW}
#systemctl stop strytond.service
#systemctl disable strytond.service
# Enable:
#systemctl enable strytond.service
# Reboot