AngelMoya's picture

Based on Tunkey LAPP (http://www.turnkeylinux.org/lapp ) do it a Tryton ERP server.

 

CAUTION: Any PostgreSQL Server must be down when apply the patch!!!

 

Looging

System User:

User: tryton

Password: tryton

Database User:

User: tryton

Passord: tryton

 

What it does:

In conf file

1. Add a system user

/usr/sbin/adduser --quiet --system --group tryton

2. Add a database user

/etc/init.d/postgresql-8.4 stop
/etc/init.d/postgresql-8.4 start

su -c - postgres "createuser tryton --no-superuser --createdb --no-createrole"

#Alter user tryton erp with defined password
cat > /tmp/changepass.sql <<"EOF"
alter user tryton with password '$PASSWVAR';
EOF

su -c - postgres "psql template1 -U postgres -f /tmp/changepass.sql"

/etc/init.d/postgresql-8.4 stop

3. Update services screen

USAGE=/etc/confconsole/services.txt
sed -i -e '6 a Tryton:    $ipaddr:8000' $USAGE
#delete the extra blank line so everything fits on a single screen
sed -i '9 d' $USAGE

4. Update host name

HOSTNAME=tryton
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts

5. Install needed packages

APTSOURCES=/etc/apt/sources.list.d/sources.list

COMMENT=`grep 'lucid multiverse' $APTSOURCES`
UNCOMMENT=$(echo $COMMENT | sed 's|#||')
sed -i "s|$COMMENT|$UNCOMMENT|" $APTSOURCES

apt-get update

apt-get -y install mercurial python2.6  python-ldap libpq-dev python-dev gcc adduser python-dateutil python-genshi python-lxml python-relatorio python-simplejson python-polib python-pkg-resources python-setuptools python-psycopg2 python-yaml python-cairo python-pycha

easy_install psycopg2

easy_install polib

easy_install proteus

6. Download from hg and install trytond

cd /opt
hg clone http://hg.tryton.org/2.4/trytond/

chown -R tryton:tryton /opt/trytond
cd /opt/trytond
python setup.py install

7. Download from hg and install tryton modules

REPO="http://hg.tryton.org/2.4/modules/"

mkdir /opt/tryton_modules

module[0]="account"
module[1]="account_be"
module[2]="account_de_skr03"
module[3]="account_fr"
module[4]="account_invoice"
module[5]="account_invoice_history"
module[6]="account_invoice_line_standalone"
module[7]="account_product"
module[8]="account_statement"
module[9]="account_stock_anglo_saxon"
module[10]="account_stock_continental"
module[11]="analytic_account"
module[12]="analytic_invoice"
module[13]="analytic_purchase"
module[14]="analytic_sale"
module[15]="calendar"
module[16]="calendar_classification"
module[17]="calendar_scheduling"
module[18]="calendar_todo"
module[19]="carrier"
module[20]="carrier_percentage"
module[21]="carrier_weight"
module[22]="company"
module[23]="company_work_time"
module[24]="country"
module[25]="currency"
module[26]="dashboard"
module[27]="google_maps"
module[28]="ldap_authentication"
module[29]="ldap_connection"
module[30]="party"
module[31]="party_siret"
module[32]="party_vcarddav"
module[33]="product"
module[34]="product_cost_fifo"
module[35]="product_cost_history"
module[36]="product_measurements"
module[37]="product_price_list"
module[38]="production"
module[39]="project"
module[40]="project_plan"
module[41]="project_revenue"
module[42]="purchase"
module[43]="purchase_invoice_line_standalone"
module[44]="purchase_shipment_cost"
module[45]="sale"
module[46]="sale_opportunity"
module[47]="sale_price_list"
module[48]="sale_shipment_cost"
module[49]="stock"
module[50]="stock_forecast"
module[51]="stock_inventory_location"
module[52]="stock_location_sequence"
module[53]="stock_lot"
module[54]="stock_product_location"
module[55]="stock_split"
module[56]="stock_supply"
module[57]="stock_supply_day"
module[58]="stock_supply_forecast"
module[59]="stock_supply_production"
module[60]="timesheet"

declare -p module
for  e in ${module[*]}
    do
        cd /opt/tryton_modules        
        hg clone $REPO$e"/"
        chown -R tryton:tryton $e
        cd $e
        python setup.py install
    done

cd /

In overlay path

1. Config: /etc/trytond.conf

2. Defaults: /etc/default/tryton-server

3. Log: /var/log/trytond.log

4. Init: /etc/init.d/trytond

5. First boot script: /usr/lib/inithooks/firtsboot.d/37trytonconf

#!/bin/bash -e
# set tryton owner

chmod +x /etc/init.d/trytond
update-rc.d trytond defaults

chown tryton.tryton /etc/trytond.conf
chmod 644 /etc/trytond.conf

chown tryton.tryton /etc/default/tryton-server
chmod 644 /etc/default/tryton-server

chown tryton.tryton /var/log/trytond.log

mkdir /var/lib/trytond
chown tryton:tryton /var/lib/trytond
Forum: 

Add new comment