diff --git a/MANIFEST.in b/MANIFEST.in index 6cd10b511cf..70715f18bc2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,18 +1,12 @@ -include rpminstall_sh.txt # TODO do we need this file ? include README include LICENSE include MANIFEST.in include setup.nsi include setup.cfg -#include openerp/server.cert -#include openerp/server.pkey -#include openerp/gpl.txt -include man/openerp-server.1 -include man/openerp_serverrc.5 -recursive-include pixmaps *bmp *ico *png +include setup_rpm.sh recursive-include win32 *.py *.bat -recursive-include openerp *css *csv *html *png *po *pot -recursive-include openerp *rml *rng *sql *sxw *xml *xsl *yml +recursive-include openerp *css *csv *html *png *po *pot *rml *rng *sql *sxw *xml *xsl *yml +graft install graft debian graft doc global-exclude *pyc *~ # Exclude possible garbage from previous graft. diff --git a/README b/README index 5725ce9f866..a6fe10c8ffb 100644 --- a/README +++ b/README @@ -1,17 +1,138 @@ -About OpenERP ---------------- - -OpenERP is a free Enterprise Resource Planning and Customer Relationship -Management software. It is mainly developed to meet changing needs. - -The main functional features are: CRM & SRM, analytic and financial accounting, -double-entry stock management, sales and purchases management, tasks automation, -help desk, marketing campaign, ... and vertical modules for very specific -businesses. - -Technical features include a distributed server, flexible workflows, an object -database, dynamic GUIs, customizable reports, NET-RPC and XML-RPC interfaces, ... - -For more information, please visit: -http://www.openerp.com - +About OpenERP +------------- + +OpenERP is a free Enterprise Resource Planning and Customer Relationship +Management software. It is mainly developed to meet changing needs. + +The main functional features are: CRM & SRM, analytic and financial accounting, +double-entry stock management, sales and purchases management, tasks automation, +help desk, marketing campaign, ... and vertical modules for very specific +businesses. + +Technical features include a distributed server, flexible workflows, an object +database, dynamic GUIs, customizable reports, NET-RPC and XML-RPC interfaces, ... + +For more information, please visit: +http://www.openerp.com + +OpenERP Quick Installation Guide +--------------------------------- + +This file contains a quick guide to configure and install the OpenERP server. + +Required dependencies: +--------------------- + +You need the following software installed: + + * Python 2.5 or 2.6 + * Postgresql 8.2 or above + * Psycopg2 python module + * Reportlab pdf generation library for python + * lxml python module + * pytz python module + * PyYaml python module (install with: easy_install PyYaml) + +Some dependencies are only required for specific purposes: + +for rendering workflows graphs, you need: + * graphviz + * pyparsing + +For Luxembourg localization, you also need: + * pdftk (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) + +for generating reports using non .jpg images, you need: + * Python Imaging Library for python + +For Debian-based distributions, the required packages can be installed with the +following command: + + #> apt-get install -y postgresql graphviz python-psycopg2 python-lxml python-tz python-imaging + +For Fedora +if they are not installed, install: +python and postgresql + +uses yum or you can recover required packages on fedora web site in "core" or "extra" repository : +postgresql-python +python-lxml +python-imaging +python-psycopg2 +python-reportlab +graphviz +You can find pyparsing at http://pyparsing.sourceforge.net/ + +1. Check that all the required dependencies are installed. + +2. Launch the program "python ./bin/openerp-server.py -r db_user -w db_password --db_host 127.0.0.1". +See the man page for more information about options. + +3. Connect to the server using the GUI client. And follow the instructions to create a new database. + +Installation Steps +------------------ + +1. Check that all the required dependencies are installed. + +2. Create a postgresql database. + +The default database name is "terp". If you want to use another name, you +will need to provide it when launching the server (by using the commandline +option --database). + +To create a postgresql database named "terp" using the following command: + $ createdb --encoding=UNICODE terp + +If it is the first time you use postgresql you might need to create a new user +to the postgres system using the following commands (where myusername is your +unix user name): + + $ su - + # su - postgres + $ createuser openerp + Shall the new user be allowed to create databases? (y/n) y + Shall the new user be allowed to create more new users? (y/n) y + CREATE USER + $ logout + # logout + +3. Launch service daemon by "service openerp-server start". + +The first time it is run, the server will initialise the database with all the default values. + +4. Connect to the server using the GUI client. + +There are two accounts by default: + * login: admin, password:admin + * login: demo, password:demo + +Some instructions to use setup.py for a user-install. +This file should/will be moved on a proper documentation place later. + + +- Possibly clean any left-over of the previous build. + > rm -rf dist openerp_server.egg-info + +- Possibly copy the addons in the server if we want them to be packaged + together: + > rsync -av --delete \ + --exclude .bzr/ \ + --exclude .bzrignore \ + --exclude /__init__.py \ + --exclude /base \ + --exclude /base_quality_interrogation.py \ + openerp/addons + +- Create the user-local directory where we want the package to be installed: + > mkdir -p /home/openerp/openerp-tmp/lib/python2.6/site-packages/ + +- Use --prefix to specify where the package is installed and include that + place in PYTHONPATH: + > PYTHONPATH=/home/openerp/openerp-tmp/lib/python2.6/site-packages/ \ + python setup.py install --prefix=/home/openerp/openerp-tmp + +- Run the main script, again specifying the PYTHONPATH: + > PYTHONPATH=/home/openerp/openerp-tmp/lib/python2.6/site-packages/ \ + /home/openerp/openerp-tmp/bin/openerp-server + diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index 18b6b245bf0..00000000000 --- a/debian/README.source +++ /dev/null @@ -1,37 +0,0 @@ -Package Repositories --------------------- - -Backports for the current stable debian distribution as well as snapshots of -unreleased versions may be available in repositories listed on the maintainers -homepage. The current URL of the maintainer homepage can be seen in -debian/copyright. - - -Source Access -------------- - -You can obtain the sources of this package with: - - $ apt-get source ${PACKAGE} - -whereas '${PACKAGE}' has to be replaced with the actual name of the package. - -This package is maintained with the Git version control system. The current git -source tree can be obtained with: - - $ git clone ${GIT_URI} - -whereas '${GIT_URI}' has to be replaced with the actual URI for the Git -repository. The current Git URI can be seen in debian/control in the extracted -package sources. - -More information about Git can be found in the git-core package. - -This package may use the Quilt patch system to manage all modifications to the -upstream source. Changes, if any, are stored in the source package as diffs in -debian/diff and are applied during the build. Current modifications can be -applied to the source tree with: - - $ QUILT_PATCHES=debian/patches quilt push -a - -More information about Quilt can be found in the quilt package. diff --git a/debian/changelog b/debian/changelog index f9a2355cf62..0ee8e0e3295 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openerp (6.1-1) testing; urgency=low + + * New major version, new packaging. + + -- Antony Lesuisse Sat, 01 Oct 2011 12:31:00 +0100 + openerp-server (6.0.2-1) testing; urgency=low * Using upstream version 6.0.2 diff --git a/debian/control b/debian/control index 11c98536526..3165879fa3f 100644 --- a/debian/control +++ b/debian/control @@ -1,40 +1,49 @@ -Source: openerp-server +Source: openerp Section: net Priority: optional -Maintainer: OpenERP SA. -Uploaders: Xrg -Build-Depends: debhelper (>= 7.0.50~), python -Build-Depends-Indep: - python-libxslt1, python-lxml, python-pychart, python-pydot, python-psycopg2, - python-reportlab +Maintainer: OpenERP SA +Build-Depends: debhelper (>= 7.0.50~), python, rsync Standards-Version: 3.9.1 Homepage: http://www.openerp.com/ -Vcs-Browser: http://git.hellug.gr/?p=xrg/openobject-server;a=summary -Vcs-Git: http://members.hellug.gr/xrg/repos/openobject-server -Vcs-Bzr: https://code.launchpad.net/openobject-server +Vcs-Bzr: https://launchpad.net/openobject -Package: openerp-server +Package: openerp Section: net Architecture: all Depends: - ${misc:Depends}, adduser, python, python-dateutil, python-libxslt1, - python-lxml, python-psycopg2, python-pydot, python-pychart, python-reportlab, - python-tz, python-pyparsing, python-yaml, python-mako, - postgresql-client (>=8.2) -Conflicts: tinyerp-server -Replaces: tinyerp-server + ${misc:Depends}, + adduser, + python, + postgresql-client, + python-dateutil, + python-gdata, + python-ldap, + python-libxslt1, + python-lxml, + python-mako, + python-openid, + python-psycopg2, + python-pybabel, + python-pychart, + python-pydot, + python-pyparsing, + python-reportlab, + python-simplejson, + python-tz, + python-vobject, + python-webdav, + python-werkzeug, + python-yaml, + python-zsi +Conflicts: tinyerp-server, openerp-server, openerp-web +Replaces: tinyerp-server, openerp-server, openerp-web Recommends: - graphviz, ghostscript, postgresql, python-imaging, - python-matplotlib -Suggests: openerp-client -Description: Enterprise Resource Management (server) - Open ERP, previously known as TinyERP, is a complete ERP and CRM. The main + graphviz, ghostscript, postgresql, python-imaging, python-matplotlib +Description: OpenERP Enterprise Resource Management + OpenERP, previously known as TinyERP, is a complete ERP and CRM. The main features are accounting (analytic and financial), stock management, sales and purchases management, tasks automation, marketing campaigns, help desk, POS, etc. Technical features include a distributed server, flexible workflows, an object database, a dynamic GUI, customizable reports, and NET-RPC and XML-RPC interfaces. - . - This package contains the Open ERP server, install openerp-client package for - the client. diff --git a/debian/local/openerp-server.conf b/debian/local/openerp-server.conf deleted file mode 100644 index ffb6ed49db3..00000000000 --- a/debian/local/openerp-server.conf +++ /dev/null @@ -1,55 +0,0 @@ -# /etc/openerp-server.conf(5) - configuration file for openerp-server(1) - -[options] -# Enable the debugging mode (default False). -verbose = False -debug_mode = False - -# The file where the server pid will be stored (default False). -#pidfile = /var/run/openerp.pid - -# The file where the server log will be stored (default False). -logfile = /var/log/openerp-server.log - -# The unix account on behalf openerp is running. -process_user = openerp - -# The IP address on which the server will bind. -# If empty, it will bind on all interfaces (default empty). -interface = localhost - -# The TCP port on which the server will listen (default 8069). -#port = 8070 - -# Enable debug mode (default False). -debug_mode = False - -# Launch server over https instead of http (default False). -secure = False - -# Specify the SMTP server for sending email (default localhost). -smtp_server = localhost - -# Specify the SMTP user for sending email (default False). -smtp_user = False - -# Specify the SMTP password for sending email (default False). -smtp_password = False - -# Specify the database name. -#db_name = openerp - -# Specify the database user name (default None). -db_user = openerp - -# Specify the database password for db_user (default None). -db_password = - -# Specify the database host (default localhost). -db_host = - -# Specify the database port (default None). -db_port = 5432 - -# Specify the price accuracy. -#price_accuracy = diff --git a/debian/openerp-server.config b/debian/openerp-server.config deleted file mode 100644 index cf081ab3861..00000000000 --- a/debian/openerp-server.config +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -. /usr/share/debconf/confmodule - -db_input low openerp-server/username || true -db_go - -db_stop diff --git a/debian/openerp-server.docs b/debian/openerp-server.docs deleted file mode 100644 index d5ad552bfce..00000000000 --- a/debian/openerp-server.docs +++ /dev/null @@ -1,2 +0,0 @@ -doc/migrate -doc/tests diff --git a/debian/openerp-server.examples b/debian/openerp-server.examples deleted file mode 100644 index c7f075ec127..00000000000 --- a/debian/openerp-server.examples +++ /dev/null @@ -1 +0,0 @@ -debian/openerp-server.preseed diff --git a/debian/openerp-server.install b/debian/openerp-server.install deleted file mode 100644 index 78a4a648a06..00000000000 --- a/debian/openerp-server.install +++ /dev/null @@ -1 +0,0 @@ -doc/openerp-server.conf /etc diff --git a/debian/openerp-server.links b/debian/openerp-server.links deleted file mode 100644 index 67620d22397..00000000000 --- a/debian/openerp-server.links +++ /dev/null @@ -1,2 +0,0 @@ -/usr/share/man/man5/openerp_serverrc.5.gz /usr/share/man/man5/openerp-server.conf.5.gz -/var/lib/openerp-server/filestore /usr/lib/openerp-server/filestore diff --git a/debian/openerp-server.lintian-overrides b/debian/openerp-server.lintian-overrides deleted file mode 100644 index 25b1165c4be..00000000000 --- a/debian/openerp-server.lintian-overrides +++ /dev/null @@ -1,7 +0,0 @@ -# Add-on directories needs data directories, and sometimes they are -# (intentionally) empty, hence overriting the lintian warning. -openerp-server: package-contains-empty-directory -# Add-on directoires contain images sometimes, but it's nothing that is -# worthwile to be splittet out to /usr/share as it's all manual work for each -# release. -openerp-server: image-file-in-usr-lib diff --git a/debian/openerp-server.postinst b/debian/openerp-server.postinst deleted file mode 100644 index a1e5317b8fc..00000000000 --- a/debian/openerp-server.postinst +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -set -e - -. /usr/share/debconf/confmodule - -CONFFILE="/etc/openerp-server.conf" -LOGFILE="/var/log/openerp-server.log" - -case "${1}" in - configure) - db_version 2.0 - - db_get openerp-server/username - _USERNAME="${RET:-openerp}" - - db_stop - - if ! getent passwd | grep -q "^${_USERNAME}" - then - adduser --system --no-create-home --quiet --gecos 'Open ERP server' --group ${_USERNAME} - else - echo "Open ERP user (${_USERNAME}) already exists, doing nothing." - fi - - sed -i -e "s|^process_user.*$|process_user = ${_USERNAME}|" ${CONFFILE} - - # Creating log file - touch ${LOGFILE} - chown ${_USERNAME}:adm ${LOGFILE} - chmod 0640 ${LOGFILE} - - # Creating local storage directory - mkdir -p /var/lib/openerp-server/filestore - - # Setting ownership and permissions - chmod 0640 ${CONFFILE} - chown ${_USERNAME}:${_USERNAME} ${CONFFILE} - chown ${_USERNAME}:${_USERNAME} /var/lib/openerp-server -R - - echo - echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - echo "* Open ERP uses a PostgreSQL database to store its data. With the first *" - echo "* generation of packages, you have to setup this database manually. *" - echo "* Please read /usr/share/doc/openerp-server/README.Debian how to do it. *" - echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - echo - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`{$1}'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/openerp-server.postrm b/debian/openerp-server.postrm deleted file mode 100644 index 02b3d0a6817..00000000000 --- a/debian/openerp-server.postrm +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -set -e - -case "${1}" in - remove) - _USERNAME="openerp" - _GROUPNAME="openerp" - - if [ -x /usr/sbin/deluser ] - then - deluser --quiet --system ${_USERNAME} - fi - - if [ -x /usr/sbin/delgroup ] - then - delgroup --quiet --system --only-if-empty ${_GROUPNAME} || true - fi - - rm -f /usr/lib/openerp-server/addons/__init__.pyc - rmdir --ignore-fail-on-non-empty /usr/lib/openerp-server/addons || true - rmdir --ignore-fail-on-non-empty /usr/lib/openerp-server || true - ;; - - purge) - rm -rf /var/lib/openerp-server - ;; - - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - ;; - - *) - echo "postrm called with unknown argument \`${1}'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/openerp-server.preseed b/debian/openerp-server.preseed deleted file mode 100644 index 66d1a4ab95d..00000000000 --- a/debian/openerp-server.preseed +++ /dev/null @@ -1,5 +0,0 @@ -################################################################################ -## openerp-server - -#openerp-server openerp-server/username string openerp -################################################################################ diff --git a/debian/openerp-server.templates b/debian/openerp-server.templates deleted file mode 100644 index 985bd24abd9..00000000000 --- a/debian/openerp-server.templates +++ /dev/null @@ -1,9 +0,0 @@ -Template: openerp-server/username -Type: string -Default: openerp -_Description: Dedicated system account for the Open ERP server: - The Open ERP server must use a dedicated account for its operation so that - the system's security is not compromised by running it with superuser - privileges. - . - Please choose that account's username. diff --git a/debian/openerp-server.README.Debian b/debian/openerp.README.Debian similarity index 100% rename from debian/openerp-server.README.Debian rename to debian/openerp.README.Debian diff --git a/debian/openerp-server.init b/debian/openerp.init similarity index 97% rename from debian/openerp-server.init rename to debian/openerp.init index ad8cbecb07c..6abb6f10ed6 100644 --- a/debian/openerp-server.init +++ b/debian/openerp.init @@ -16,7 +16,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/openerp-server NAME=openerp-server DESC=openerp-server -CONFIG=/etc/openerp-server.conf +CONFIG=/etc/openerp/openerp-server.conf LOGFILE=/var/log/openerp-server.log USER=openerp diff --git a/debian/openerp.install b/debian/openerp.install new file mode 100644 index 00000000000..511075fb7c9 --- /dev/null +++ b/debian/openerp.install @@ -0,0 +1 @@ +install/openerp-server.conf /etc/openerp diff --git a/debian/openerp.postinst b/debian/openerp.postinst new file mode 100644 index 00000000000..362741bb7e9 --- /dev/null +++ b/debian/openerp.postinst @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +case "${1}" in + configure) + if ! getent passwd | grep -q "^openerp"; then + adduser --system --no-create-home --quiet --gecos 'OpenERP' --group openerp + fi + # Register "openerp" as a postgres superuser + su - postgres -c "createuser -s openerp" 2> /dev/null || true + chown openerp:openerp /etc/openerp/openerp-server.conf + chmod 0640 /etc/openerp/openerp-server.conf + # Creating log file + touch /var/log/openerp.log + chown openerp:openerp /var/log/openerp.log + chmod 0640 /var/log/openerp.log + # Creating local storage directory + mkdir -p /var/lib/openerp/filestore + chown openerp:openerp -R /var/lib/openerp + ;; + *) + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/openerp.postrm b/debian/openerp.postrm new file mode 100644 index 00000000000..0e5014dc9c8 --- /dev/null +++ b/debian/openerp.postrm @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "${1}" in + remove) + deluser --quiet --system "openerp" || true + delgroup --quiet --system --only-if-empty "openerp" || true + ;; + + purge) + rm -rf /var/lib/openerp-server + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 30ce14141e4..7d8b210d1ba 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,18 @@ #!/usr/bin/make -f -EXTRA_MODULES_PATH ?= ../addons - %: dh ${@} -override_dh_installchangelogs: - dh_installchangelogs doc/Changelog +override_dh_pysupport: + echo "rsync" + sh -c "[ -d debian/openerp/usr/lib/python2.6 ] && rsync -av openerp/ debian/openerp/usr/lib/python2.6/dist-packages/openerp/" || true + sh -c "[ -d debian/openerp/usr/lib/python2.7 ] && rsync -av openerp/ debian/openerp/usr/lib/python2.7/dist-packages/openerp/" || true + rm -Rf debian/openerp/usr/openerp debian/openerp/usr/lib/python2.6/dist-packages/tests debian/openerp/usr/lib/python2.7/dist-packages/tests + dh_pysupport + rm -Rf debian/openerp/usr/lib + + override_dh_installinit: dh_installinit --update-rcd-params='defaults 21' + diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index d3827e75a5c..00000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/doc/openerp-server.conf b/doc/openerp-server.conf deleted file mode 100644 index 4f13c8a45c2..00000000000 --- a/doc/openerp-server.conf +++ /dev/null @@ -1,34 +0,0 @@ -[options] -without_demo = True -; This is the password that allows database operations: -; admin_passwd = admin -upgrade = False -verbose = False -netrpc = True -; netrpc_interface = -; netrpc_port = -xmlrpc = True -; xmlrpc_interface = -xmlrpc_port = 8069 -db_host = False -db_port = False -; Please uncomment the following line *after* you have created the -; database. It activates the auto module check on startup. -; db_name = terp -db_user = openerp -db_password = False -; Uncomment these for xml-rpc over SSL -; secure = True -; secure_cert_file = /etc/openerp/server.cert -; secure_pkey_file = /etc/openerp/server.key -root_path = None -soap = False -translate_modules = ['all'] -demo = {} -addons_path = None -reportgz = False - -; Static http parameters -static_http_enable = False -static_http_document_root = /var/www/html -static_http_url_prefix = / \ No newline at end of file diff --git a/gunicorn.conf.py b/gunicorn.conf.py new file mode 100644 index 00000000000..7b117c040f6 --- /dev/null +++ b/gunicorn.conf.py @@ -0,0 +1,17 @@ +import openerp +# Standard OpenERP XML-RPC port. +bind = '127.0.0.1:8069' +pidfile = '.gunicorn.pid' +# This is the big TODO: safely use more than a single worker. +workers = 1 +# Some application-wide initialization is needed. +on_starting = openerp.wsgi.on_starting +when_ready = openerp.wsgi.when_ready +timeout = 240 # openerp request-response cycle can be quite long + +# Setting openerp.conf.xxx will be better than setting +# openerp.tools.config['xxx'] +conf = openerp.tools.config +conf['addons_path'] = '/home/openerp/repos/addons/trunk-xmlrpc' +conf['static_http_document_root'] = '/tmp' +#conf['log_level'] = 10 # 10 is DEBUG diff --git a/doc/Changelog b/history/Changelog similarity index 100% rename from doc/Changelog rename to history/Changelog diff --git a/doc/Changelog-4.x b/history/Changelog-4.x similarity index 100% rename from doc/Changelog-4.x rename to history/Changelog-4.x diff --git a/doc/Changelog-6.x b/history/Changelog-6.x similarity index 100% rename from doc/Changelog-6.x rename to history/Changelog-6.x diff --git a/doc/INSTALL b/history/INSTALL similarity index 100% rename from doc/INSTALL rename to history/INSTALL diff --git a/doc/README.urpmi b/history/README.urpmi similarity index 100% rename from doc/README.urpmi rename to history/README.urpmi diff --git a/doc/README.userchange b/history/README.userchange similarity index 100% rename from doc/README.userchange rename to history/README.userchange diff --git a/tools/change-loglevel.sh b/history/change-loglevel.sh similarity index 100% rename from tools/change-loglevel.sh rename to history/change-loglevel.sh diff --git a/doc/tests/check_profile_l10n_all.py b/history/check_profile_l10n_all.py similarity index 100% rename from doc/tests/check_profile_l10n_all.py rename to history/check_profile_l10n_all.py diff --git a/sql/clean-model.sql b/history/clean-model.sql similarity index 100% rename from sql/clean-model.sql rename to history/clean-model.sql diff --git a/tools/gen_graph.sh b/history/gen_graph.sh similarity index 100% rename from tools/gen_graph.sh rename to history/gen_graph.sh diff --git a/tools/get-srvstats.sh b/history/get-srvstats.sh similarity index 100% rename from tools/get-srvstats.sh rename to history/get-srvstats.sh diff --git a/tools/list-services.sh b/history/list-services.sh similarity index 100% rename from tools/list-services.sh rename to history/list-services.sh diff --git a/doc/migrate/3.3.0-3.4.0/README b/history/migrate/3.3.0-3.4.0/README similarity index 100% rename from doc/migrate/3.3.0-3.4.0/README rename to history/migrate/3.3.0-3.4.0/README diff --git a/doc/migrate/3.3.0-3.4.0/post.py b/history/migrate/3.3.0-3.4.0/post.py similarity index 100% rename from doc/migrate/3.3.0-3.4.0/post.py rename to history/migrate/3.3.0-3.4.0/post.py diff --git a/doc/migrate/3.3.0-3.4.0/pre.py b/history/migrate/3.3.0-3.4.0/pre.py similarity index 100% rename from doc/migrate/3.3.0-3.4.0/pre.py rename to history/migrate/3.3.0-3.4.0/pre.py diff --git a/doc/migrate/3.4.0-4.0.0/README b/history/migrate/3.4.0-4.0.0/README similarity index 100% rename from doc/migrate/3.4.0-4.0.0/README rename to history/migrate/3.4.0-4.0.0/README diff --git a/doc/migrate/3.4.0-4.0.0/post-tiny.py b/history/migrate/3.4.0-4.0.0/post-tiny.py similarity index 100% rename from doc/migrate/3.4.0-4.0.0/post-tiny.py rename to history/migrate/3.4.0-4.0.0/post-tiny.py diff --git a/doc/migrate/3.4.0-4.0.0/post.py b/history/migrate/3.4.0-4.0.0/post.py similarity index 100% rename from doc/migrate/3.4.0-4.0.0/post.py rename to history/migrate/3.4.0-4.0.0/post.py diff --git a/doc/migrate/3.4.0-4.0.0/pre-tiny.py b/history/migrate/3.4.0-4.0.0/pre-tiny.py similarity index 100% rename from doc/migrate/3.4.0-4.0.0/pre-tiny.py rename to history/migrate/3.4.0-4.0.0/pre-tiny.py diff --git a/doc/migrate/3.4.0-4.0.0/pre.py b/history/migrate/3.4.0-4.0.0/pre.py similarity index 100% rename from doc/migrate/3.4.0-4.0.0/pre.py rename to history/migrate/3.4.0-4.0.0/pre.py diff --git a/doc/migrate/4.0.0-4.2.0/pre.py b/history/migrate/4.0.0-4.2.0/pre.py similarity index 100% rename from doc/migrate/4.0.0-4.2.0/pre.py rename to history/migrate/4.0.0-4.2.0/pre.py diff --git a/doc/migrate/4.0.0-4.2.0/tiny/README b/history/migrate/4.0.0-4.2.0/tiny/README similarity index 100% rename from doc/migrate/4.0.0-4.2.0/tiny/README rename to history/migrate/4.0.0-4.2.0/tiny/README diff --git a/doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py b/history/migrate/4.0.0-4.2.0/tiny/pre-tiny.py similarity index 100% rename from doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py rename to history/migrate/4.0.0-4.2.0/tiny/pre-tiny.py diff --git a/doc/migrate/4.2.0-4.4.0/pre.py b/history/migrate/4.2.0-4.4.0/pre.py similarity index 100% rename from doc/migrate/4.2.0-4.4.0/pre.py rename to history/migrate/4.2.0-4.4.0/pre.py diff --git a/tools/module_graph.py b/history/module_graph.py similarity index 100% rename from tools/module_graph.py rename to history/module_graph.py diff --git a/tools/xml2yml.py b/history/xml2yml.py similarity index 100% rename from tools/xml2yml.py rename to history/xml2yml.py diff --git a/pixmaps/openerp-header.bmp b/install/openerp-header.bmp similarity index 100% rename from pixmaps/openerp-header.bmp rename to install/openerp-header.bmp diff --git a/pixmaps/openerp-header.png b/install/openerp-header.png similarity index 100% rename from pixmaps/openerp-header.png rename to install/openerp-header.png diff --git a/pixmaps/openerp-icon.ico b/install/openerp-icon.ico similarity index 100% rename from pixmaps/openerp-icon.ico rename to install/openerp-icon.ico diff --git a/pixmaps/openerp-icon.png b/install/openerp-icon.png similarity index 100% rename from pixmaps/openerp-icon.png rename to install/openerp-icon.png diff --git a/man/openerp-server.1 b/install/openerp-server.1 similarity index 100% rename from man/openerp-server.1 rename to install/openerp-server.1 diff --git a/install/openerp-server.conf b/install/openerp-server.conf new file mode 100644 index 00000000000..ead261e5218 --- /dev/null +++ b/install/openerp-server.conf @@ -0,0 +1,7 @@ +[options] +; This is the password that allows database operations: +; admin_passwd = admin +db_host = False +db_port = False +db_user = openerp +db_password = False diff --git a/doc/openerp-server.init b/install/openerp-server.init similarity index 100% rename from doc/openerp-server.init rename to install/openerp-server.init diff --git a/doc/openerp-server.logrotate b/install/openerp-server.logrotate similarity index 100% rename from doc/openerp-server.logrotate rename to install/openerp-server.logrotate diff --git a/pixmaps/openerp.ico b/install/openerp.ico similarity index 100% rename from pixmaps/openerp.ico rename to install/openerp.ico diff --git a/pixmaps/openerp.png b/install/openerp.png similarity index 100% rename from pixmaps/openerp.png rename to install/openerp.png diff --git a/man/openerp_serverrc.5 b/install/openerp_serverrc.5 similarity index 100% rename from man/openerp_serverrc.5 rename to install/openerp_serverrc.5 diff --git a/ssl-cert.cfg b/install/ssl-cert.cfg similarity index 100% rename from ssl-cert.cfg rename to install/ssl-cert.cfg diff --git a/openerp-server b/openerp-server index dbae1c31884..52ad49104b1 100755 --- a/openerp-server +++ b/openerp-server @@ -27,7 +27,7 @@ OpenERP is an ERP+CRM program for small and medium businesses. The whole source code is distributed under the terms of the GNU Public Licence. -(c) 2003-TODAY, Fabien Pinckaers - OpenERP s.a. +(c) 2003-TODAY, Fabien Pinckaers - OpenERP SA """ import logging @@ -88,19 +88,27 @@ def setup_pid_file(): def preload_registry(dbname): """ Preload a registry, and start the cron.""" - db, pool = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) - pool.get('ir.cron').restart(db.dbname) + try: + db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) + + # jobs will start to be processed later, when openerp.cron.start_master_thread() is called by openerp.service.start_services() + registry.schedule_cron_jobs() + except Exception: + logging.exception('Failed to initialize database `%s`.', dbname) def run_test_file(dbname, test_file): """ Preload a registry, possibly run a test file, and start the cron.""" - db, pool = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) + try: + db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) + cr = db.cursor() + logger = logging.getLogger('server') + logger.info('loading test file %s', test_file) + openerp.tools.convert_yaml_import(cr, 'base', file(test_file), {}, 'test', True) + cr.rollback() + cr.close() + except Exception: + logging.exception('Failed to initialize database `%s` and run test file `%s`.', dbname, test_file) - cr = db.cursor() - logger = logging.getLogger('server') - logger.info('loading test file %s', test_file) - openerp.tools.convert_yaml_import(cr, 'base', file(test_file), {}, 'test', True) - cr.rollback() - cr.close() def export_translation(): config = openerp.tools.config @@ -136,27 +144,6 @@ def import_translation(): cr.commit() cr.close() -def start_services(): - http_server = openerp.service.http_server - netrpc_server = openerp.service.netrpc_server - - # Instantiate local services (this is a legacy design). - openerp.osv.osv.start_object_proxy() - # Export (for RPC) services. - openerp.service.web_services.start_web_services() - - # Initialize the HTTP stack. - http_server.init_servers() - http_server.init_xmlrpc() - http_server.init_static_http() - netrpc_server.init_servers() - - # Start the main cron thread. - openerp.netsvc.start_agent() - - # Start the top-level servers threads (normally HTTP, HTTPS, and NETRPC). - openerp.netsvc.Server.startAll() - # Variable keeping track of the number of calls to the signal handler defined # below. This variable is monitored by ``quit_on_signals()``. quit_signals_received = 0 @@ -208,30 +195,16 @@ def quit_on_signals(): while quit_signals_received == 0: time.sleep(60) - openerp.netsvc.Agent.quit() - openerp.netsvc.Server.quitAll() - config = openerp.tools.config if config['pidfile']: os.unlink(config['pidfile']) - logger = logging.getLogger('server') - logger.info("Initiating shutdown") - logger.info("Hit CTRL-C again or send a second signal to force the sutdown.") - logging.shutdown() - # manually join() all threads before calling sys.exit() to allow a second signal - # to trigger _force_quit() in case some non-daemon threads won't exit cleanly. - # threading.Thread.join() should not mask signals (at least in python 2.5) - for thread in threading.enumerate(): - if thread != threading.currentThread() and not thread.isDaemon(): - while thread.isAlive(): - # need a busyloop here as thread.join() masks signals - # and would present the forced shutdown - thread.join(0.05) - time.sleep(0.05) + openerp.service.stop_services() sys.exit(0) if __name__ == "__main__": + os.environ["TZ"] = "UTC" + check_root_user() openerp.tools.config.parse_config(sys.argv[1:]) check_postgres_user() @@ -240,6 +213,8 @@ if __name__ == "__main__": config = openerp.tools.config + setup_signal_handlers() + if config["test_file"]: run_test_file(config['db_name'], config['test_file']) sys.exit(0) @@ -255,7 +230,7 @@ if __name__ == "__main__": if not config["stop_after_init"]: # Some module register themselves when they are loaded so we need the # services to be running before loading any registry. - start_services() + openerp.service.start_services() if config['db_name']: for dbname in config['db_name'].split(','): @@ -264,8 +239,17 @@ if __name__ == "__main__": if config["stop_after_init"]: sys.exit(0) + for m in openerp.conf.server_wide_modules: + try: + __import__(m) + # Call any post_load hook. + info = openerp.modules.module.load_information_from_description_file(m) + if info['post_load']: + getattr(sys.modules[m], info['post_load'])() + except Exception: + logging.exception('Failed to load server-wide module `%s`', m) + setup_pid_file() - setup_signal_handlers() logger = logging.getLogger('server') logger.info('OpenERP server is running, waiting for connections...') quit_on_signals() diff --git a/openerp/__init__.py b/openerp/__init__.py index b7b5fc1b533..7e723c41f9d 100644 --- a/openerp/__init__.py +++ b/openerp/__init__.py @@ -22,6 +22,8 @@ """ OpenERP core library. """ +# The hard-coded super-user id (a.k.a. administrator, or root user). +SUPERUSER_ID = 1 import addons import conf @@ -41,6 +43,7 @@ import tiny_socket import tools import wizard import workflow +import wsgi # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py index 88a0d113151..1f863eca509 100644 --- a/openerp/addons/__init__.py +++ b/openerp/addons/__init__.py @@ -22,10 +22,15 @@ """ Addons module. -This module only serves to contain OpenERP addons. For the code to -manage those addons, see openerp.modules. This module conveniently -reexports some symbols from openerp.modules. Importing them from here -is deprecated. +This module serves to contain all OpenERP addons, across all configured addons +paths. For the code to manage those addons, see openerp.modules. + +Addons are made available here (i.e. under openerp.addons) after +openerp.tools.config.parse_config() is called (so that the addons paths +are known). + +This module also conveniently reexports some symbols from openerp.modules. +Importing them from here is deprecated. """ diff --git a/openerp/addons/base/__init__.py b/openerp/addons/base/__init__.py index 847bef71f8c..16a61521fb4 100644 --- a/openerp/addons/base/__init__.py +++ b/openerp/addons/base/__init__.py @@ -24,6 +24,7 @@ import module import res import publisher_warranty import report +import test # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py index 37f26edc177..e436a0a6005 100644 --- a/openerp/addons/base/__openerp__.py +++ b/openerp/addons/base/__openerp__.py @@ -67,7 +67,7 @@ 'res/res_currency_view.xml', 'res/res_partner_event_view.xml', 'res/wizard/partner_sms_send_view.xml', - 'res/wizard/partner_wizard_spam_view.xml', + 'res/wizard/partner_wizard_massmail_view.xml', 'res/wizard/partner_clear_ids_view.xml', 'res/wizard/partner_wizard_ean_check_view.xml', 'res/res_partner_data.xml', @@ -92,6 +92,10 @@ 'test/test_osv_expression.yml', 'test/test_ir_rule.yml', # <-- These tests modify/add/delete ir_rules. 'test/test_ir_values.yml', + # Commented because this takes some time. + # This must be (un)commented with the corresponding import statement + # in test/__init__.py. + # 'test/test_ir_cron.yml', # <-- These tests perform a roolback. ], 'installable': True, 'active': True, diff --git a/openerp/addons/base/base.sql b/openerp/addons/base/base.sql index 54dcc3a55ae..55c4d41aba5 100644 --- a/openerp/addons/base/base.sql +++ b/openerp/addons/base/base.sql @@ -290,6 +290,7 @@ CREATE TABLE ir_module_module ( state character varying(16), latest_version character varying(64), shortdesc character varying(256), + complexity character varying(32), category_id integer REFERENCES ir_module_category ON DELETE SET NULL, certificate character varying(64), description text, diff --git a/openerp/addons/base/base_data.xml b/openerp/addons/base/base_data.xml index 00fb83a0796..feaac206723 100644 --- a/openerp/addons/base/base_data.xml +++ b/openerp/addons/base/base_data.xml @@ -1002,7 +1002,7 @@ - OpenERP S.A. + Your Company @@ -1010,14 +1010,7 @@ - Fabien Pinckaers - Chaussee de Namur 40 - 1367 - Gerompont - (+32).81.81.37.00 default - - @@ -1038,19 +1031,14 @@ - OpenERP S.A. + Your Company - Free Business Solutions - Web: http://www.openerp.com - Tel: (+32).81.81.37.00 - Bank: CPH 126-2013269-07 - IBAN: BE74 1262 0132 6907 - SWIFT: CPHBBE75 - VAT: BE0477.472.701 + Company business slogan + Web: www.companyname.com - Tel: +1-212-555-12345 + IBAN: XX12 3456 7890 1234 5678 - SWIFT: SWIFTCODE - VAT: Company vat number - - - OpenERP S.A. - - Administrator @@ -1086,16 +1074,17 @@ - - VEB - Bs - 2.95 + + + VEF + Bs.F + 0.0001 4 - - 2768.45 - + + 5.864 + @@ -1599,12 +1588,20 @@ 0.01 4 ¢ + 691.3153 - + + + + localhost + localhost + + + MUR diff --git a/openerp/addons/base/base_update.xml b/openerp/addons/base/base_update.xml index b87c0ef4382..26f971b8334 100644 --- a/openerp/addons/base/base_update.xml +++ b/openerp/addons/base/base_update.xml @@ -75,29 +75,29 @@ --> - res.users.form.modif + res.users.preferences.form res.users form
- + - - - - + + + + - - - + +
@@ -147,7 +147,7 @@ - + @@ -196,7 +196,7 @@ form tree,form - Configure your company's bank account and select those that must appear on the report footer. You can drag & drop bank in the list view to reorder bank accounts. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data. + Configure your company's bank account and select those that must appear on the report footer. You can reorder bank accounts from the list view. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data.
@@ -209,7 +209,7 @@ - + @@ -225,18 +225,17 @@ - - - - - - + + + + + + - -