Merge remote-tracking branch 'refs/remotes/origin/pr/9'

This commit is contained in:
scith 2016-01-11 20:40:23 +01:00
commit 93a67cd078
3 changed files with 45 additions and 29 deletions

View file

@ -1,3 +1,13 @@
Odoo
----
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an <a href="https://www.odoo.com/page/crm">Open Source CRM</a>, <a href="https://www.odoo.com/page/website-builder">Website Builder</a>, <a href="https://www.odoo.com/page/e-commerce">eCommerce</a>, <a href="https://www.odoo.com/page/project-management">Project Management</a>, <a href="https://www.odoo.com/page/accounting">Billing &amp; Accounting</a>, <a href="https://www.odoo.com/page/point-of-sale">Point of Sale</a>, <a href="https://www.odoo.com/page/employees">Human Resources</a>, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get
a full-featured <a href="https://www.odoo.com">Open Source ERP</a> when you install several Apps.
Odoo for YunoHost
----------------------------
Warning: This YunoHost app is still in development. Use it at your own risk! I am **not** responsible for any data loss that jeopardizes your organization
@ -12,12 +22,24 @@ https://example.com/odoo/ will NOT work
What does not work
------------------
- Automatic database creation (experimental)
- Backup and restore via Odoo (works with a trick shared on the Github)
- Backup and restore via YunoHost
- Automatic database creation
- Automatic LDAP configuration
Still to do
-----------
- Automatic LDAP setup + emails
- Backup/restore via Odoo fix
- Backup/restore via YunoHost
- SMTP settings
Configuration
-------------
**Create the database manually**
- The database must be named "*subdomain-domain-tld*" (for example *erp-test-com* if you access the database via *erp.test.com*
**Setup LDAP**
- Create a user named "template" with email "template". This user will give its permissions by default to YunoHost users so you can also give it appropriate permissions.
- In "Edit Company Data" (on the logo), go to "Configuration" and add a LDAP setting
@ -39,14 +61,3 @@ Configuration
- Go to manage databases and delete the old database
- Restore
- **Important!** The database must be named "*subdomain-domain-tld*" (for example *erp-test-com* if you access the database via *erp.test.com*
Odoo
----
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an <a href="https://www.odoo.com/page/crm">Open Source CRM</a>, <a href="https://www.odoo.com/page/website-builder">Website Builder</a>, <a href="https://www.odoo.com/page/e-commerce">eCommerce</a>, <a href="https://www.odoo.com/page/project-management">Project Management</a>, <a href="https://www.odoo.com/page/accounting">Billing &amp; Accounting</a>, <a href="https://www.odoo.com/page/point-of-sale">Point of Sale</a>, <a href="https://www.odoo.com/page/employees">Human Resources</a>, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get
a full-featured <a href="https://www.odoo.com">Open Source ERP</a> when you install several Apps.

View file

@ -9,6 +9,8 @@ admin_password=$3
database_password=$4
database_lang=$5
# Check domain/path availability
domain=${domain}"/"
sudo yunohost app checkurl $domain -a $app \
@ -46,16 +48,12 @@ else
# Initialize installation
sudo apt-get -y -qq install postgresql
su - postgres -c "createuser -s odoo" 2> /dev/null || true
sudo su - postgres -c "echo \"CREATE USER odoo WITH PASSWORD '$admin_password' CREATEDB;\" | psql" 2> /dev/null || true
sudo apt-get -y -qq install odoo
# Install wkhtmltopdf to print PDF reports
sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
sudo dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
sudo apt-get -y -qq install xfonts-75dpi
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
sudo apt-get -yf -qq install wkhtmltopdf
# Set admin password
sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/openerp-server.conf
@ -66,7 +64,7 @@ else
sudo sed -i "s@'auto_install': False@'auto_install': True@g" /usr/lib/python2.7/dist-packages/openerp/addons/auth_ldap/__openerp__.py
# Install oerplib to manage databases
sudo pip install oerplib
#sudo pip install oerplib
# Add services
sudo yunohost service add postgresql
@ -75,12 +73,21 @@ else
sudo yunohost service start odoo
fi
# Setup database
sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py
sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py
sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py
sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py
sudo python ../conf/install_database.py
function exit_properly
{
set +e
# TODO: uninstall db
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
sudo service nginx reload
exit 1
}
trap exit_properly ERR
# Setup database: not working
#sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py
#sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py
#sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py
#sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py
#sudo python ../conf/install_database.py
# Setup LDAP: TO BE DONE

View file

@ -11,11 +11,9 @@ instance=$(sudo yunohost app setting $app instance)
if [ "$instance" = "master" ]; then
# Remove Odoo
sudo yunohost service stop odoo
sudo yunohost service stop postgresql
sudo apt-get remove odoo -y
sudo apt-get remove wkhtmltopdf -y
sudo yunohost service remove odoo
sudo yunohost service remove postgresql
fi
# Remove NGINX conf