Merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict into lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths

Proposed by Stefan Rijnhart (Opener)
Status: Work in progress
Proposed branch: lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict
Merge into: lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths
Diff against target: 5948 lines (+3990/-991)
57 files modified
.bzrignore (+1/-0)
CHANGES.rst (+45/-5)
MANIFEST.in (+1/-0)
README.rst (+75/-0)
anybox/recipe/openerp/base.py (+49/-31)
anybox/recipe/openerp/runtime/__init__.py (+39/-0)
anybox/recipe/openerp/runtime/backports/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/backports/cli/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/backports/cli/server.py (+87/-0)
anybox/recipe/openerp/runtime/session.py (+317/-31)
anybox/recipe/openerp/runtime/start_openerp.py (+43/-1)
anybox/recipe/openerp/runtime/tests/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/tests/test_import_registry.py (+1/-1)
anybox/recipe/openerp/runtime/upgrade.py (+153/-0)
anybox/recipe/openerp/server.py (+50/-7)
anybox/recipe/openerp/tests/test_server.py (+3/-3)
anybox/recipe/openerp/tests/test_utils.py (+25/-0)
anybox/recipe/openerp/upgrade.py.tmpl (+19/-0)
anybox/recipe/openerp/utils.py (+34/-7)
anybox/recipe/openerp/vcs/bzr.py (+9/-2)
anybox/recipe/openerp/vcs/git.py (+2/-1)
anybox/recipe/openerp/vcs/tests/test_bzr.py (+33/-3)
anybox/recipe/openerp/vcs/tests/test_git.py (+3/-0)
buildbot/MANIFEST.cfg (+56/-27)
buildbot/base_recipe.cfg (+24/-0)
buildbot/recipe-50.cfg (+1/-18)
buildbot/recipe-60-custom.cfg (+9/-18)
buildbot/recipe-60.cfg (+2/-11)
buildbot/recipe-61-custom.cfg (+2/-12)
buildbot/recipe-61.cfg (+1/-10)
buildbot/recipe-7.0.cfg (+1/-12)
buildbot/recipe-latest.cfg (+2/-11)
buildbot/recipe-nightly.cfg (+1/-10)
buildbot/recipe-trunk.cfg (+1/-11)
buildbot/stable-recipe-50.cfg (+4/-0)
buildbot/stable-recipe-60.cfg (+4/-0)
buildbot/stable-recipe-61.cfg (+4/-0)
buildbot/stable-recipe-7.0.cfg (+0/-42)
buildbot/stable-recipe-nightly.cfg (+4/-0)
doc/Makefile (+177/-0)
doc/apidoc/anybox.recipe.openerp.rst (+75/-0)
doc/apidoc/anybox.recipe.openerp.runtime.rst (+50/-0)
doc/apidoc/anybox.recipe.openerp.vcs.rst (+59/-0)
doc/conf.py (+247/-0)
doc/configuration.rst (+613/-713)
doc/contributing.rst (+187/-0)
doc/dev_prod_workflow.rst (+32/-0)
doc/first_steps.rst (+351/-0)
doc/index.rst (+79/-0)
doc/scripts.rst (+471/-0)
doc/sphinx_static/default.css (+267/-0)
doc/sphinx_templates/layout.html (+203/-0)
setup.py (+5/-3)
test-cover (+1/-1)
tests_with_openerp/README.txt (+1/-0)
tests_with_openerp/data/VERSION.txt (+5/-0)
tests_with_openerp/test_version.py (+59/-0)
To merge this branch: bzr merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict
Reviewer Review Type Date Requested Status
Jacques-Etienne Baudoux Pending
Review via email: mp+205084@code.launchpad.net

Description of the change

Update with trunk branch to resolve a small conflict (ll.1200-1202 in the diff).

To post a comment you must log in.
425. By Stefan Rijnhart (Opener)

[FIX] Use unquoted substitution

Unmerged revisions

425. By Stefan Rijnhart (Opener)

[FIX] Use unquoted substitution

424. By Stefan Rijnhart (Opener)

[MRG] Update with target branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-09-07 12:04:02 +0000
3+++ .bzrignore 2014-02-06 07:42:46 +0000
4@@ -11,3 +11,4 @@
5 buildbot/develop-eggs/
6 buildbot/etc/
7 buildbot/parts/
8+doc/sphinx_build
9
10=== modified file 'CHANGES.rst'
11--- CHANGES.rst 2013-09-07 11:43:18 +0000
12+++ CHANGES.rst 2014-02-06 07:42:46 +0000
13@@ -1,13 +1,53 @@
14 Changes
15 ~~~~~~~
16
17-1.8.0 (unreleased)
18-------------------
19+The 1.7 series are stable versions, while the 1.8 are unstable.
20+Changes displayed as "unreleased" in th stable series are released
21+with any higher released unstable versions.
22+
23+1.8.2 (unreleased)
24+------------------
25+- launchpad #1275168: when freeze nightly version was not set correctly
26+- launchpad #1245261: new ``--init-all`` option in ``test_openerp``
27+ and ``start_openerp`` scripts.
28+
29+1.8.1 (2013-10-17)
30+------------------
31+- launchpad #1235946 (demo data): consistent behaviour and capability
32+ to load them.
33+- launchpad #1239721: now session has 'is_initialization' attribute for
34+ creation use-cases of upgrade script; using it to improve logging,
35+ and in default upgrade script.
36+
37+
38+1.8.0 (2013-10-01)
39+------------------
40+- launchpad #1222482: upgrade toolkit and upgrade scripts generation
41 - launchpad #1222116: [Gunicorn] option to preload databases
42
43-1.7.2 (unreleased)
44-------------------
45-
46+1.7.4 (unreleased)
47+------------------
48+- launchpad #1246822: restored the ordering of addons_path as it was
49+ in 1.7.0 (main addons first).
50+
51+1.7.3 (2013-10-17)
52+------------------
53+- Fixed the licence in ``setup.py`` and hence on PyPI page. The ZPL
54+ indicated was contradictory with what is stated on Launchpad's
55+ project page, and plain non applicable, since the recipe *does* import
56+ from OpenERP.
57+- launchpad #1232806: custom interpreter and openerp_scripts now work
58+ with OpenERP 6.1
59+- launchpad #1233606: [bzr] lightweight checkout now respects --offline
60+
61+1.7.2 (2013-09-29)
62+------------------
63+- launchpad #1232724: [gunicorn] properly switching openerp to
64+ multi-process mode
65+- SAAS versions now recognized, and treated as X.5
66+- launchpad #1228997: [v5] in some cases, start_openerp --stop-after-init was
67+ not honoured.
68+- launchpad #1222562: [git] error in extract-downloads-to
69
70 1.7.1 (2013-09-07)
71 ------------------
72
73=== modified file 'MANIFEST.in'
74--- MANIFEST.in 2012-11-07 18:41:15 +0000
75+++ MANIFEST.in 2014-02-06 07:42:46 +0000
76@@ -2,3 +2,4 @@
77 include anybox/recipe/openerp/openerp-cron-worker
78 include buildbot/*.cfg
79 include buildbot/bootstrap.py
80+include anybox/recipe/openerp/upgrade.py.tmpl
81\ No newline at end of file
82
83=== added file 'README.rst'
84--- README.rst 1970-01-01 00:00:00 +0000
85+++ README.rst 2014-02-06 07:42:46 +0000
86@@ -0,0 +1,75 @@
87+OpenERP buildout recipe
88+=======================
89+This recipe for `Buildout <https://github.com/buildout/buildout>`_ is
90+a fully featured tool allowing you to define and deploy quickly
91+OpenERP installations of any kinds, ranging from development setups to
92+fully automated production deployments or continuous integration.
93+
94+Some of its main features include:
95+
96+* uniformity across OpenERP versions (from 5.0 onwards)
97+* installation of OpenERP server and, if meaningful, GTK and web clients.
98+* retrieval of main software and addons from various sources,
99+ including the major version control systems
100+* ability to pinpoint everything for replayability
101+* management of OpenERP configuration
102+* dedicated scripts creation for easy integration of external tools,
103+ such as test launchers
104+* packaging: creation of self-contained equivalents for easy
105+ deployment in tightly controlled hosting environmenents.
106+
107+All these to be considered together with zc.buildout‘s general
108+properties, such as an extensible configuration file format for easy
109+variation or separation of concerns, native Python distributions
110+installation, and of course the huge ecosystem of other recipes.
111+
112+The `full documentation
113+<http://pythonhosted.org/anybox.recipe.openerp>`_
114+is written with `Sphinx
115+<http://sphinx-doc.org>`_, built continuously and
116+uploaded to http://docs.anybox.fr/anybox.recipe.openerp by Anybox' public
117+buildbot.
118+The Sphinx source tree is to be found under the ``doc`` subdirectory
119+of this project.
120+
121+The latest released version of the documentation is uploaded to PyPI
122+alongside with the package. See `PyPIDocumentationHosting
123+<https://wiki.python.org/moin/PyPiDocumentationHosting>`_ for details.
124+
125+Bug reports and Feedback
126+~~~~~~~~~~~~~~~~~~~~~~~~
127+Please don't hesitate to give feedback and especially report bugs or
128+ask for new features through launchpad at this URL:
129+https://bugs.launchpad.net/anybox.recipe.openerp/+bugs
130+
131+Useful links
132+~~~~~~~~~~~~
133+
134+* Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp
135+* PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp
136+* Main documentation: http://docs.anybox.fr/anybox.recipe.openerp
137+
138+
139+Contributors information
140+~~~~~~~~~~~~~~~~~~~~~~~~
141+
142+See `the latest version of the contributors documentation
143+<http://docs.anybox.fr/anybox.recipe.openerp/trunk/contributing.html>`_.
144+
145+
146+Credits
147+~~~~~~~
148+
149+Authors:
150+
151+ * Christophe Combelles
152+ * Georges Racinet
153+
154+Contributors:
155+
156+ * Jean-Sébastien Suzanne
157+ * Yannick Vaucher
158+ * Jacques-Etienne Baudoux
159+ * Laurent Mignon
160+ * Leonardo Pistone
161+
162
163=== modified file 'anybox/recipe/openerp/base.py'
164--- anybox/recipe/openerp/base.py 2013-09-08 13:48:02 +0000
165+++ anybox/recipe/openerp/base.py 2014-02-06 07:42:46 +0000
166@@ -37,6 +37,13 @@
167
168 class MainSoftware(object):
169 """Placeholder to represent the main software instead of an addon location.
170+
171+ Should just have a singleton instance: :data:`main_software`,
172+ whose meaning depends on the concrete recipe class using it.
173+
174+ For example, in :class:`anybox.recipe.openerp.server.ServerRecipe`,
175+ :data:`main_software` represents the OpenObject server or the OpenERP
176+ standard distribution.
177 """
178
179 def __str__(self):
180@@ -51,24 +58,32 @@
181 """Base class for other recipes.
182
183 It implements notably fetching of the main software part plus addons.
184- The ``sources`` attributes is a dict storing how to fetch the main software
185- part and specified addons. It has the following structure:
186-
187- local path -> (type, location_spec, options).
188-
189- where local path is the ``main_software`` object for the main software
190- part, and otherwise a local path to an addons container.
191-
192- type can be
193- - 'local'
194- - 'downloadable'
195- - one of the supported vcs
196-
197- location_spec is, depending on the type, a tuple specifying how to
198- fetch : (url, None), or (vcs_url, vcs_revision) or None
199-
200- addons options are typically used to specify that the addons directory
201- is actually a subdir of the specified one.
202+
203+ The :attr:`sources` attribute is a ``dict`` storing how to fetch the main
204+ software part and the specified addons, with the following structure:
205+
206+ ``local path -> (type, location_spec, options)``, in which:
207+
208+ :local path: is either the :data:`main_software` singleton
209+ (see :class:`MainSoftware`) or a local path to an
210+ addons directory.
211+ :type: can be either
212+
213+ * ``'local'``
214+ * ``'downloadable'``
215+ * one of the supported vcs
216+
217+ :location_spec: is, depending on the type, a tuple specifying how
218+ fetch is to be done:
219+
220+ ``(url, None)``, or ``(vcs_url, vcs_revision)``
221+ or ``None``
222+ :addons options: are typically used to specify that the addons
223+ directory is actually a subdir of the specified one.
224+
225+ VCS support classes (see
226+ :mod:`anybox.recipe.openerp.vcs`) can implemented their
227+ dedicated options
228
229 """
230
231@@ -164,7 +179,7 @@
232 self.parse_revisions(options)
233
234 def parse_version(self):
235- """Set the main software in ``sources`` and related attributes.
236+ """Set the main software in :attr:`sources` and related attributes.
237 """
238 self.version_wanted = self.options.get('version')
239 if self.version_wanted is None:
240@@ -438,9 +453,9 @@
241 os.putenv('PYTHONPATH', pythonpath_bak)
242
243 def parse_addons(self, options):
244- """Parse the addons options into the ``sources`` attribute.
245+ """Parse the addons options into :attr:`sources`.
246
247- See ``BaseRecipe`` docstring for details about the ``sources`` dict.
248+ See :class:`BaseRecipe` for the structure of :attr:`sources`.
249 """
250
251 for line in options.get('addons', '').split(os.linesep):
252@@ -462,11 +477,13 @@
253 self.sources[addons_dir] = (loc_type, location_spec, options)
254
255 def parse_revisions(self, options):
256- """Parse revisions options and update the ``sources`` attribute.
257+ """Parse revisions options and update :attr:`sources`.
258
259- It is assumed that ``sources`` has already been populated, and
260- notably has a main_software part.
261+ It is assumed that :attr:`sources` has already been populated, and
262+ notably has a :data:`main_software` entry.
263 This allows for easy fixing of revisions in an extension buildout
264+
265+ See :class:`BaseRecipe` for the structure of :attr:`sources`.
266 """
267 for line in options.get('revisions', '').split(os.linesep):
268 # GR inline comment should have not gone through, but sometimes
269@@ -505,11 +522,9 @@
270 + source[2:])
271
272 def retrieve_addons(self):
273- """Parse the addons option line, download and return a list of paths.
274+ """Peform all lookup and downloads specified in :attr:`sources`.
275
276- syntax: repo_type repo_url repo_dir repo_rev [options]
277- or an absolute or relative path
278- options are themselves in the key=value form
279+ See :class:`BaseRecipe` for the structure of :attr:`sources`.
280 """
281 self.addons_paths = []
282 for local_dir, source_spec in self.sources.items():
283@@ -623,7 +638,10 @@
284 logger.info("No need to re-download %s", self.archive_path)
285
286 def retrieve_main_software(self):
287- """install server, webclient or gtkclient."""
288+ """Lookup or fetch the main software.
289+
290+ See :class:`MainSoftware` and :class:`BaseRecipe` for explanations.
291+ """
292
293 source = self.sources[main_software]
294 type_spec = source[0]
295@@ -751,7 +769,7 @@
296 def dump_nightly_latest_version(self):
297 """After download/analysis of 'nightly latest', give equivalent spec.
298 """
299- return ' '.join((self.nightly_series, 'nightly', self.nightly_version))
300+ return ' '.join(('nightly', self.nightly_series, self.nightly_version))
301
302 def freeze_to(self, out_config_path):
303 """Create an extension buildout freezing current revisions & versions.
304@@ -1141,7 +1159,7 @@
305 else:
306 base_addons = join(self.openerp_dir, 'openerp', 'addons')
307 if os.path.exists(base_addons):
308- self.addons_paths.append(base_addons)
309+ self.addons_paths.insert(0, base_addons)
310
311 if check_existence:
312 for path in self.addons_paths:
313
314=== added directory 'anybox/recipe/openerp/runtime'
315=== added file 'anybox/recipe/openerp/runtime/__init__.py'
316--- anybox/recipe/openerp/runtime/__init__.py 1970-01-01 00:00:00 +0000
317+++ anybox/recipe/openerp/runtime/__init__.py 2014-02-06 07:42:46 +0000
318@@ -0,0 +1,39 @@
319+"""
320+Runtime
321+=======
322+
323+This subpackage provides encapsulations and entry points for the application
324+itself:
325+
326+* the ``session`` module features the supporting objects for "OpenERP scripts"
327+ and the dedicated python interpreter.
328+* the ``start_openerp`` and ``test_openerp`` modules are the entry points for
329+ the main startup scripts.
330+
331+This architecture is meant in particular to provide stability and uniformity
332+accross OpenERP major versions, so that the recipe can be leveraged by
333+automated deploymnent tools and continuous integration systems.
334+"""
335+
336+_imported_addons = set()
337+
338+
339+def already_imported(module_name):
340+ """Convenience to help some OpenERP modules to avoid been imported twice.
341+
342+ Each call of this function returns a boolean indicated whether the
343+ specified module was already in the ``imported_addons`` registry and add it
344+ inconditionnally.
345+
346+ Thus caller code is expected to import the module right away if the
347+ return value was False.
348+ """
349+ name = module_name.rsplit('.', 1)[-1]
350+ if name in _imported_addons:
351+ return True
352+ _imported_addons.add(name)
353+ return False
354+
355+
356+def clear_import_registry():
357+ _imported_addons.clear()
358
359=== added directory 'anybox/recipe/openerp/runtime/backports'
360=== added file 'anybox/recipe/openerp/runtime/backports/__init__.py'
361--- anybox/recipe/openerp/runtime/backports/__init__.py 1970-01-01 00:00:00 +0000
362+++ anybox/recipe/openerp/runtime/backports/__init__.py 2014-02-06 07:42:46 +0000
363@@ -0,0 +1,1 @@
364+# python package
365
366=== added directory 'anybox/recipe/openerp/runtime/backports/cli'
367=== added file 'anybox/recipe/openerp/runtime/backports/cli/__init__.py'
368--- anybox/recipe/openerp/runtime/backports/cli/__init__.py 1970-01-01 00:00:00 +0000
369+++ anybox/recipe/openerp/runtime/backports/cli/__init__.py 2014-02-06 07:42:46 +0000
370@@ -0,0 +1,1 @@
371+# python package
372
373=== added file 'anybox/recipe/openerp/runtime/backports/cli/server.py'
374--- anybox/recipe/openerp/runtime/backports/cli/server.py 1970-01-01 00:00:00 +0000
375+++ anybox/recipe/openerp/runtime/backports/cli/server.py 2014-02-06 07:42:46 +0000
376@@ -0,0 +1,87 @@
377+# -*- coding: utf-8 -*-
378+
379+##############################################################################
380+#
381+# OpenERP, Open Source Management Solution
382+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
383+#
384+# This program is free software: you can redistribute it and/or modify
385+# it under the terms of the GNU Affero General Public License as
386+# published by the Free Software Foundation, either version 3 of the
387+# License, or (at your option) any later version.
388+#
389+# This program is distributed in the hope that it will be useful,
390+# but WITHOUT ANY WARRANTY; without even the implied warranty of
391+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
392+# GNU Affero General Public License for more details.
393+#
394+# You should have received a copy of the GNU Affero General Public License
395+# along with this program. If not, see <http://www.gnu.org/licenses/>.
396+#
397+##############################################################################
398+#
399+# anybox.recipe.openerp is also under AGPL v3+
400+#
401+
402+"""
403+Copied from OpenERP 6.1's openerp-server startup script.
404+
405+This makes utilitary functions available to the session module.
406+"""
407+
408+import logging
409+import os
410+import sys
411+
412+try:
413+ import openerp
414+except:
415+ # this file must stay importable by nose tests
416+ pass
417+else:
418+ __author__ = openerp.release.author
419+ __version__ = openerp.release.version
420+
421+ if openerp.release.version_info < (6, 1):
422+ raise RuntimeError("Interpreter and scripts not compatible "
423+ "with OpenERP < 6.1")
424+
425+# Also use the `openerp` logger for the main script.
426+_logger = logging.getLogger('openerp')
427+
428+
429+def check_root_user():
430+ """ Exit if the process's user is 'root' (on POSIX system)."""
431+ if os.name == 'posix':
432+ import pwd
433+ if pwd.getpwuid(os.getuid())[0] == 'root':
434+ sys.stderr.write("Running as user 'root' is a security risk, "
435+ "aborting.\n")
436+ sys.exit(1)
437+
438+
439+def check_postgres_user():
440+ """ Exit if the configured database user is 'postgres'.
441+
442+ This function assumes the configuration has been initialized.
443+ """
444+ config = openerp.tools.config
445+ if config['db_user'] == 'postgres':
446+ sys.stderr.write("Using the database user 'postgres' is a "
447+ "security risk, aborting.")
448+ sys.exit(1)
449+
450+
451+def report_configuration():
452+ """ Log the server version and some configuration values.
453+
454+ This function assumes the configuration has been initialized.
455+ """
456+ config = openerp.tools.config
457+ _logger.info("OpenERP version %s", __version__)
458+ for name, value in [('addons paths', config['addons_path']),
459+ ('database hostname',
460+ config['db_host'] or 'localhost'),
461+ ('database port', config['db_port'] or '5432'),
462+ ('database user', config['db_user'])]:
463+ _logger.info("%s: %s", name, value)
464
465=== renamed file 'anybox/recipe/openerp/patch_openerp_v5.py' => 'anybox/recipe/openerp/runtime/patch_openerp_v5.py'
466=== renamed file 'anybox/recipe/openerp/startup.py' => 'anybox/recipe/openerp/runtime/session.py'
467--- anybox/recipe/openerp/startup.py 2013-07-24 15:59:29 +0000
468+++ anybox/recipe/openerp/runtime/session.py 2014-02-06 07:42:46 +0000
469@@ -1,69 +1,369 @@
470 """Utilities to start a server process."""
471 import warnings
472 import sys
473+import os
474 import logging
475+from distutils.version import Version
476+
477+
478 try:
479 import openerp
480 except ImportError:
481 warnings.warn("This must be imported with a buildout openerp recipe "
482 "driven sys.path", RuntimeWarning)
483 else:
484- from openerp.cli import server as startup
485+ try:
486+ from openerp.cli import server as startup
487+ except ImportError:
488+ from .backports.cli import server as startup
489 from openerp.tools import config
490+ from openerp import SUPERUSER_ID
491+ from openerp.tools.parse_version import parse_version
492+
493 from optparse import OptionParser # we support python >= 2.6
494
495 logger = logging.getLogger(__name__)
496
497+DEFAULT_VERSION_PARAMETER = 'buildout.db_version'
498+
499+DEFAULT_VERSION_FILE = 'VERSION.txt'
500+
501+
502+class OpenERPVersion(Version):
503+ """OpenERP idea of version, wrapped in a class.
504+
505+ This is based on :meth:`openerp.tools.parse_version`, and
506+ Provides straight-ahead comparison with tuples of integers, or
507+ distutils Version classes.
508+ """
509+
510+ def parse(self, incoming):
511+ if isinstance(incoming, OpenERPVersion):
512+ self.vstring = incoming.vstring
513+ self.components = incoming.components
514+ else:
515+ self.vstring = incoming
516+ self.components = parse_version(incoming)
517+
518+ def __str__(self):
519+ return self.vstring
520+
521+ def __repr__(self):
522+ return 'OpenERPVersion(%r)' % str(self)
523+
524+ def __cmp__(self, other):
525+ if isinstance(other, tuple):
526+ other = '.'.join(str(s) for s in other)
527+ elif not isinstance(other, self.__class__):
528+ other = str(other) # Works with distutils' Version classes
529+
530+ other = self.__class__(other)
531+ return cmp(self.components, other.components)
532+
533
534 class Session(object):
535- """A class to represent the server object.
536-
537- you should have exactly one per process.
538-
539- Before actual use, call the ``bootstrap`` method.
540- Then you have useful attributes/methods behaving like unit test classes:
541-
542- self.cr: a cursor
543- self.uid: user id
544+ """A class to give server-level access to one database.
545+
546+ There should be exactly one instance of this class per process.
547+ It can be used for any kind of script involving OpenERP API, and provides
548+ facilities for upgrade scripts (see also
549+ :mod:anybox.recipe.openerp.runtime.upgrade)
550+
551+ Before actual use, call :meth:`open`.
552+ Then you'll have useful attributes and methods reminiscent of the unit test
553+ classes:
554+
555+ * :attr:`cr`: a cursor
556+ * :attr:`uid`: user id
557+ * :attr:`registry`: access to model objects
558+ * :attr:`is_initialization`: True if and only if the database was not
559+ initialized before the call to :meth:`open`
560+
561+ Example application code::
562+
563+ session.open(db_name="my_db")
564+ admin = session.registry('res_users').browse(session.cr, session.uid, 1)
565+ (...)
566+ session.cr.commit()
567+ session.close()
568+
569+ Transaction management is up to user code
570+
571+ Upgrade scripts writers should check the version handling properties:
572+
573+ * :meth:`db_version`
574+ * :meth:`package_version`
575+
576+ Instantiation is done by passing the path to OpenERP main
577+ configuration file and the path of the buildout directory.
578+
579+ Usually, instantiation code is written by the recipe in the body of the
580+ executable "OpenERP scripts" it produces.
581+ Script writers provide a callable that takes a
582+ :class:`.Session` object argument and declare it as a console script entry
583+ point in their distribution.
584+ End users can reference such entry points in their buildout configurations
585+ to have buildout produce the actual executable. See :doc:`/scripts`
586+ for details.
587+
588+ Upgrade scripts are a special case of that process, in which the entry
589+ point is actually provided by the recipe and rewraps a user-level
590+ source script.
591+
592+ Later versions of the recipe may find a way to pass the whole buildout
593+ configuration (recall that this is to be used in a separate process in
594+ which the buildout configuration has not been parsed).
595 """
596
597- def __init__(self, conffile):
598+ def __init__(self, conffile, buildout_dir, parse_config=True):
599+ self.buildout_dir = buildout_dir
600+ self.openerp_config_file = conffile
601+
602 self._registry = self.cr = None
603- config.parse_config(['-c', conffile])
604+ if parse_config:
605+ config.parse_config(['-c', conffile])
606
607 def ready(self):
608 return self._registry is not None
609
610- def open(self, db=None):
611+ def open(self, db=None, with_demo=False):
612+ """Load the database
613+
614+ Loading an empty database in OpenERP has the side effect of installing
615+ the ``base`` module. Whether to loading demo data or not has therefore
616+ to be decided right away.
617+
618+ :param db: database name. If not specified, the same cascading of
619+ defaults as OpenERP mainstream will be applied:
620+ configuration file, psycopg2/lipq defaults.
621+ :param with_demo: controls the loading of demo data for all
622+ module installations triggered by this call to
623+ :meth:`open` and further uses of :meth:`load_modules`
624+ on this :class:`Session` instance:
625+
626+ * if ``True``, demo data will uniformly be loaded
627+ * if ``False``, no demo data will be loaded
628+ * if ``None``, demo data will be loaded according to
629+ the value of ``without_demo`` in configuration
630+
631+ In all cases, the behaviour will stay consistent
632+ until the next call of ``open()``, but the
633+ implementation does not protect against any race
634+ conditions in OpenERP internals.
635+ """
636 if db is None:
637 db = config['db_name']
638 if not db:
639- db = '' # default to OpenERP/psycopg2/lipbq default behaviour
640+ db = '' # expected value expected by OpenERP to start defaulting.
641+
642+ cnx = openerp.sql_db.db_connect(db)
643+ cr = cnx.cursor()
644+ self.is_initialization = not(openerp.modules.db.is_initialized(cr))
645+ cr.close()
646+
647 startup.check_root_user()
648 startup.check_postgres_user()
649 openerp.netsvc.init_logger()
650+
651+ saved_without_demo = config['without_demo']
652+ if with_demo is None:
653+ with_demo = config['without_demo']
654+
655+ config['without_demo'] = not with_demo
656+ self.with_demo = with_demo
657+
658 self._registry = openerp.modules.registry.RegistryManager.get(
659 db, update_module=False)
660+ config['without_demo'] = saved_without_demo
661 self.init_cursor()
662+ self.uid = SUPERUSER_ID
663+
664+ # A later version might read that from buildout configuration.
665+ _version_parameter_name = DEFAULT_VERSION_PARAMETER
666+
667+ @property
668+ def version_file_path(self):
669+ """Absolute path of the flat file storing the package version.
670+
671+ For now this is not configurable, a later version might read it
672+ from buildout configuration.
673+ """
674+ return os.path.join(self.buildout_dir, DEFAULT_VERSION_FILE)
675+
676+ def parse_version_string(self, vstring):
677+ """Stable method for downstream code needing to instantiate a version.
678+
679+ This method returns an appropriate version instance, without
680+ any dependency on where to import the class from. Especially useful
681+ for applications whose life started before this set of utilities has
682+ been used : this helps building an usable default.
683+ """
684+ return OpenERPVersion(vstring)
685+
686+ @property
687+ def db_version(self):
688+ """Settable property for version stored in DB of the whole buildout.
689+
690+ This can be thought as the latest version to which the DB has been
691+ upgraded to.
692+ A simple caching system to avoid querying the DB multiple times is
693+ implemented.
694+ """
695+ db_version = getattr(self, '_db_version', None)
696+ if db_version is not None:
697+ return db_version
698+
699+ db_version = self.registry('ir.config_parameter').get_param(
700+ self.cr, self.uid, self._version_parameter_name)
701+ if not db_version:
702+ # as usual OpenERP thinks its simpler to use False as None
703+ # restoring sanity ASAP
704+ db_version = None
705+ else:
706+ db_version = OpenERPVersion(db_version)
707+ self._db_version = db_version
708+ return db_version
709+
710+ @db_version.setter
711+ def db_version(self, version):
712+ self.registry('ir.config_parameter').set_param(
713+ self.cr, self.uid, self._version_parameter_name, str(version))
714+ self._db_version = OpenERPVersion(version)
715+
716+ @property
717+ def package_version(self):
718+ """Property reading the version file from buildout directory.
719+
720+ Comments introduced with a hash are accepted.
721+ Only the first significant line is taken into account.
722+ """
723+ pkg_version = getattr(self, '_pkg_version', None)
724+ if pkg_version is not None:
725+ return pkg_version
726+
727+ try:
728+ with open(self.version_file_path) as f:
729+ for line in f:
730+ line = line.split('#', 1)[0].strip()
731+ if not line:
732+ continue
733+ self._pkg_version = OpenERPVersion(line)
734+ return self._pkg_version
735+ except IOError:
736+ logger.info("No version file could be read, "
737+ "package version considered to be None")
738+
739+ def update_modules_list(self):
740+ """Update the list of available OpenERP modules, like the UI allows to.
741+
742+ This is necessary prior to install of any new module.
743+ """
744+ self.registry('ir.module.module').update_list(self.cr, self.uid)
745
746 def init_cursor(self):
747 self.cr = self._registry.db.cursor()
748
749 def registry(self, model):
750- """Return the model object."""
751+ """Lookup model by name and return a ready-to-work instance."""
752 return self._registry.get(model)
753
754 def rollback(self):
755 self.cr.rollback()
756
757 def close(self):
758+ """Close the cursor and forget about the current database.
759+
760+ The session is thus ready to open another database.
761+ """
762+ dbname = self.cr.dbname
763 self.cr.close()
764+ openerp.modules.registry.RegistryManager.delete(dbname)
765+
766+ def update_modules(self, modules, db=None):
767+ """Update the prescribed modules in the database.
768+
769+ :param db: Database name. If not specified, it is assumed to have
770+ already been opened with :meth:`open`, e.g, for a prior
771+ read of :meth:`db_version`.
772+ If it is specified, then the session in particular opens
773+ that db and will use it afterwards whether another one
774+ was already opened or not.
775+ :param modules: any iterable of module names.
776+ Not installed modules will be ignored
777+ The special name ``'all'`` triggers the update of
778+ all installed modules.
779+ """
780+ if db is None:
781+ if self.cr is None:
782+ raise ValueError("update_modules needs either the session to "
783+ "be opened or an explicit database name")
784+ db = self.cr.dbname
785+
786+ if self.cr is not None:
787+ self.close()
788+ for module in modules:
789+ config['update'][module] = 1
790+ self._registry = openerp.modules.registry.RegistryManager.get(
791+ db, update_module=True)
792+ config['update'].clear()
793+ self.init_cursor()
794+
795+ def install_modules(self, modules, db=None, update_modules_list=True,
796+ open_with_demo=False):
797+ """Install the modules in the database.
798+
799+ Has the side effect of closing the current cursor, committing if and
800+ only if the list of modules is updated.
801+
802+ Demo data loading is handled consistently with the decision taken
803+ by :meth:`open`.
804+
805+ :param db: Database name. If not specified, it is assumed to have
806+ already been opened with :meth:`open`, e.g, for a prior
807+ read of :meth:`db_version`.
808+ If it is specified, then the session in particular opens
809+ that db and will use it afterwards whether another one
810+ was already opened or not.
811+ :param modules: any iterable of module names.
812+ :param update_modules_list: if True, will update the module lists
813+ *and commit* before the install begins.
814+ :param open_with_demo: if ``db`` is not None, will be passed to
815+ :meth:`open`.
816+ """
817+ already_open = self.cr is not None
818+ if db is None:
819+ if not already_open:
820+ raise ValueError("install_modules needs either the session to "
821+ "be opened or an explicit database name")
822+ db = self.cr.dbname
823+ elif update_modules_list and not (
824+ already_open and self.cr.dbname == db):
825+ self.open(db=db, with_demo=open_with_demo)
826+
827+ if update_modules_list:
828+ self.update_modules_list()
829+ self.cr.commit()
830+
831+ if self.cr is not None:
832+ self.close()
833+ saved_without_demo = config['without_demo']
834+
835+ # with update_modules_list=False, an explicitely named DB would not
836+ # have gone through open() yet.
837+ config['without_demo'] = not getattr(self, 'with_demo', open_with_demo)
838+ for module in modules:
839+ config['init'][module] = 1
840+ self._registry = openerp.modules.registry.RegistryManager.get(
841+ db, update_module=True, force_demo=self.with_demo)
842+ config['init'].clear()
843+ config['without_demo'] = saved_without_demo
844+ self.init_cursor()
845
846 def handle_command_line_options(self, to_handle):
847 """Handle prescribed command line options and eat them.
848
849- Anything before first occurrence of '--' is ours and removed from
850- sys.argv.
851+ Anything before first occurrence of ``--`` on the command-line is taken
852+ into account and removed from ``sys.argv``.
853
854 Help messages:
855
856@@ -118,17 +418,3 @@
857 logger.info("No database specified, using the one specified "
858 "in buildout configuration.")
859 self.open(db=options.db_name)
860-
861-_imported_addons = set()
862-
863-
864-def already_imported(module_name):
865- name = module_name.rsplit('.', 1)[-1]
866- if name in _imported_addons:
867- return True
868- _imported_addons.add(name)
869- return False
870-
871-
872-def clear_import_registry():
873- _imported_addons.clear()
874
875=== renamed file 'anybox/recipe/openerp/start_openerp.py' => 'anybox/recipe/openerp/runtime/start_openerp.py'
876--- anybox/recipe/openerp/start_openerp.py 2013-08-04 18:23:29 +0000
877+++ anybox/recipe/openerp/runtime/start_openerp.py 2014-02-06 07:42:46 +0000
878@@ -1,14 +1,38 @@
879+"""This module bridges the classical ``openerp-server`` as a console script.
880+
881+The :func:`main` function gets registered on the fly by the server recipe as
882+a console script entry point and used in particular for ``start_openerp`` and
883+``test_openerp``.
884+
885+Some version independence logic for the startup process also get bootstrapped
886+from here.
887+"""
888+
889 import sys
890 import os
891 from . import patch_openerp_v5
892
893
894 def insert_args(arguments):
895+ """Insert `arguments` in ``sys.argv`` (direct impact on child script).
896+ """
897 for i, a in enumerate(arguments):
898 sys.argv.insert(i+1, a)
899
900
901 def main(starter, conf, version=None, just_test=False):
902+ """Call the `starter` script, dispatching configuration.
903+
904+ All arguments are set in the standalone script produced by buildout through
905+ entry point options.
906+
907+ :param starter: path to the main script source file (currently
908+ ``openerp-server``)
909+ :param conf: path to the OpenERP configuration file (managed by the recipe)
910+ :param version: OpenERP major version
911+ :type version: tuple of integers
912+ :param just_test: if True, only run unit tests
913+ """
914 arguments = ['-c', conf]
915
916 if just_test:
917@@ -19,6 +43,16 @@
918 if version >= (7, 0):
919 arguments.append('--test-enable')
920
921+ if '--install-all' in sys.argv:
922+ sys.argv.remove('--install-all')
923+ from openerp.tools import config
924+ # Maybe we should preparse config in all cases and therefore avoid
925+ # adding the '-c' on the fly ?
926+ # Still, cautious about pre-6.1 versions
927+ config.parse_config(['-c', conf])
928+ from openerp.modules import get_modules
929+ arguments.extend(('-i', ','.join(get_modules())))
930+
931 insert_args(arguments)
932
933 if version == (5, 0):
934@@ -28,4 +62,12 @@
935 glob = globals()
936 glob['__name__'] = '__main__'
937 glob['__file__'] = starter
938- execfile(starter, globals())
939+ try:
940+ execfile(starter, globals())
941+ except SystemExit as exc:
942+ if version == (5, 0):
943+ # Without Agent.quit() the Timer threads may go on forever
944+ # and the script will never stop
945+ import netsvc
946+ netsvc.Agent.quit()
947+ return exc.code
948
949=== renamed file 'anybox/recipe/openerp/test_openerp.py' => 'anybox/recipe/openerp/runtime/test_openerp.py'
950=== added directory 'anybox/recipe/openerp/runtime/tests'
951=== added file 'anybox/recipe/openerp/runtime/tests/__init__.py'
952--- anybox/recipe/openerp/runtime/tests/__init__.py 1970-01-01 00:00:00 +0000
953+++ anybox/recipe/openerp/runtime/tests/__init__.py 2014-02-06 07:42:46 +0000
954@@ -0,0 +1,1 @@
955+# python package
956
957=== renamed file 'anybox/recipe/openerp/tests/test_startup.py' => 'anybox/recipe/openerp/runtime/tests/test_import_registry.py'
958--- anybox/recipe/openerp/tests/test_startup.py 2013-06-15 11:33:47 +0000
959+++ anybox/recipe/openerp/runtime/tests/test_import_registry.py 2014-02-06 07:42:46 +0000
960@@ -1,5 +1,5 @@
961 from unittest import TestCase
962-from ..startup import already_imported, clear_import_registry
963+from .. import already_imported, clear_import_registry
964
965
966 class TestImportRegistry(TestCase):
967
968=== added file 'anybox/recipe/openerp/runtime/upgrade.py'
969--- anybox/recipe/openerp/runtime/upgrade.py 1970-01-01 00:00:00 +0000
970+++ anybox/recipe/openerp/runtime/upgrade.py 2014-02-06 07:42:46 +0000
971@@ -0,0 +1,153 @@
972+"""Uniform encapsulation of buildout-local upgrade script.
973+
974+The idea is to provide a common set of options, so that upgrade scripts all
975+have the same interface, and project maintainers can focus on the decision
976+taking logic.
977+"""
978+import os
979+import sys
980+import imp
981+import logging
982+from argparse import ArgumentParser
983+from argparse import ArgumentDefaultsHelpFormatter
984+from argparse import SUPPRESS
985+from datetime import datetime
986+from math import ceil
987+
988+from .session import Session
989+
990+DEFAULT_LOG_FILE = 'upgrade.log'
991+
992+
993+def upgrade(upgrade_script, upgrade_callable, conf, buildout_dir):
994+ """Run the upgrade from a source file.
995+
996+ All arguments are set in the standalone script produced by buildout through
997+ entry point options.
998+
999+ * ``upgrade_script``: absolute path to the upgrade script python source.
1000+ * ``upgrade_callable``: name of the callable in source file actually
1001+ running the script.
1002+
1003+ It must accept the two following positional arguments, in that order:
1004+
1005+ - a :class:`.Session` instance (as in standard "OpenERP scripts")
1006+ - a logger (standard object from the :mod:`logging` module)
1007+
1008+ and may return a non zero status code to indicate an error.
1009+ Both ``None`` and 0 are interpreted as success.
1010+
1011+ * ``conf``: path to the OpenERP configuration file (managed by the recipe)
1012+ * ``buildout_dir``: directory of the buildout
1013+ """
1014+
1015+ parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter,
1016+ epilog="")
1017+ parser.add_argument('--log-file', default=DEFAULT_LOG_FILE,
1018+ help="File to log sub-operations to, relative to the "
1019+ "current working directory, supports homedir "
1020+ "expansion ('~' on POSIX systems).")
1021+ parser.add_argument('--log-level', default='info',
1022+ help="Main OpenERP logging level. Does not affect the "
1023+ "logging from the main upgrade script itself.")
1024+ parser.add_argument('--console-log-level', default='info',
1025+ help="Level for the upgrade process console "
1026+ "logging. This is for the main upgrade script itself "
1027+ "meaning that usually only major steps should be "
1028+ "logged ")
1029+ parser.add_argument('-q', '--quiet', action='store_true',
1030+ help="Suppress console output from the main upgrade "
1031+ "script (lower level stages can still write)")
1032+ parser.add_argument('-d', '--db-name', default=SUPPRESS,
1033+ help="Database name. If ommitted, the general default "
1034+ "values from OpenERP config file or libpq will apply.")
1035+ parser.add_argument('--init-load-demo-data', action='store_true',
1036+ help="Demo data will be loaded with module "
1037+ "installations if and only if "
1038+ "this modifier is specified")
1039+
1040+ arguments = parser.parse_args() # 'args' would shadow the one of pdb
1041+ log_path = os.path.abspath(os.path.expanduser(arguments.log_file))
1042+ log_level = arguments.log_level
1043+ console_level = arguments.console_log_level.upper()
1044+ quiet = arguments.quiet
1045+
1046+ try:
1047+ log_file = open(log_path, 'a')
1048+ except IOError:
1049+ sys.stderr.write("Cannot open %r for write" % log_path + os.linesep)
1050+ sys.exit(-1)
1051+
1052+ session = Session(conf, buildout_dir)
1053+
1054+ from openerp.tools import config
1055+ config['logfile'] = log_path
1056+ config['log-level'] = log_level
1057+
1058+ start_time = datetime.utcnow()
1059+ if not quiet:
1060+ print("Starting upgrade, logging details to %s at level %s, "
1061+ "and major steps to console at level %s" % (
1062+ log_path, log_level.upper(), console_level.upper()))
1063+ print('')
1064+
1065+ logger = logging.getLogger('openerp.upgrade')
1066+ console_handler = logging.StreamHandler()
1067+ console_handler.setLevel(getattr(logging, console_level))
1068+ console_handler.setFormatter(logging.Formatter(
1069+ "%(asctime)s %(levelname)s %(message)s"))
1070+
1071+ if not arguments.quiet:
1072+ logger.addHandler(console_handler)
1073+
1074+ db_name = getattr(arguments, 'db_name', None)
1075+ logger.info("Opening database %r", db_name)
1076+ session.open(db=db_name, with_demo=bool(arguments.init_load_demo_data))
1077+ # actual value after all defaultings have been done
1078+ db_name = session.cr.dbname
1079+
1080+ if session.is_initialization:
1081+ logger.info("Database %r base initialization done. Proceeding further",
1082+ db_name)
1083+ else:
1084+ logger.info("Database %r loaded. Actual upgrade begins.", db_name)
1085+
1086+ pkg_version = session.package_version
1087+ if pkg_version is None:
1088+ logger.warn("Expected package version file %r does not exist. "
1089+ "version won't be set in database at the end of upgrade. "
1090+ "Consider including such a version file in your project "
1091+ "*before* version dependent logic is actually needed.",
1092+ session.version_file_path)
1093+ else:
1094+ logger.info("Read package version: %s from %s", pkg_version,
1095+ session.version_file_path)
1096+
1097+ db_version = session.db_version
1098+ if db_version is None:
1099+ if not session.is_initialization:
1100+ logger.warn("No version currently set in database (the present "
1101+ "upgrade script has never been run). Consider setting "
1102+ "database version even for fresh instances, to "
1103+ "eliminate any guesswork in the upgrade scripts.")
1104+ else:
1105+ logger.info("Database latest upgrade version : %s", db_version)
1106+
1107+ upgrade_module = imp.load_source('anybox.recipe.openerp.upgrade_openerp',
1108+ upgrade_script)
1109+ statuscode = getattr(upgrade_module, upgrade_callable)(session, logger)
1110+ if statuscode is None or statuscode == 0:
1111+ if pkg_version is not None:
1112+ logger.info("setting version %s in database" % pkg_version)
1113+ session.db_version = pkg_version
1114+ session.cr.commit()
1115+
1116+ logger.info("%s successful. Total time: %d seconds." % (
1117+ "Initialization" if session.is_initialization else "Upgrade",
1118+ ceil((datetime.utcnow() - start_time).total_seconds())
1119+ ))
1120+ else:
1121+ logger.error("Please check logs at %s" % log_path)
1122+
1123+ log_file.close()
1124+ sys.exit(statuscode)
1125
1126=== modified file 'anybox/recipe/openerp/server.py'
1127--- anybox/recipe/openerp/server.py 2013-09-08 17:19:27 +0000
1128+++ anybox/recipe/openerp/server.py 2014-02-06 07:42:46 +0000
1129@@ -2,6 +2,7 @@
1130 import os
1131 from os.path import join
1132 import sys
1133+import shutil
1134 import logging
1135 import subprocess
1136 import zc.buildout
1137@@ -46,13 +47,17 @@
1138 soft_requirements = ('openerp-command',)
1139 with_openerp_command = False
1140 with_gunicorn = False
1141+ with_upgrade = True
1142 ws = None
1143+ template_upgrade_script = os.path.join(os.path.dirname(__file__),
1144+ 'upgrade.py.tmpl')
1145
1146 def __init__(self, *a, **kw):
1147 super(ServerRecipe, self).__init__(*a, **kw)
1148 opt = self.options
1149 self.with_devtools = (
1150 opt.get('with_devtools', 'false').lower() == 'true')
1151+ self.with_upgrade = self.options.get('upgrade_script') != ''
1152 # discarding, because we have a special behaviour with custom
1153 # interpreters
1154 opt.pop('interpreter', None)
1155@@ -186,6 +191,7 @@
1156 timeout = %(timeout)s
1157 max_requests = %(max_requests)s
1158
1159+openerp.multi_process = True # needed even with only one worker
1160 openerp.conf.server_wide_modules = ['web']
1161 conf = openerp.tools.config
1162 """ % gunicorn_options
1163@@ -339,6 +345,29 @@
1164 self.major_version),
1165 )
1166
1167+ def _register_upgrade_script(self, qualified_name):
1168+ desc = self._get_or_create_script('openerp_upgrader',
1169+ name=qualified_name)[1]
1170+ script_opt = self.options.get('upgrade_script', 'upgrade.py run')
1171+ script = script_opt.split()
1172+ if len(script) != 2:
1173+ # TODO add console script entry point support
1174+ raise zc.buildout.UserError(
1175+ ("upgrade_script option must take the form "
1176+ "SOURCE_FILE CALLABLE (got '%r')" % script))
1177+ script_source_path = self.make_absolute(script[0])
1178+ desc.update(
1179+ entry='openerp_upgrader',
1180+ arguments='%r, %r, %r, %r' % (
1181+ script_source_path, script[1],
1182+ self.config_path, self.buildout_dir),
1183+ )
1184+
1185+ if not os.path.exists(script_source_path):
1186+ logger.warning("Ugrade script source %s does not exist."
1187+ "Initializing it for you", script_source_path)
1188+ shutil.copy(self.template_upgrade_script, script_source_path)
1189+
1190 def _register_gunicorn_startup_script(self, qualified_name):
1191 """Register a gunicorn foreground start script for installation.
1192
1193@@ -448,8 +477,10 @@
1194
1195 initialization = os.linesep.join((
1196 "",
1197- "from anybox.recipe.openerp.startup import Session",
1198- "session = Session(%s)" % self._relativitize(self.config_path),
1199+ "from anybox.recipe.openerp.runtime.session import Session",
1200+ "session = Session(%s, %r)" % (
1201+ self._relativitize(self.config_path),
1202+ self.buildout_dir),
1203 "if len(sys.argv) <= 1:",
1204 " print('To start the OpenERP working session, just do:')",
1205 " print(' session.open(db=DATABASE_NAME)')",
1206@@ -488,8 +519,9 @@
1207
1208 common_init = os.linesep.join((
1209 "",
1210- "from anybox.recipe.openerp.startup import Session",
1211- "session = Session(%r)" % self.config_path,
1212+ "from anybox.recipe.openerp.runtime.session import Session",
1213+ "session = Session(%r, %r)" % (self.config_path,
1214+ self.buildout_dir),
1215 ))
1216
1217 for script_name, desc in self.openerp_scripts.items():
1218@@ -518,9 +550,15 @@
1219
1220 # provide additional needed entry points for main start/test scripts
1221 self.eggs_reqs.extend((
1222- ('openerp_starter', 'anybox.recipe.openerp.start_openerp', 'main'),
1223- ('openerp_cron_worker', 'anybox.recipe.openerp.start_openerp',
1224- 'main'),
1225+ ('openerp_starter',
1226+ 'anybox.recipe.openerp.runtime.start_openerp',
1227+ 'main'),
1228+ ('openerp_cron_worker',
1229+ 'anybox.recipe.openerp.runtime.start_openerp',
1230+ 'main'),
1231+ ('openerp_upgrader',
1232+ 'anybox.recipe.openerp.runtime.upgrade',
1233+ 'upgrade'),
1234 ))
1235
1236 if self.major_version >= (8, 0):
1237@@ -551,6 +589,11 @@
1238 'cron_worker_%s' % self.name)
1239 self._register_cron_worker_startup_script(qualified_name)
1240
1241+ if self.with_upgrade:
1242+ qualified_name = self.options.get('upgrade_script_name',
1243+ 'upgrade_%s' % self.name)
1244+ self._register_upgrade_script(qualified_name)
1245+
1246 self._install_openerp_scripts()
1247
1248 def _60_fix_root_path(self):
1249
1250=== modified file 'anybox/recipe/openerp/tests/test_server.py'
1251--- anybox/recipe/openerp/tests/test_server.py 2013-08-25 06:31:14 +0000
1252+++ anybox/recipe/openerp/tests/test_server.py 2014-02-06 07:42:46 +0000
1253@@ -251,8 +251,8 @@
1254 self.recipe.retrieve_addons()
1255 paths = self.recipe.addons_paths
1256 self.recipe.finalize_addons_paths(check_existence=False)
1257- self.assertEquals(paths, [addons_dir,
1258- os.path.join(oerp_dir, 'openerp', 'addons')])
1259+ self.assertEquals(paths, [os.path.join(oerp_dir, 'openerp', 'addons'),
1260+ addons_dir])
1261
1262 def test_retrieve_fixup_addons_local_60_check_ok(self):
1263 oerp_dir = os.path.join(TEST_DIR, 'oerp60')
1264@@ -268,7 +268,7 @@
1265 os.mkdir(addons_dir)
1266 self.recipe.finalize_addons_paths()
1267 paths = self.recipe.addons_paths
1268- self.assertEqual(paths, [addons_dir, root_dir])
1269+ self.assertEqual(paths, [root_dir, addons_dir])
1270 self.assertEqual(self.recipe.options['options.root_path'],
1271 os.path.join(oerp_dir, 'bin'))
1272
1273
1274=== added file 'anybox/recipe/openerp/tests/test_utils.py'
1275--- anybox/recipe/openerp/tests/test_utils.py 1970-01-01 00:00:00 +0000
1276+++ anybox/recipe/openerp/tests/test_utils.py 2014-02-06 07:42:46 +0000
1277@@ -0,0 +1,25 @@
1278+import unittest
1279+import tempfile
1280+import shutil
1281+import os
1282+
1283+from ..utils import working_directory_keeper
1284+
1285+
1286+class WorkingDirectoryTestCase(unittest.TestCase):
1287+
1288+ def setUp(self):
1289+ self.dirpath = tempfile.mkdtemp()
1290+
1291+ def tearDown(self):
1292+ shutil.rmtree(self.dirpath)
1293+
1294+ def test_ctx_manager(self):
1295+ # warning: if this fails, then many other tests can be
1296+ # affected, because many don't like being in /
1297+ current = os.getcwd()
1298+ with working_directory_keeper:
1299+ os.chdir(self.dirpath)
1300+ self.assertNotEqual(os.getcwd(), current)
1301+
1302+ self.assertEqual(os.getcwd(), current)
1303
1304=== added file 'anybox/recipe/openerp/upgrade.py.tmpl'
1305--- anybox/recipe/openerp/upgrade.py.tmpl 1970-01-01 00:00:00 +0000
1306+++ anybox/recipe/openerp/upgrade.py.tmpl 2014-02-06 07:42:46 +0000
1307@@ -0,0 +1,19 @@
1308+# -*- python -*-
1309+"""This is a template upgrade script.
1310+
1311+The purpose is both to cover the most common use-case (updating all modules)
1312+and to provide an example of how this works.
1313+"""
1314+
1315+
1316+def run(session, logger):
1317+ """Update all modules."""
1318+ if session.is_initialization:
1319+ logger.warn("Usage of upgrade script for initialization detected. "
1320+ "You should consider customizing the present upgrade "
1321+ "script to add modules install commands. The present "
1322+ "script is at : %s (byte-compiled form)",
1323+ __file__)
1324+ return
1325+ logger.info("Default upgrade procedure : updating all modules.")
1326+ session.update_modules(['all'])
1327
1328=== modified file 'anybox/recipe/openerp/utils.py'
1329--- anybox/recipe/openerp/utils.py 2013-08-27 09:29:47 +0000
1330+++ anybox/recipe/openerp/utils.py 2014-02-06 07:42:46 +0000
1331@@ -7,6 +7,9 @@
1332 logger = logging.getLogger(__name__)
1333
1334
1335+MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d*)(\w*)')
1336+
1337+
1338 class WorkingDirectoryKeeper(object):
1339 """A context manager to get back the working directory as it was before.
1340
1341@@ -43,11 +46,6 @@
1342 yield f
1343
1344
1345-NIGHTLY_VERSION_RE = re.compile(r'(\d+)[.](\d+)-(\d+-\d+)$')
1346-
1347-MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d+)')
1348-
1349-
1350 def major_version(version_string):
1351 """The least common denominator of OpenERP versions : two numbers.
1352
1353@@ -55,14 +53,43 @@
1354 releases, bzr versions etc. It's almost impossible to compare them without
1355 an a priori knowledge of release dates and revisions.
1356
1357+ Here are some examples::
1358+
1359+ >>> major_version('1.2.3-foo.bar')
1360+ (1, 2)
1361+ >>> major_version('6.1-20121003-233130')
1362+ (6, 1)
1363+ >>> major_version('7.0alpha')
1364+ (7, 0)
1365+
1366 Beware, the packaging script does funny things, such as labeling current
1367 nightlies as 6.2-date-time whereas version_info is (7, 0, 0, ALPHA)
1368 We can in recipe code check for >= (6, 2), that's not a big issue.
1369+
1370+ Regarding OpenERP saas releases (e.g. 7.saas~1) that are short-lived stable
1371+ versions between two "X.0" LTS releases, the second version number does not
1372+ contain a numeric value. The value X.5 will be returned (e.g. 7.5)::
1373+
1374+ >>> major_version('7.saas~1')
1375+ (7, 5)
1376+
1377 """
1378
1379 m = MAJOR_VERSION_RE.match(version_string)
1380- if m is not None:
1381- return tuple(int(m.group(i)) for i in (1, 2))
1382+
1383+ if m is None:
1384+ raise ValueError("Unparseable version string: %r" % version_string)
1385+
1386+ major = int(m.group(1))
1387+ minor = m.group(2)
1388+ if not minor and m.group(3).startswith('saas'):
1389+ return major, 5
1390+
1391+ try:
1392+ return major, int(minor)
1393+ except TypeError:
1394+ raise ValueError(
1395+ "Unrecognized second version segment in %r" % version_string)
1396
1397
1398 def mkdirp(path):
1399
1400=== modified file 'anybox/recipe/openerp/vcs/bzr.py'
1401--- anybox/recipe/openerp/vcs/bzr.py 2013-09-06 12:14:37 +0000
1402+++ anybox/recipe/openerp/vcs/bzr.py 2014-02-06 07:42:46 +0000
1403@@ -213,7 +213,13 @@
1404
1405 self.update_conf()
1406
1407+ init_opt = self.options.get('bzr-init')
1408 if self.is_fixed_revision(revision):
1409+ if (offline and init_opt == 'lightweight-checkout'):
1410+ logger.warning("Offline mode, no update for lightweight "
1411+ "checkout at %s on revision %r",
1412+ self.target_dir, revision)
1413+ return
1414 try:
1415 self._update(revision)
1416 return
1417@@ -225,8 +231,9 @@
1418 logger.info("Offline mode, no pull for revision %r", revision)
1419 else:
1420 self._pull()
1421- if not (offline and
1422- self.options.get('bzr-init') == 'stacked-branch'):
1423+
1424+ if not (offline and init_opt in ('stacked-branch',
1425+ 'lightweight-checkout')):
1426 self._update(revision)
1427
1428 def _branch(self, revision):
1429
1430=== modified file 'anybox/recipe/openerp/vcs/git.py'
1431--- anybox/recipe/openerp/vcs/git.py 2013-09-06 16:21:36 +0000
1432+++ anybox/recipe/openerp/vcs/git.py 2014-02-06 07:42:46 +0000
1433@@ -82,7 +82,8 @@
1434
1435 def archive(self, target_path):
1436 revision = self.parents()[0]
1437- os.makedirs(target_path)
1438+ if not os.path.exists(target_path):
1439+ os.makedirs(target_path)
1440 with working_directory_keeper:
1441 os.chdir(self.target_dir)
1442 target_tar = tempfile.NamedTemporaryFile(
1443
1444=== modified file 'anybox/recipe/openerp/vcs/tests/test_bzr.py'
1445--- anybox/recipe/openerp/vcs/tests/test_bzr.py 2013-09-06 12:14:37 +0000
1446+++ anybox/recipe/openerp/vcs/tests/test_bzr.py 2014-02-06 07:42:46 +0000
1447@@ -332,18 +332,20 @@
1448
1449 class BzrOfflineTestCase(BzrBaseTestCase):
1450
1451- def make_local_branch(self, path, initial_rev):
1452+ def make_local_branch(self, path, initial_rev, options=None):
1453 """Make a local branch of the source at initial_rev and forbid pulls.
1454 """
1455+ if options is None:
1456+ options = {}
1457 target_dir = os.path.join(self.dst_dir, path)
1458 # initial branching (non offline
1459 BzrBranch(target_dir, self.src_repo)(initial_rev)
1460
1461 # crippled offline branch
1462- branch = BzrBranch(target_dir, self.src_repo, offline=True)
1463+ branch = BzrBranch(target_dir, self.src_repo, offline=True, **options)
1464
1465 def _pull():
1466- raise UpdateError("Should not pull !")
1467+ self.fail("Should not pull !")
1468
1469 branch._pull = _pull
1470 return branch
1471@@ -373,3 +375,31 @@
1472 revid = branch.get_revid('1')
1473 branch('revid:' + revid)
1474 self.assertRevision1(branch)
1475+
1476+ def test_lightweight_checkout_noupdate(self):
1477+ """[offline mode] lightweight checkouts shall not be updated."""
1478+ branch = self.make_local_branch(
1479+ "clone to update", '1',
1480+ options={'bzr-init': 'lightweight-checkout'})
1481+
1482+ def _update(*a, **kw):
1483+ self.fail("Should not update !")
1484+
1485+ branch._update = _update
1486+
1487+ branch('last:1')
1488+ self.assertRevision1(branch)
1489+
1490+ def test_lightweight_checkout_noupdate_fixed_rev(self):
1491+ """[offline mode] lightweight checkouts shall not be updated."""
1492+ branch = self.make_local_branch(
1493+ "clone to update", 'last:1',
1494+ options={'bzr-init': 'lightweight-checkout'})
1495+
1496+ def _update(*a, **kw):
1497+ self.fail("Should not update !")
1498+
1499+ branch._update = _update
1500+
1501+ branch('1')
1502+ self.assertRevision2(branch)
1503
1504=== modified file 'anybox/recipe/openerp/vcs/tests/test_git.py'
1505--- anybox/recipe/openerp/vcs/tests/test_git.py 2013-09-06 16:21:36 +0000
1506+++ anybox/recipe/openerp/vcs/tests/test_git.py 2014-02-06 07:42:46 +0000
1507@@ -120,6 +120,9 @@
1508 repo(new_sha)
1509 self.assertEqual(repo.parents(), [new_sha])
1510
1511+ # see launchpad #1215873
1512+ repo(new_sha)
1513+
1514 def test_uncommitted_changes(self):
1515 """GitRepo can detect uncommitted changes."""
1516 # initial cloning
1517
1518=== modified file 'buildbot/MANIFEST.cfg'
1519--- buildbot/MANIFEST.cfg 2013-09-07 12:04:02 +0000
1520+++ buildbot/MANIFEST.cfg 2014-02-06 07:42:46 +0000
1521@@ -1,35 +1,57 @@
1522 [anybox.recipe.openerp]
1523 watch = bzr lp:anybox.recipe.openerp
1524
1525+[anybox.recipe.openerp-stable]
1526+watch = bzr lp:anybox.recipe.openerp/1.7
1527+
1528 [recipe-50]
1529-# A buildout to test latest version of the recipe in OpenERP 6.0 case
1530-# sale_margin is in extras and requires sale
1531-buildout = standalone recipe-50.cfg
1532-openerp-addons = sale_margin
1533-build-for = postgresql == 8.4 OR == 9.2
1534-watch = bzr lp:anybox.recipe.openerp
1535+# A buildout to test latest version of the recipe in OpenERP 5.0 case
1536+# sale_margin is in extras and requires sale
1537+buildout = bzr lp:anybox.recipe.openerp recipe-50.cfg subdir=buildbot
1538+openerp-addons = sale_margin
1539+build-for = postgresql == 8.4 OR == 9.2
1540+build-category = mature
1541+# OpenERP v5 won't work on python 2.7
1542+build-requires = python == 2.6
1543+
1544+[stable-recipe-50]
1545+# A buildout to test latest version of the recipe in OpenERP 5.0 case
1546+# sale_margin is in extras and requires sale
1547+buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-50.cfg subdir=buildbot
1548+openerp-addons = sale_margin
1549+build-for = postgresql == 8.4 OR == 9.2
1550 build-category = mature
1551 # OpenERP v5 won't work on python 2.7
1552 build-requires = python == 2.6
1553
1554 [recipe-60]
1555-buildout = standalone recipe-60.cfg
1556-bootstrap-version = 1.7
1557-build-for = postgresql == 8.4
1558-watch = bzr lp:anybox.recipe.openerp
1559+buildout = bzr lp:anybox.recipe.openerp recipe-60.cfg subdir=buildbot
1560+bootstrap-version = 1.7
1561+build-for = postgresql == 8.4
1562+build-category = mature
1563+
1564+[stable-recipe-60]
1565+buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-60.cfg subdir=buildbot
1566+bootstrap-version = 1.7
1567+build-for = postgresql == 8.4
1568 build-category = mature
1569
1570 [recipe-61]
1571 # A buildout to test latest version of the recipe in OpenERP 6.1 case
1572-buildout = standalone recipe-61.cfg
1573-build-for = postgresql == 9.1
1574-watch = bzr lp:anybox.recipe.openerp
1575+buildout = bzr lp:anybox.recipe.openerp recipe-61.cfg subdir=buildbot
1576+build-for = postgresql == 9.1
1577+build-category = mature
1578+
1579+[stable-recipe-61]
1580+# A buildout to test latest stable version of the recipe in OpenERP 6.1 case
1581+buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-61.cfg subdir=buildbot
1582+build-for = postgresql == 9.1
1583 build-category = mature
1584
1585 [recipe-60-custom]
1586 # A buildout to test latest version of the recipe in an OpenERP 6.0 custom case
1587 # (stock server, bzr addons)
1588-buildout = standalone recipe-60.cfg
1589+buildout = bzr lp:anybox.recipe.openerp/trunk recipe-60.cfg subdir=buildbot
1590 build-for = postgresql == 8.4
1591 watch = bzr lp:anybox.recipe.openerp
1592 build-category = mature
1593@@ -37,39 +59,46 @@
1594 [recipe-61-custom]
1595 # A buildout to test latest version of the recipe in OpenERP 6.1 custom case
1596 # (bzr server and addons)
1597-buildout = standalone recipe-61.cfg
1598+buildout = bzr lp:anybox.recipe.openerp/trunk recipe-61.cfg subdir=buildbot
1599 build-for = postgresql == 9.1
1600 watch = bzr lp:anybox.recipe.openerp
1601 build-category = mature
1602
1603 [stable-recipe-7.0]
1604 # A buildout to test latest stable revision of the recipe on OpenERP 7.0
1605-buildout = standalone stable-recipe-7.0.cfg
1606+buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-7.0.cfg subdir=buildbot
1607 build-for = postgresql >= 9.1
1608-watch = bzr lp:anybox.recipe.openerp
1609
1610 [recipe-7.0]
1611 # A buildout to test latest revision of the recipe on OpenERP 7.0
1612-buildout = standalone recipe-7.0.cfg
1613+buildout = bzr lp:anybox.recipe.openerp/trunk recipe-7.0.cfg subdir=buildbot
1614 build-for = postgresql == 9.2
1615-watch = bzr lp:anybox.recipe.openerp
1616+post-buildout-steps = nose
1617+ test-openerp
1618+nose.tests = anybox.recipe.openerp/tests_with_openerp --logging-level=INFO
1619
1620 [recipe-trunk]
1621 # A buildout to test latest version of the recipe in OpenERP trunk
1622-buildout = standalone recipe-trunk.cfg
1623-build-for = postgresql >= 9.1
1624-watch = bzr lp:anybox.recipe.openerp
1625+buildout = bzr lp:anybox.recipe.openerp/trunk recipe-trunk.cfg subdir=buildbot
1626+build-for = postgresql > 9.2
1627
1628 [recipe-61-nightly]
1629-# A buildout to test latest version of the recipe for OpenERP nightly build
1630-buildout = standalone recipe-nightly.cfg
1631-build-for = postgresql == 9.1
1632-watch = bzr lp:anybox.recipe.openerp
1633+# A buildout to test a latest revision of the recipe on an
1634+# OpenERP nightly build
1635+buildout = bzr lp:anybox.recipe.openerp recipe-nightly.cfg subdir=buildbot
1636+build-for = postgresql == 9.1
1637+build-category = experimental
1638+
1639+[stable-recipe-61-nightly]
1640+# A buildout to test latest stable revision of the recipe on an
1641+# OpenERP nightly build
1642+buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-nightly.cfg subdir=buildbot
1643+build-for = postgresql == 9.1
1644 build-category = experimental
1645
1646 [recipe-61-latest]
1647 # A buildout to test latest version of the recipe for OpenERP nightly build
1648-buildout = standalone recipe-latest.cfg
1649+buildout = bzr lp:anybox.recipe.openerp recipe-latest.cfg subdir=buildbot
1650 build-for = postgresql == 9.1
1651 watch = bzr lp:anybox.recipe.openerp
1652 build-category = experimental
1653
1654=== added file 'buildbot/base_recipe.cfg'
1655--- buildbot/base_recipe.cfg 1970-01-01 00:00:00 +0000
1656+++ buildbot/base_recipe.cfg 2014-02-06 07:42:46 +0000
1657@@ -0,0 +1,24 @@
1658+[buildout]
1659+parts = openerp
1660+find-links = http://download.gna.org/pychart/
1661+versions = versions
1662+extensions = gp.vcsdevelop
1663+vcs-extend-develop =
1664+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
1665+vcs-update = True
1666+
1667+[openerp]
1668+recipe = anybox.recipe.openerp:server
1669+options.xmlrpc = False
1670+options.xmlrpcs = False
1671+options.netrpc = False
1672+eggs = nose
1673+openerp_scripts = nosetests=nosetests command-line-options=-d
1674+
1675+[webclient]
1676+recipe = anybox.recipe.openerp:webclient
1677+version = 6.1-1
1678+
1679+[gtkclient]
1680+recipe = anybox.recipe.openerp:gtkclient
1681+version = nightly 6.1 latest
1682
1683=== modified file 'buildbot/recipe-50.cfg'
1684--- buildbot/recipe-50.cfg 2013-08-04 10:35:20 +0000
1685+++ buildbot/recipe-50.cfg 2014-02-06 07:42:46 +0000
1686@@ -1,31 +1,14 @@
1687 [buildout]
1688-parts = openerp
1689-
1690-versions = versions
1691-find-links = http://download.gna.org/pychart/
1692-
1693-extensions = gp.vcsdevelop
1694-vcs-extend-develop =
1695- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
1696-vcs-update = True
1697+extends = base_recipe.cfg
1698
1699 [openerp]
1700-recipe = anybox.recipe.openerp:server
1701 version = bzr lp:openobject-server/5.0 openerp-5.0 last:1
1702 addons = bzr lp:openobject-addons/5.0 addons-5.0 last:1
1703 bzr lp:openobject-addons/extra-5.0 addons-5.0-extra last:1 bzr-init=stacked-branch
1704-
1705 eggs = formencode
1706 pydns
1707
1708-options.xmlrpc = False
1709-options.netrpc = True
1710-options.xmlrpcs = False
1711-xmlrpc_port = False
1712-xmlrpcs_port = False
1713-
1714 [gtkclient]
1715-recipe = anybox.recipe.openerp:gtkclient
1716 version = 5.0.16
1717 eggs = pytz
1718
1719
1720=== modified file 'buildbot/recipe-60-custom.cfg'
1721--- buildbot/recipe-60-custom.cfg 2013-08-02 15:52:01 +0000
1722+++ buildbot/recipe-60-custom.cfg 2014-02-06 07:42:46 +0000
1723@@ -1,12 +1,13 @@
1724 [buildout]
1725-parts = openerp
1726-extensions = gp.vcsdevelop
1727-vcs-extend-develop =
1728- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
1729-vcs-update = True
1730-
1731-versions = versions
1732-find-links = http://download.gna.org/pychart/
1733+extends = base_recipe.cfg
1734+
1735+[openerp]
1736+version = 6.0.3
1737+addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1
1738+eggs =
1739+ formencode
1740+ pydns
1741+
1742
1743 [versions]
1744 Babel = 0.9.6
1745@@ -40,13 +41,3 @@
1746 zc.buildout = 1.5.2
1747 zc.recipe.egg = 1.3.2
1748
1749-[openerp]
1750-recipe = anybox.recipe.openerp:server
1751-eggs =
1752- formencode
1753- pydns
1754-
1755-version = 6.0.3
1756-addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1
1757-clean = true
1758-
1759
1760=== modified file 'buildbot/recipe-60.cfg'
1761--- buildbot/recipe-60.cfg 2013-08-02 16:20:41 +0000
1762+++ buildbot/recipe-60.cfg 2014-02-06 07:42:46 +0000
1763@@ -1,22 +1,13 @@
1764 [buildout]
1765-parts = openerp
1766-extensions = gp.vcsdevelop
1767-versions = versions
1768-find-links = http://download.gna.org/pychart/
1769-#vcs-extend-develop =
1770-# bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
1771-#vcs-update = True
1772-develop = /home/gracinet/openerp/recipe/anybox.recipe.openerp
1773+extends = base_recipe.cfg
1774+
1775 [openerp]
1776-recipe = anybox.recipe.openerp:server
1777 version = 6.0.4
1778
1779 [webclient]
1780-recipe = anybox.recipe.openerp:server
1781 version = 6.0.4
1782
1783 [gtkclient]
1784-recipe = anybox.recipe.openerp:gtkclient
1785 version = 6.0.4
1786
1787 [versions]
1788
1789=== modified file 'buildbot/recipe-61-custom.cfg'
1790--- buildbot/recipe-61-custom.cfg 2013-08-02 15:52:01 +0000
1791+++ buildbot/recipe-61-custom.cfg 2014-02-06 07:42:46 +0000
1792@@ -1,21 +1,11 @@
1793 [buildout]
1794-parts = openerp
1795-find-links = http://download.gna.org/pychart/
1796-versions = versions
1797-extensions = gp.vcsdevelop
1798-vcs-extend-develop =
1799- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
1800-vcs-update = True
1801+extends = base_recipe.cfg
1802
1803 [openerp]
1804-recipe = anybox.recipe.openerp:server
1805+# TODO what is exactly custom here ?
1806 version = bzr lp:openobject-server/6.1 openerp-6.1 last:1
1807 addons = bzr lp:openobject-addons/6.1 addons-6.1 last:1
1808 bzr lp:openerp-web/6.1 addons-web last:1 subdir=addons
1809-clean = true
1810-options.xmlrpc = False
1811-options.xmlrpcs = False
1812-options.netrpc = False
1813
1814 [versions]
1815 babel = 0.9.6
1816
1817=== modified file 'buildbot/recipe-61.cfg'
1818--- buildbot/recipe-61.cfg 2013-08-02 16:20:41 +0000
1819+++ buildbot/recipe-61.cfg 2014-02-06 07:42:46 +0000
1820@@ -1,22 +1,13 @@
1821 [buildout]
1822-parts = openerp
1823-extensions = gp.vcsdevelop
1824-versions = versions
1825-find-links = http://download.gna.org/pychart/
1826-vcs-extend-develop =
1827- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
1828-vcs-update = True
1829+extends = base_recipe.cfg
1830
1831 [openerp]
1832-recipe = anybox.recipe.openerp:server
1833 version = 6.1-1
1834
1835 [webclient]
1836-recipe = anybox.recipe.openerp:server
1837 version = 6.1-1
1838
1839 [gtkclient]
1840-recipe = anybox.recipe.openerp:gtkclient
1841 version = 6.1-1
1842
1843 [versions]
1844
1845=== modified file 'buildbot/recipe-7.0.cfg'
1846--- buildbot/recipe-7.0.cfg 2013-08-02 16:20:41 +0000
1847+++ buildbot/recipe-7.0.cfg 2014-02-06 07:42:46 +0000
1848@@ -1,21 +1,10 @@
1849 [buildout]
1850-parts = openerp
1851-find-links = http://download.gna.org/pychart/
1852-versions = versions
1853-extensions = gp.vcsdevelop
1854-vcs-extend-develop =
1855- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
1856-vcs-update = True
1857+extends = base_recipe.cfg
1858
1859 [openerp]
1860-recipe = anybox.recipe.openerp:server
1861 version = bzr lp:openobject-server/7.0 openerp-7.0 last:1
1862 addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1
1863 bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons
1864-clean = true
1865-options.xmlrpc = False
1866-options.xmlrpcs = False
1867-options.netrpc = False
1868
1869 [versions]
1870 babel = 0.9.6
1871
1872=== modified file 'buildbot/recipe-latest.cfg'
1873--- buildbot/recipe-latest.cfg 2013-08-02 16:20:41 +0000
1874+++ buildbot/recipe-latest.cfg 2014-02-06 07:42:46 +0000
1875@@ -1,22 +1,13 @@
1876 [buildout]
1877-parts = openerp
1878-extensions = gp.vcsdevelop
1879-versions = versions
1880-find-links = http://download.gna.org/pychart/
1881-vcs-extend-develop =
1882- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
1883-vcs-update = True
1884+extends = base_recipe.cfg
1885
1886 [openerp]
1887-recipe = anybox.recipe.openerp:server
1888-version = nightly 6.1 20120217-003606
1889+version = nightly 6.1 latest
1890
1891 [webclient]
1892-recipe = anybox.recipe.openerp:server
1893 version = 6.1-1
1894
1895 [gtkclient]
1896-recipe = anybox.recipe.openerp:gtkclient
1897 version = nightly 6.1 latest
1898
1899 [versions]
1900
1901=== modified file 'buildbot/recipe-nightly.cfg'
1902--- buildbot/recipe-nightly.cfg 2013-08-02 16:20:41 +0000
1903+++ buildbot/recipe-nightly.cfg 2014-02-06 07:42:46 +0000
1904@@ -1,22 +1,13 @@
1905 [buildout]
1906-parts = openerp
1907-extensions = gp.vcsdevelop
1908-versions = versions
1909-find-links = http://download.gna.org/pychart/
1910-vcs-extend-develop =
1911- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
1912-vcs-update = True
1913+extends = base_recipe.cfg
1914
1915 [openerp]
1916-recipe = anybox.recipe.openerp:server
1917 version = nightly 6.1 20120217-003606
1918
1919 [webclient]
1920-recipe = anybox.recipe.openerp:server
1921 version = 6.1-1
1922
1923 [gtkclient]
1924-recipe = anybox.recipe.openerp:gtkclient
1925 version = nightly 6.1 20120229-230351
1926
1927 [versions]
1928
1929=== modified file 'buildbot/recipe-trunk.cfg'
1930--- buildbot/recipe-trunk.cfg 2013-08-02 15:52:01 +0000
1931+++ buildbot/recipe-trunk.cfg 2014-02-06 07:42:46 +0000
1932@@ -1,21 +1,11 @@
1933 [buildout]
1934-parts = openerp
1935-find-links = http://download.gna.org/pychart/
1936-versions = versions
1937-extensions = gp.vcsdevelop
1938-vcs-extend-develop =
1939- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
1940-vcs-update = True
1941+extends = base_recipe.cfg
1942
1943 [openerp]
1944 recipe = anybox.recipe.openerp:server
1945 version = bzr lp:openobject-server openerp-trunk last:1
1946 addons = bzr lp:openobject-addons addons-trunk last:1
1947 bzr lp:openerp-web addons-web-trunk last:1 subdir=addons
1948-clean = true
1949-options.xmlrpc = False
1950-options.xmlrpcs = False
1951-options.netrpc = False
1952
1953 [versions]
1954 babel = 0.9.6
1955
1956=== added file 'buildbot/stable-recipe-50.cfg'
1957--- buildbot/stable-recipe-50.cfg 1970-01-01 00:00:00 +0000
1958+++ buildbot/stable-recipe-50.cfg 2014-02-06 07:42:46 +0000
1959@@ -0,0 +1,4 @@
1960+[buildout]
1961+extends=recipe-50.cfg
1962+vcs-extend-develop =
1963+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
1964
1965=== added file 'buildbot/stable-recipe-60.cfg'
1966--- buildbot/stable-recipe-60.cfg 1970-01-01 00:00:00 +0000
1967+++ buildbot/stable-recipe-60.cfg 2014-02-06 07:42:46 +0000
1968@@ -0,0 +1,4 @@
1969+[buildout]
1970+extends = recipe-60.cfg
1971+vcs-extend-develop =
1972+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
1973
1974=== added file 'buildbot/stable-recipe-61.cfg'
1975--- buildbot/stable-recipe-61.cfg 1970-01-01 00:00:00 +0000
1976+++ buildbot/stable-recipe-61.cfg 2014-02-06 07:42:46 +0000
1977@@ -0,0 +1,4 @@
1978+[buildout]
1979+extends = recipe-61.cfg
1980+vcs-extend-develop =
1981+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
1982
1983=== added file 'buildbot/stable-recipe-7.0.cfg'
1984--- buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000
1985+++ buildbot/stable-recipe-7.0.cfg 2014-02-06 07:42:46 +0000
1986@@ -0,0 +1,4 @@
1987+[buildout]
1988+extends = recipe-7.0.cfg
1989+vcs-extend-develop =
1990+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp
1991
1992=== removed file 'buildbot/stable-recipe-7.0.cfg'
1993--- buildbot/stable-recipe-7.0.cfg 2013-09-07 12:04:02 +0000
1994+++ buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000
1995@@ -1,42 +0,0 @@
1996-[buildout]
1997-# A buildout to test the support branch for the latest major version of the
1998-# recipe
1999-parts = openerp
2000-find-links = http://download.gna.org/pychart/
2001-versions = versions
2002-extensions = gp.vcsdevelop
2003-vcs-extend-develop =
2004- bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp
2005-vcs-update = True
2006-
2007-[openerp]
2008-recipe = anybox.recipe.openerp:server
2009-version = bzr lp:openobject-server/7.0 openerp-7.0 last:1
2010-addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1
2011- bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons
2012-clean = true
2013-options.xmlrpc = False
2014-options.xmlrpcs = False
2015-options.netrpc = False
2016-
2017-[versions]
2018-babel = 0.9.6
2019-PIL = 1.1.7
2020-pywebdav = 0.9.4.1
2021-PyXML = 0.8.4
2022-pyyaml = 3.10
2023-werkzeug = 0.8.3
2024-zsi = 2.0-rc3
2025-feedparser = 5.1.1
2026-gdata = 2.0.16
2027-lxml = 2.3.3
2028-psycopg2 = 2.4.4
2029-pydot = 1.0.28
2030-pyparsing = 1.5.6
2031-python-dateutil = 1.5
2032-python-ldap = 2.4.9
2033-python-openid = 2.2.5
2034-pytz = 2012b
2035-vatnumber = 1.0
2036-vobject = 0.8.1c
2037-xlwt = 0.7.3
2038
2039=== added file 'buildbot/stable-recipe-nightly.cfg'
2040--- buildbot/stable-recipe-nightly.cfg 1970-01-01 00:00:00 +0000
2041+++ buildbot/stable-recipe-nightly.cfg 2014-02-06 07:42:46 +0000
2042@@ -0,0 +1,4 @@
2043+[buildout]
2044+extends = recipe-nightly.cfg
2045+vcs-extend-develop =
2046+ bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
2047
2048=== added directory 'doc'
2049=== added file 'doc/Makefile'
2050--- doc/Makefile 1970-01-01 00:00:00 +0000
2051+++ doc/Makefile 2014-02-06 07:42:46 +0000
2052@@ -0,0 +1,177 @@
2053+# Makefile for Sphinx documentation
2054+#
2055+
2056+# You can set these variables from the command line.
2057+SPHINXOPTS =
2058+SPHINXBUILD = sphinx-build
2059+PAPER =
2060+BUILDDIR = sphinx_build
2061+
2062+# User-friendly check for sphinx-build
2063+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
2064+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
2065+endif
2066+
2067+# Internal variables.
2068+PAPEROPT_a4 = -D latex_paper_size=a4
2069+PAPEROPT_letter = -D latex_paper_size=letter
2070+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2071+# the i18n builder cannot share the environment and doctrees with the others
2072+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2073+
2074+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
2075+
2076+help:
2077+ @echo "Please use \`make <target>' where <target> is one of"
2078+ @echo " html to make standalone HTML files"
2079+ @echo " dirhtml to make HTML files named index.html in directories"
2080+ @echo " singlehtml to make a single large HTML file"
2081+ @echo " pickle to make pickle files"
2082+ @echo " json to make JSON files"
2083+ @echo " htmlhelp to make HTML files and a HTML help project"
2084+ @echo " qthelp to make HTML files and a qthelp project"
2085+ @echo " devhelp to make HTML files and a Devhelp project"
2086+ @echo " epub to make an epub"
2087+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2088+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
2089+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
2090+ @echo " text to make text files"
2091+ @echo " man to make manual pages"
2092+ @echo " texinfo to make Texinfo files"
2093+ @echo " info to make Texinfo files and run them through makeinfo"
2094+ @echo " gettext to make PO message catalogs"
2095+ @echo " changes to make an overview of all changed/added/deprecated items"
2096+ @echo " xml to make Docutils-native XML files"
2097+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
2098+ @echo " linkcheck to check all external links for integrity"
2099+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
2100+
2101+clean:
2102+ rm -rf $(BUILDDIR)/*
2103+
2104+html:
2105+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
2106+ @echo
2107+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
2108+
2109+dirhtml:
2110+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
2111+ @echo
2112+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
2113+
2114+singlehtml:
2115+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
2116+ @echo
2117+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
2118+
2119+pickle:
2120+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
2121+ @echo
2122+ @echo "Build finished; now you can process the pickle files."
2123+
2124+json:
2125+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
2126+ @echo
2127+ @echo "Build finished; now you can process the JSON files."
2128+
2129+htmlhelp:
2130+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
2131+ @echo
2132+ @echo "Build finished; now you can run HTML Help Workshop with the" \
2133+ ".hhp project file in $(BUILDDIR)/htmlhelp."
2134+
2135+qthelp:
2136+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
2137+ @echo
2138+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
2139+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
2140+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhcp"
2141+ @echo "To view the help file:"
2142+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhc"
2143+
2144+devhelp:
2145+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
2146+ @echo
2147+ @echo "Build finished."
2148+ @echo "To view the help file:"
2149+ @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe"
2150+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe"
2151+ @echo "# devhelp"
2152+
2153+epub:
2154+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
2155+ @echo
2156+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
2157+
2158+latex:
2159+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
2160+ @echo
2161+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
2162+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
2163+ "(use \`make latexpdf' here to do that automatically)."
2164+
2165+latexpdf:
2166+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
2167+ @echo "Running LaTeX files through pdflatex..."
2168+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
2169+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
2170+
2171+latexpdfja:
2172+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
2173+ @echo "Running LaTeX files through platex and dvipdfmx..."
2174+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
2175+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
2176+
2177+text:
2178+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
2179+ @echo
2180+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
2181+
2182+man:
2183+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
2184+ @echo
2185+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
2186+
2187+texinfo:
2188+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
2189+ @echo
2190+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
2191+ @echo "Run \`make' in that directory to run these through makeinfo" \
2192+ "(use \`make info' here to do that automatically)."
2193+
2194+info:
2195+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
2196+ @echo "Running Texinfo files through makeinfo..."
2197+ make -C $(BUILDDIR)/texinfo info
2198+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
2199+
2200+gettext:
2201+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
2202+ @echo
2203+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
2204+
2205+changes:
2206+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
2207+ @echo
2208+ @echo "The overview file is in $(BUILDDIR)/changes."
2209+
2210+linkcheck:
2211+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
2212+ @echo
2213+ @echo "Link check complete; look for any errors in the above output " \
2214+ "or in $(BUILDDIR)/linkcheck/output.txt."
2215+
2216+doctest:
2217+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
2218+ @echo "Testing of doctests in the sources finished, look at the " \
2219+ "results in $(BUILDDIR)/doctest/output.txt."
2220+
2221+xml:
2222+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
2223+ @echo
2224+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
2225+
2226+pseudoxml:
2227+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
2228+ @echo
2229+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
2230
2231=== added directory 'doc/apidoc'
2232=== added file 'doc/apidoc/anybox.recipe.openerp.rst'
2233--- doc/apidoc/anybox.recipe.openerp.rst 1970-01-01 00:00:00 +0000
2234+++ doc/apidoc/anybox.recipe.openerp.rst 2014-02-06 07:42:46 +0000
2235@@ -0,0 +1,75 @@
2236+anybox.recipe.openerp Package
2237+=============================
2238+
2239+:mod:`anybox.recipe.openerp` Package
2240+------------------------------------
2241+
2242+.. automodule:: anybox.recipe.openerp
2243+ :members:
2244+ :undoc-members:
2245+ :show-inheritance:
2246+
2247+:mod:`base` Module
2248+------------------
2249+
2250+.. automodule:: anybox.recipe.openerp.base
2251+ :members:
2252+ :undoc-members:
2253+ :show-inheritance:
2254+
2255+:mod:`devtools` Module
2256+----------------------
2257+
2258+.. automodule:: anybox.recipe.openerp.devtools
2259+ :members:
2260+ :undoc-members:
2261+ :show-inheritance:
2262+
2263+:mod:`gtkclient` Module
2264+-----------------------
2265+
2266+.. automodule:: anybox.recipe.openerp.gtkclient
2267+ :members:
2268+ :undoc-members:
2269+ :show-inheritance:
2270+
2271+:mod:`server` Module
2272+--------------------
2273+
2274+.. automodule:: anybox.recipe.openerp.server
2275+ :members:
2276+ :undoc-members:
2277+ :show-inheritance:
2278+
2279+:mod:`testing` Module
2280+---------------------
2281+
2282+.. automodule:: anybox.recipe.openerp.testing
2283+ :members:
2284+ :undoc-members:
2285+ :show-inheritance:
2286+
2287+:mod:`utils` Module
2288+-------------------
2289+
2290+.. automodule:: anybox.recipe.openerp.utils
2291+ :members:
2292+ :undoc-members:
2293+ :show-inheritance:
2294+
2295+:mod:`webclient` Module
2296+-----------------------
2297+
2298+.. automodule:: anybox.recipe.openerp.webclient
2299+ :members:
2300+ :undoc-members:
2301+ :show-inheritance:
2302+
2303+Subpackages
2304+-----------
2305+
2306+.. toctree::
2307+
2308+ anybox.recipe.openerp.runtime
2309+ anybox.recipe.openerp.vcs
2310+
2311
2312=== added file 'doc/apidoc/anybox.recipe.openerp.runtime.rst'
2313--- doc/apidoc/anybox.recipe.openerp.runtime.rst 1970-01-01 00:00:00 +0000
2314+++ doc/apidoc/anybox.recipe.openerp.runtime.rst 2014-02-06 07:42:46 +0000
2315@@ -0,0 +1,50 @@
2316+runtime Subpackage
2317+==================
2318+
2319+:mod:`runtime` Package
2320+----------------------
2321+
2322+.. automodule:: anybox.recipe.openerp.runtime
2323+ :members:
2324+ :undoc-members:
2325+ :show-inheritance:
2326+
2327+:mod:`session` Module
2328+---------------------
2329+
2330+.. automodule:: anybox.recipe.openerp.runtime.session
2331+ :members:
2332+ :undoc-members:
2333+ :show-inheritance:
2334+
2335+:mod:`upgrade` Module
2336+---------------------
2337+
2338+.. automodule:: anybox.recipe.openerp.runtime.upgrade
2339+ :members:
2340+ :undoc-members:
2341+ :show-inheritance:
2342+
2343+:mod:`patch_openerp_v5` Module
2344+------------------------------
2345+
2346+.. automodule:: anybox.recipe.openerp.runtime.patch_openerp_v5
2347+ :members:
2348+ :undoc-members:
2349+ :show-inheritance:
2350+
2351+:mod:`start_openerp` Module
2352+---------------------------
2353+
2354+.. automodule:: anybox.recipe.openerp.runtime.start_openerp
2355+ :members:
2356+ :undoc-members:
2357+ :show-inheritance:
2358+
2359+:mod:`test_openerp` Module
2360+--------------------------
2361+
2362+.. automodule:: anybox.recipe.openerp.runtime.test_openerp
2363+ :members:
2364+ :undoc-members:
2365+ :show-inheritance:
2366
2367=== added file 'doc/apidoc/anybox.recipe.openerp.vcs.rst'
2368--- doc/apidoc/anybox.recipe.openerp.vcs.rst 1970-01-01 00:00:00 +0000
2369+++ doc/apidoc/anybox.recipe.openerp.vcs.rst 2014-02-06 07:42:46 +0000
2370@@ -0,0 +1,59 @@
2371+vcs Subpackage
2372+==============
2373+
2374+:mod:`vcs` Package
2375+------------------
2376+
2377+.. automodule:: anybox.recipe.openerp.vcs
2378+ :members:
2379+ :undoc-members:
2380+ :show-inheritance:
2381+
2382+:mod:`base` Module
2383+------------------
2384+
2385+.. automodule:: anybox.recipe.openerp.vcs.base
2386+ :members:
2387+ :undoc-members:
2388+ :show-inheritance:
2389+
2390+:mod:`bzr` Module
2391+-----------------
2392+
2393+.. automodule:: anybox.recipe.openerp.vcs.bzr
2394+ :members:
2395+ :undoc-members:
2396+ :show-inheritance:
2397+
2398+:mod:`git` Module
2399+-----------------
2400+
2401+.. automodule:: anybox.recipe.openerp.vcs.git
2402+ :members:
2403+ :undoc-members:
2404+ :show-inheritance:
2405+
2406+:mod:`hg` Module
2407+----------------
2408+
2409+.. automodule:: anybox.recipe.openerp.vcs.hg
2410+ :members:
2411+ :undoc-members:
2412+ :show-inheritance:
2413+
2414+:mod:`svn` Module
2415+-----------------
2416+
2417+.. automodule:: anybox.recipe.openerp.vcs.svn
2418+ :members:
2419+ :undoc-members:
2420+ :show-inheritance:
2421+
2422+:mod:`testing` Module
2423+---------------------
2424+
2425+.. automodule:: anybox.recipe.openerp.vcs.testing
2426+ :members:
2427+ :undoc-members:
2428+ :show-inheritance:
2429+
2430
2431=== added file 'doc/conf.py'
2432--- doc/conf.py 1970-01-01 00:00:00 +0000
2433+++ doc/conf.py 2014-02-06 07:42:46 +0000
2434@@ -0,0 +1,247 @@
2435+# -*- coding: utf-8 -*-
2436+#
2437+# OpenERP buildout recipe documentation build configuration file, created by
2438+# sphinx-quickstart on Wed Jul 24 18:32:19 2013.
2439+#
2440+# This file is execfile()d with the current directory set to its containing dir.
2441+#
2442+# Note that not all possible configuration values are present in this
2443+# autogenerated file.
2444+#
2445+# All configuration values have a default; values that are commented out
2446+# serve to show the default.
2447+
2448+import sys, os
2449+
2450+# If extensions (or modules to document with autodoc) are in another directory,
2451+# add these directories to sys.path here. If the directory is relative to the
2452+# documentation root, use os.path.abspath to make it absolute, like shown here.
2453+sys.path.insert(0, os.path.abspath('..'))
2454+# -- General configuration -----------------------------------------------------
2455+
2456+# If your documentation needs a minimal Sphinx version, state it here.
2457+#needs_sphinx = '1.0'
2458+
2459+# Add any Sphinx extension module names here, as strings. They can be extensions
2460+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2461+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.viewcode']
2462+
2463+# Add any paths that contain templates here, relative to this directory.
2464+templates_path = ['sphinx_templates']
2465+
2466+# The suffix of source filenames.
2467+source_suffix = '.rst'
2468+
2469+# The encoding of source files.
2470+#source_encoding = 'utf-8-sig'
2471+
2472+# The master toctree document.
2473+master_doc = 'index'
2474+
2475+# General information about the project.
2476+project = u'OpenERP buildout recipe'
2477+copyright = u'2011-2013, Anybox SAS'
2478+
2479+# The version info for the project you're documenting, acts as replacement for
2480+# |version| and |release|, also used in various other places throughout the
2481+# built documents.
2482+#
2483+# The short X.Y version.
2484+version = '1.8'
2485+# The full version, including alpha/beta/rc tags.
2486+release = '1.8.2-dev'
2487+
2488+# The language for content autogenerated by Sphinx. Refer to documentation
2489+# for a list of supported languages.
2490+#language = None
2491+
2492+# There are two options for replacing |today|: either, you set today to some
2493+# non-false value, then it is used:
2494+#today = ''
2495+# Else, today_fmt is used as the format for a strftime call.
2496+#today_fmt = '%B %d, %Y'
2497+
2498+# List of patterns, relative to source directory, that match files and
2499+# directories to ignore when looking for source files.
2500+exclude_patterns = ['sphinx_build']
2501+
2502+# The reST default role (used for this markup: `text`) to use for all documents.
2503+#default_role = None
2504+
2505+# If true, '()' will be appended to :func: etc. cross-reference text.
2506+#add_function_parentheses = True
2507+
2508+# If true, the current module name will be prepended to all description
2509+# unit titles (such as .. function::).
2510+add_module_names = True
2511+
2512+# If true, sectionauthor and moduleauthor directives will be shown in the
2513+# output. They are ignored by default.
2514+#show_authors = False
2515+
2516+# The name of the Pygments (syntax highlighting) style to use.
2517+pygments_style = 'sphinx'
2518+
2519+# A list of ignored prefixes for module index sorting.
2520+modindex_common_prefix = ['anybox.recipe.openerp.']
2521+
2522+# If true, keep warnings as "system message" paragraphs in the built documents.
2523+#keep_warnings = False
2524+
2525+
2526+# -- Options for HTML output ---------------------------------------------------
2527+
2528+# The theme to use for HTML and HTML Help pages. See the documentation for
2529+# a list of builtin themes.
2530+html_theme = 'default'
2531+
2532+# Theme options are theme-specific and customize the look and feel of a theme
2533+# further. For a list of options available for each theme, see the
2534+# documentation.
2535+#html_theme_options = {}
2536+
2537+# Add any paths that contain custom themes here, relative to this directory.
2538+#html_theme_path = []
2539+
2540+# The name for this set of Sphinx documents. If None, it defaults to
2541+# "<project> v<release> documentation".
2542+#html_title = None
2543+
2544+# A shorter title for the navigation bar. Default is the same as html_title.
2545+#html_short_title = None
2546+
2547+# The name of an image file (relative to this directory) to place at the top
2548+# of the sidebar.
2549+html_logo = 'sphinx_templates/logo.png'
2550+
2551+# The name of an image file (within the static path) to use as favicon of the
2552+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
2553+# pixels large.
2554+html_favicon = 'sphinx_templates/favicon.ico'
2555+
2556+# Add any paths that contain custom static files (such as style sheets) here,
2557+# relative to this directory. They are copied after the builtin static files,
2558+# so a file named "default.css" will overwrite the builtin "default.css".
2559+html_static_path = ['sphinx_static']
2560+
2561+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
2562+# using the given strftime format.
2563+#html_last_updated_fmt = '%b %d, %Y'
2564+
2565+# If true, SmartyPants will be used to convert quotes and dashes to
2566+# typographically correct entities.
2567+#html_use_smartypants = True
2568+
2569+# Custom sidebar templates, maps document names to template names.
2570+#html_sidebars = {}
2571+
2572+# Additional templates that should be rendered to pages, maps page names to
2573+# template names.
2574+#html_additional_pages = {}
2575+
2576+# If false, no module index is generated.
2577+#html_domain_indices = True
2578+
2579+# If false, no index is generated.
2580+#html_use_index = True
2581+
2582+# If true, the index is split into individual pages for each letter.
2583+#html_split_index = False
2584+
2585+# If true, links to the reST sources are added to the pages.
2586+#html_show_sourcelink = True
2587+
2588+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
2589+#html_show_sphinx = True
2590+
2591+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
2592+#html_show_copyright = True
2593+
2594+# If true, an OpenSearch description file will be output, and all pages will
2595+# contain a <link> tag referring to it. The value of this option must be the
2596+# base URL from which the finished HTML is served.
2597+#html_use_opensearch = ''
2598+
2599+# This is the file name suffix for HTML files (e.g. ".xhtml").
2600+#html_file_suffix = None
2601+
2602+# Output file base name for HTML help builder.
2603+htmlhelp_basename = 'OpenERPbuildoutrecipedoc'
2604+
2605+
2606+# -- Options for LaTeX output --------------------------------------------------
2607+
2608+latex_elements = {
2609+# The paper size ('letterpaper' or 'a4paper').
2610+#'papersize': 'letterpaper',
2611+
2612+# The font size ('10pt', '11pt' or '12pt').
2613+#'pointsize': '10pt',
2614+
2615+# Additional stuff for the LaTeX preamble.
2616+#'preamble': '',
2617+}
2618+
2619+# Grouping the document tree into LaTeX files. List of tuples
2620+# (source start file, target name, title, author, documentclass [howto/manual]).
2621+latex_documents = [
2622+ ('index', 'OpenERPbuildoutrecipe.tex', u'OpenERP buildout recipe Documentation',
2623+ u'Christophe Combelles, Georges Racinet', 'manual'),
2624+]
2625+
2626+# The name of an image file (relative to this directory) to place at the top of
2627+# the title page.
2628+#latex_logo = None
2629+
2630+# For "manual" documents, if this is true, then toplevel headings are parts,
2631+# not chapters.
2632+#latex_use_parts = False
2633+
2634+# If true, show page references after internal links.
2635+#latex_show_pagerefs = False
2636+
2637+# If true, show URL addresses after external links.
2638+#latex_show_urls = False
2639+
2640+# Documents to append as an appendix to all manuals.
2641+#latex_appendices = []
2642+
2643+# If false, no module index is generated.
2644+#latex_domain_indices = True
2645+
2646+
2647+# -- Options for manual page output --------------------------------------------
2648+
2649+# One entry per manual page. List of tuples
2650+# (source start file, name, description, authors, manual section).
2651+man_pages = [
2652+ ('index', 'openerpbuildoutrecipe', u'OpenERP buildout recipe Documentation',
2653+ [u'Christophe Combelles, Georges Racinet'], 1)
2654+]
2655+
2656+# If true, show URL addresses after external links.
2657+#man_show_urls = False
2658+
2659+
2660+# -- Options for Texinfo output ------------------------------------------------
2661+
2662+# Grouping the document tree into Texinfo files. List of tuples
2663+# (source start file, target name, title, author,
2664+# dir menu entry, description, category)
2665+texinfo_documents = [
2666+ ('index', 'OpenERPbuildoutrecipe', u'OpenERP buildout recipe Documentation',
2667+ u'Christophe Combelles, Georges Racinet', 'OpenERPbuildoutrecipe', 'One line description of project.',
2668+ 'Miscellaneous'),
2669+]
2670+
2671+# Documents to append as an appendix to all manuals.
2672+#texinfo_appendices = []
2673+
2674+# If false, no module index is generated.
2675+#texinfo_domain_indices = True
2676+
2677+# How to display URL addresses: 'footnote', 'no', or 'inline'.
2678+#texinfo_show_urls = 'footnote'
2679+
2680+# If true, do not generate a @detailmenu in the "Top" node's menu.
2681+#texinfo_no_detailmenu = False
2682
2683=== renamed file 'README.rst' => 'doc/configuration.rst'
2684--- README.rst 2013-09-07 11:43:18 +0000
2685+++ doc/configuration.rst 2014-02-06 07:42:46 +0000
2686@@ -1,5 +1,5 @@
2687-anybox.recipe.openerp
2688-=====================
2689+Configuration reference
2690+=======================
2691
2692 This is a `Buildout <https://github.com/buildout/buildout>`_ recipe that can
2693 download, install and configure one or several OpenERP servers, web clients,
2694@@ -8,8 +8,6 @@
2695 with gunicorn deployment and an additional cron worker. It works under Linux
2696 and MacOs. It might work under Windows but it is untested.
2697
2698-For a **quickstart** you can jump to the howto_ section.
2699-
2700 A "Buildout recipe" is the engine behind a Buildout "part". A "buildout part"
2701 is a part of a larger application built with the Buildout sandbox build system.
2702 Using Buildout is harmless for your system because it is entirely
2703@@ -17,120 +15,167 @@
2704 buildout is gone. You never have to use administrative rights, except for
2705 build dependencies.
2706
2707-.. contents::
2708-
2709-Recipes
2710-~~~~~~~
2711-
2712-You get 3 recipes at once. The recipe to use is the following:
2713-
2714-For the server::
2715+.. _buildout_conf_parts:
2716+
2717+The buildout configuration file and parts
2718+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2719+The intents of this section is to highlights a few facts that we've
2720+found especially useful. People should refer to the
2721+`reference zc.buildout documentation
2722+<https://pypi.python.org/pypi/zc.buildout/2.2.1>`_
2723+and in particular to the `configuration file syntax
2724+<https://pypi.python.org/pypi/zc.buildout/2.2.1#configuration-file-syntax>`_
2725+(these links may have to be adapted for the version in use).
2726+
2727+
2728+Buildout configuration files are written almost in INI format, and
2729+always start with a ``buildout`` section::
2730+
2731+ [buildout]
2732+ parts = openerp
2733+
2734+The ``parts`` option specifies which parts to install by default if
2735+one runs ``bin/buildout`` with no explicit ``install`` directive.
2736+
2737+Parts directly correspond to sections of the configuration file, and
2738+must specify the recipe that's to be used::
2739+
2740+ [openerp]
2741+ recipe = anybox.recipe.openerp:server
2742+
2743+An extra dependency of the recipe gets required at runtime like this::
2744+
2745+ recipe = anybox.recipe.openerp[bzr]:server
2746+
2747+Command line
2748+------------
2749+The configuration file can be specified from the command line::
2750+
2751+ bin/buildout -c buildout.local.cfg
2752+
2753+Recipe options can be overridden from the command-line::
2754+
2755+ bin/buildout -c buildout.local.cfg openerp:clean=True openerp:xmlrpc_port=8169
2756+
2757+Parts that are not listed in the ``buildout`` configuration section
2758+can be explicitely installed::
2759+
2760+ bin/buildout install openerp funkload static-analysis
2761+
2762+.. _extends:
2763+
2764+Inheritance
2765+-----------
2766+
2767+A buildout configuration file can reference another one and change
2768+some options (note the ``+=`` notation that's not part of the INI format)::
2769+
2770+ [buildout]
2771+ extends = buildout.base.cfg
2772+
2773+ [openerp]
2774+ eggs += nose
2775+ coverage
2776+ with_devtools = True
2777+
2778+These extensions can be chained. This allows in particular project maintainers
2779+to separate the configuration options that are considered to be part
2780+of the project from those that depend on the server environment
2781+(ports, database hosts…)
2782+
2783+Default configuration
2784+---------------------
2785+
2786+If available, the settings from ``$HOME/.buildout/default.cfg`` always
2787+apply, as if it where the default value of the :ref:`extends <extends>` option.
2788+
2789+This is commonly used with the ``eggs-directory`` and
2790+:ref:`openerp-downloads-directory` options, because these amount to create a
2791+user-level cache.
2792+
2793+Finally, you may also use :ref:`extends <extends>` in ``default.cfg`` to point
2794+to a system-wide configuration file (useful to enforce
2795+policies at the organization or physical site level, such as local
2796+index servers, mirrors, etc.).
2797+
2798+
2799+OpenERP recipes
2800+~~~~~~~~~~~~~~~
2801+
2802+There are three different recipes bundled with
2803+``anybox.recipe.openerp``. The option line to put in your part (see
2804+:ref:`buildout_conf_parts`) is the following.
2805+
2806+Server
2807+------
2808+::
2809
2810 recipe = anybox.recipe.openerp:server
2811
2812-For the web client::
2813+.. note:: If you plan on using Launchpad's short Bazaar branch notation
2814+ (``lp:``), then you need to add the ``bzr`` extra-dependency::
2815+
2816+ recipe = anybox.recipe.openerp[bzr]:server
2817+
2818+Web client
2819+----------
2820+::
2821
2822 recipe = anybox.recipe.openerp:webclient
2823
2824-For the gtk client::
2825+GTK client
2826+----------
2827+::
2828
2829 recipe = anybox.recipe.openerp:gtkclient
2830
2831-Default options from zc.recipe.egg
2832-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2833-
2834-This recipe reuses the *zc.recipe.egg:scripts* recipe, so the options
2835-are the same (*eggs*, *interpreter*, etc.), and some changes, documented below.
2836-
2837-Consult the documentation here http://pypi.python.org/pypi/zc.recipe.egg
2838-
2839-The main useful ones are below:
2840-
2841-eggs
2842-----
2843-
2844-Starting from version 0.16 of the recipe, you don't need to put anything in
2845-this option by default. But you may specify additional eggs needed by addons,
2846-or just useful ones::
2847-
2848- eggs =
2849- ipython
2850- openobject-library
2851-
2852-scripts
2853--------
2854-.. note:: for scripts needing to call OpenERP internal API or to load
2855- an OpenERP database prior to execution, check
2856- ``openerp_scripts`` below.
2857-
2858-The behaviour of this option is slightly modified :
2859-by default, no script other than those directly related to OpenERP are
2860-generated, but you may specify some explicitely, with the same semantics as the
2861-normal behaviour (we simply set an empty default value, which means to not
2862-produce scripts)::
2863-
2864- scripts =
2865- change_tz
2866-
2867-In the current state, beware to *not* require the same script in different
2868-parts or rename them. See
2869-https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for
2870-details.
2871-
2872-interpreter
2873------------
2874-With the ``gtklcient`` and ``webclient`` recipes,
2875-this is the default `interpreter` option of `zc.recipe.egg` that
2876-specifies the name of the Python interpreter that shoud be included in
2877-the``bin`` directory of the buildout::
2878-
2879- interpreter = erp_python
2880-
2881-With the ``server`` recipe, the ``interpreter`` option will be ignored,
2882-because it always creates an interpreter with preloaded objects to
2883-bootstrap openerp. Check the ``interpreter_name`` option below for
2884-more details.
2885-
2886-
2887-Specific options
2888-~~~~~~~~~~~~~~~~
2889-
2890-The recipe also adds a few specific options:
2891+.. note:: from OpenERP 7.0 onwards, the web and gtk clients aren't
2892+ that useful anymore.
2893+
2894+Options for assembly and source management
2895+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2896+
2897+.. _version:
2898
2899 version
2900 -------
2901
2902 Specifies the OpenERP version to use. It can be:
2903
2904-The **version number** of an official OpenERP (server, web client or gtk client)::
2905-
2906- version = 6.0.3
2907-
2908-A **custom download**::
2909-
2910- version = url http://example.com/openerp.tar.gz
2911-
2912-An absolute or a relative **path**::
2913-
2914- version = path /my/path/to/a/custom/openerp
2915-
2916-A custom **bzr, hg, git or svn** branch or repository. The syntax is the same
2917-as the `addons` option (see below)::
2918-
2919- version = bzr lp:openobject-server/6.1 openerp61 last:1
2920-
2921-A **nightly** build::
2922-
2923- version = nightly 6.1 20120814-233345
2924-
2925-or (dangerously unpinned version)::
2926-
2927- version = nightly 6.1 latest
2928-
2929-or even more dangerous::
2930-
2931- version = nightly trunk latest
2932-
2933+* The **version number** of an official OpenERP (server, web client or gtk client)::
2934+
2935+ version = 6.0.3
2936+
2937+* A **custom download**::
2938+
2939+ version = url http://example.com/openerp.tar.gz
2940+
2941+* An absolute or a relative **path**::
2942+
2943+ version = path /my/path/to/a/custom/openerp
2944+
2945+* A custom **bzr, hg, git or svn** branch or repository. The syntax is the same
2946+ as with the :ref:`addons` option::
2947+
2948+ recipe = anybox.recipe.openerp[bzr]:server
2949+ version = bzr lp:openobject-server/6.1 openerp61 last:1
2950+
2951+ .. note:: the ``[bzr]`` extra dependency declaration is useful for
2952+ resolution of the ``lp:`` address shortcuts.
2953+
2954+* A **nightly** build::
2955+
2956+ version = nightly 6.1 20120814-233345
2957+
2958+* or (dangerously unpinned version)::
2959+
2960+ version = nightly 6.1 latest
2961+
2962+* or even more dangerous::
2963+
2964+ version = nightly trunk latest
2965+
2966+.. _addons:
2967
2968 addons
2969 ------
2970@@ -139,6 +184,7 @@
2971
2972 Example::
2973
2974+ recipe = anybox.recipe.openerp[bzr]:server
2975 addons = local ../some/relative/path/for/custom_addons/
2976 local /some/other/absolute/path/for/custom_addons
2977 bzr lp:openobject-addons/trunk/ addons0 last:1
2978@@ -151,6 +197,10 @@
2979 addons, or a single addon. In that latter case, it will be actually
2980 placed one directory below.
2981
2982+.. note:: the ``[bzr]`` extra-dependency declaration as showcased
2983+ above in the ``recipe`` line is necessary for
2984+ resolution of ``lp:`` launchpad address shortcuts.
2985+
2986 .. warning::
2987
2988 Never name one of these addons directory simply ``addons``. It
2989@@ -159,15 +209,17 @@
2990
2991 For remote repositories, the syntax is:
2992
2993-``TYPE URL DESTINATION REVISION [OPTIONS]``
2994-
2995-* *TYPE* can be ``bzr``, ``hg``, ``git`` or ``svn``
2996-* *URL* is any URL scheme supported by the versionning tool
2997-* *DESTINATION* is the local directory that will be created (relative or absolute)
2998-* *REVISION* is any version specification supported (revision, tag, etc.)
2999-* *OPTIONS* take the form ``name=value``. Currently the ``subdir``
3000- option is recognized. If used, the given subdirectory of the
3001- repository is registered as an addons directory.
3002+ ``TYPE URL DESTINATION REVISION [OPTIONS]``
3003+
3004+with the following semantics:
3005+
3006+:TYPE: one of ``bzr``, ``hg``, ``git`` or ``svn``
3007+:URL: is any URL scheme supported by the versionning tool
3008+:DESTINATION: is the local directory that will be created (relative or absolute)
3009+:REVISION: is any version specification supported (revision, tag, etc.)
3010+:OPTIONS: each one takes the form ``name=value``. No whitespace is
3011+ allowed inside an option, and no escaping is
3012+ implemented.
3013
3014 Repositories are updated on each build according to the specified
3015 revision. You must be careful with the revision specification.
3016@@ -176,32 +228,59 @@
3017 specified revision is performed, if the VCS allows it (Subversion does
3018 not).
3019
3020-.. note:: An additional option is supported for bzr. **'bzr-init'**
3021- defines the way the bzr branch
3022- is initialized for addons or server declared with a bzr
3023- repository path.
3024-
3025- Possible values:
3026-
3027- branch (default)
3028- Working copy initialized with the command
3029- ``bzr branch url ...``
3030- stacked-branch
3031- Working copy initialized with the command
3032- ``bzr branch --stacked url ...``
3033-
3034- lightweight-checkout
3035- Working copy initialized with the command
3036- ``bzr checkout --lightweight url ...``
3037+The ``subdir`` addons option
3038+````````````````````````````
3039+
3040+The ``subdir`` option, if used, makes the recipe use the given
3041+subdirectory of the repository as the addons directory.
3042+A very common example is the line for standard web addons from bzr::
3043+
3044+ bzr lp:openerp-web/7.0 openerp-web last:1 subdir=addons
3045+
3046+The ``bzr-init`` addons option
3047+``````````````````````````````
3048+**'bzr-init'** defines the way the bzr branch
3049+is initialized for addons or server declared with a bzr
3050+repository path.
3051+
3052+.. note:: new in version 1.7.0
3053+
3054+Possible values:
3055+
3056+:branch (default): Working copy initialized with the command
3057+ ``bzr branch url ...``
3058+
3059+:stacked-branch: Working copy initialized with the command
3060+ ``bzr branch --stacked url ...``
3061+:lightweight-checkout: Working copy initialized with the command
3062+ ``bzr checkout --lightweight url ...``
3063+
3064+.. _eggs:
3065+
3066+eggs
3067+----
3068+This option behaves like the identically named one of the most common
3069+`zc.recipe.egg <https://pypi.python.org/pypi/zc.recipe.egg>`_.
3070+
3071+Starting from version 0.16 of the recipe, you don't need to put anything in
3072+this option by default: the recipe is supposed to add all needed
3073+dependencies for OpenERP by itself, but you have to specify additional
3074+eggs needed by addons, or just useful ones::
3075+
3076+ eggs = ipython
3077+ python-ldap
3078+ openobject-library
3079+
3080+.. _revisions:
3081
3082 revisions
3083 ---------
3084
3085 This option allows to further precise what has been specified through
3086-the ``addons`` and ``version`` options by fixing VCS revisions.
3087+the :ref:`addons` and :ref:`version` options by fixing VCS revisions.
3088
3089-The main use-case it to apply it in an extension buildout
3090-configuration file::
3091+The main use-case it to apply it in an :ref:`extension buildout
3092+configuration file <extends>`::
3093
3094 [buildout]
3095 extends = base.cfg
3096@@ -211,7 +290,7 @@
3097 addons-openerp 7109
3098
3099 As you can see in that example, the first token is the target
3100-filesystem path, as in the ``addons`` option, the second one is the
3101+filesystem path, as in the :ref:`addons` option, the second one is the
3102 revision, except in the case of the main software (if VCS based), for
3103 which there's no filesystem path.
3104
3105@@ -223,278 +302,196 @@
3106 * freezing satisfactory revisions in a release process (the recipe can
3107 do that automatically for you, see ``freeze-to`` option below).
3108
3109+.. _clean:
3110+
3111 clean
3112 -----
3113
3114 If set to true, this option will clean remove python object files from
3115-the main server part and addons before any update or install.
3116+the main server part and addons before any update or install, and
3117+perform relevant VCS idea of "clean, purge".
3118+
3119+.. warning:: developers can lose their uncommitted work with this option.
3120+
3121+ This option is not meant for developer setups, rather for
3122+ deployment and continuous integration. To avoid making a
3123+ dedicated buildout configuration for you CI bot, just add
3124+ it on the command-line.
3125
3126 Note that tarball downloads get re-extracted afresh in any case.
3127
3128-openerp_scripts
3129----------------
3130-
3131-Introduction and use-cases
3132-``````````````````````````
3133-This option lets you install console scripts provided by any of the loaded eggs,
3134-so that they can access to OpenERP internals and load databases.
3135-Some interesting use-cases:
3136-
3137-* specific batch jobs
3138-* introspection tools
3139-* general-purposes test launchers that don't have any knowledge of
3140- OpenERP specifics
3141-* actually, the main startup scripts themselves (with a default
3142- configuration, of course)
3143-
3144-Usage
3145-`````
3146-This multiline option is similar to the classical ``scripts`` options
3147-of ``zc.recipe.eggs:scripts``. It lets you ask for installation of
3148-console scripts provided by the various Python distribution involved
3149-in the buildout part (including OpenERP itself).
3150-
3151-The built console scripts can import all the involved Python
3152-distributions, and have access to a ``session`` object, to issue
3153-OpenERP native calls (see
3154-``interpreter_name`` option below for details on how to use it).
3155-
3156-One has to register exactly one console script per line.
3157-
3158-As it is the case with ``scripts``, one actually specifies the name of the
3159-entry point to use (we are all used to that entry point being the name
3160-of the resulting script, because that's what ``setup.py install`` does).
3161-
3162-Suppose there is a distribution ``my.package`` with the following lines in
3163-its ``setup.py``::
3164-
3165- entry_points="""
3166-
3167- [console_scripts]
3168- my = my.package.main:run
3169- """
3170-
3171-Now the following configuration extract builds a script called
3172-``my_openerp1``, that can access ``session``::
3173-
3174- [openerp1]
3175- (...)
3176- openerp_scripts = my
3177-
3178-To control the script name, just do, e.g,::
3179-
3180- [openerp1]
3181- (...)
3182- openerp_scripts = my=my_script
3183-
3184-This will build it as ``bin/my_script``.
3185-
3186-Command-line options and test launchers
3187-```````````````````````````````````````
3188-
3189-If ``my.package`` is meant to do OpenERP heavy-lifting, then surely it
3190-will provide a powerful command-line parsing. e.g., to let the end user chose
3191-the database on which to work, etc.
3192-
3193-Sometimes, however, the script itself has no knowledge of OpenERP at
3194-all, but still must run after a database has been fully initialized.
3195-The main use case for this is test launchers, such as
3196-`nose <https://nose.readthedocs.org/en/latest/>`_ or simply ``unit2``.
3197-For these, the recipe has a facility to rewrap the script and add some further
3198-command-line options.
3199-
3200-In this example, we build ``unit2``, the launcher that comes with
3201-``unittest2``, and wrap it to add the database option::
3202-
3203- [openerp]
3204- (...)
3205- openerp_scripts = unit2 command-line-options=-d
3206-
3207-You may then run it this way::
3208-
3209- bin/unit2_openerp -d unit-tests-db -- discover some/addon
3210-
3211-Notice how ``--`` is used to separate the ``-d`` or
3212-any recipe-related options from the options expected by the script itself.
3213-
3214-If one wishes to run the tests with ``nose``, one has further to
3215-require it. In the following example, we also ask for the ``coverage``
3216-package::
3217-
3218- [openerp]
3219- (...)
3220- eggs = nose
3221- coverage
3222- openerp_scripts = nosetests command-line-options=-d
3223-
3224-Here's our test run with coverage and pdb post-mortem::
3225-
3226- bin/nosetests-openerp -d unit-tests-db -- --nologcapture \
3227- --with-coverage --pdb \
3228- some/addon/tests/test_one.py
3229-
3230-Main startup scripts
3231-````````````````````
3232-The recipe will in all cases build OpenERP startup scripts, according to other
3233-configuration options (gunicorn, tests etc.). These are
3234-actually special cases of the scripts controlled via ``openerp_scripts``.
3235-
3236-This allows you (for now) to control the names. For instance, to
3237-replace ``bin/start_openerp`` with ``bin/oerp``, just do::
3238-
3239- [openerp]
3240- (...)
3241- openerp_scripts = openerp_starter=oerp
3242-
3243-Here's the list of currently available internal entry points. For
3244-these, the ``command-line-options`` modifier has no effect.
3245-
3246-:openerp_starter: main OpenERP startup script (dynamically added
3247- behing the scenes by the recipe)
3248-:openerp_tester: uniform script to start OpenERP, launch all tests and
3249- exit. This can be achieved with the main startup
3250- scripts, but options differ among OpenERP versions.
3251- (also dynamically added behind the scenes).
3252-:openerp_cron_worker: entry point for the cron worker script that gets
3253- built for gunicorn setups.
3254-:oe: entry point declared by ``openerp-command`` and used by the recipe.
3255-:gunicorn: entry point declared by ``gunicorn`` and used by the recipe.
3256+.. _openerp_options:
3257+
3258+OpenERP options
3259+~~~~~~~~~~~~~~~
3260+
3261+With the OpenERP buildout recipes, OpenERP options are managed
3262+directly from the buildout file (usually
3263+``buildout.cfg``) from the part.
3264+
3265+The OpenERP configuration files are generated by OpenERP itself in the directory
3266+specified by ``etc-directory``, which defaults to the `etc` directory under your
3267+buildout directory.
3268+
3269+The settings of the OpenERP configuration files are specified using a
3270+dotted notation in which the fist segment is the name of the
3271+corresponding section of the OpenERP config file and the second is the
3272+option name.
3273+
3274+The specified options will just overwrite the existing
3275+options in the corresponding config files. You don't have to replicate all the
3276+options in your section of the buildout file. If a setting or a section does
3277+not natively exist in the openerp config file, it can be created from there for
3278+your application.
3279+
3280+For example you can specify the xmlrpc port for the server or
3281+even an additional option that does not exist in the default config file::
3282+
3283+ options.xmlrpc_port = 8069
3284+ options.additional_option = "foobar"
3285+
3286+It will end-up in the server configuration as::
3287+
3288+ [options]
3289+ xmlrpc_port = 8069
3290+ additional_option = "foobar"
3291+
3292+For the web client you can specify the port and company url with::
3293+
3294+ global.server.socket_port = 8080
3295+ openerp-web.company.url = 'http://anybox.fr'
3296+
3297+It will modify the corresponding web client config::
3298+
3299+ [global]
3300+ server.socket_port = 8080
3301+
3302+ [openerp-web]
3303+ company.url = 'http://anybox.fr'
3304+
3305+.. note:: Buildout :ref:`configuration inheritance <extends>` is
3306+ especially useful to manage the separation between a
3307+ reusable buildout configuration and local settings.
3308+
3309+.. note:: Note that for security reasons, the superadmin password is not set by
3310+ default. If you want databases to be manageable through the UI,
3311+ you may either explicitely set that password in the buildout part
3312+ configuration or even set it temporarily in the
3313+ ``etc/openerp.conf`` file.
3314+
3315+
3316+Options for executables generation and serving
3317+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3318+
3319+.. _script_name:
3320
3321 script_name
3322 -----------
3323
3324 .. warning:: as of version 1.7.0, this option is deprecated because of its
3325- redundancy with ``openerp_scripts``.
3326-
3327-OpenERP startup scripts are created in the `bin` directory. By default the name is:
3328-start_<part_name>, so you can have several startup scripts for each part if you
3329-configure several OpenERP servers or clients. You can pass additional typical
3330+ redundancy with :ref:`openerp_scripts`.
3331+
3332+OpenERP startup scripts are created in the `bin` directory. By default
3333+the name is ``start_<part_name>``, so you can have several startup
3334+scripts for each part if you configure several OpenERP servers or clients.
3335+
3336+You can pass additional typical
3337 arguments to the server via the startup script, such as -i or -u options.
3338
3339 You can choose another name for the script by using the *script_name*
3340 option ::
3341
3342- script_name = start_erp
3343-
3344-interpreter_name
3345-----------------
3346-
3347-The recipe will automatically create a python interpreter with a
3348-``session`` object that can bootstrap OpenERP with a database right
3349-away. You can use that for interactive sessions or to launch a script::
3350-
3351- $ bin/python_openerp
3352- To start the OpenERP working session, just do:
3353- session.open()
3354- or
3355- session.open(db=DATABASE_NAME)
3356- Then you can issue commands such as
3357- session.registry('res.users').browse(session.cr, 1, 1)
3358-
3359- >>>
3360-
3361-The interpreter name is ``python_<part_name>`` by default; but it can
3362-be explicitely set like this::
3363-
3364- interpreter_name = my_py
3365-
3366-If you want *not* to have the interpreter, juste do
3367-
3368- interpreter_name =
3369-
3370-The bootstrapping facility may also be used within a script installed
3371-by an egg; just insert this in your code to get the session object as
3372-if you were in the interpreter::
3373-
3374- from anybox.recipe.openerp.startup import Session
3375- session = Session()
3376-
3377-.. note:: this facility is new in version 1.6.0, and tested with
3378- OpenERP 7 only for now.
3379-
3380-startup_delay
3381--------------
3382-
3383-Specifies a delay in seconds to wait before actually launching OpenERP. This
3384-option was a preliminary hack to support both gunicorn instance and a legacy
3385-instance. The Gunicorn startup script (see below) itself is not affected by
3386-this setting ::
3387-
3388- startup_delay = 3
3389-
3390-with_devtools
3391--------------
3392-Allows to load development and install useful devlopment and testing
3393-tools, notably the following scripts:
3394-
3395-* ``test_openerp``: a uniform test launcher for all supported
3396- versions. See test_script_name option below for details.
3397-* ``openerp_command``: see openerp_command_name option below for
3398- details. Not installed for OpenERP major versions less than or equal to 6.1.
3399-
3400-This option is False by default, hence it's activated this way::
3401-
3402- with_devtools = true
3403-
3404-It will also add some dependencies that are typical to development
3405-setups (tests related packages etc.) and automatically load where
3406-needed helpers, such as `anybox.testing.datetime
3407-<http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to
3408-cheat with system time).
3409-
3410-test_script_name
3411-----------------
3412-.. warning:: as of version 1.7.0, this option is deprecated because of its
3413- redundancy with ``openerp_scripts``.
3414-
3415-If the ``with_devtools`` is set to True, the recipe will create a
3416-test script, which is named by default ``test_<part_name>``. You may
3417-override the name in the configuration as in the following example::
3418-
3419- test_script_name = test_erp
3420-
3421-The test script takes the same arguments as the regular startup
3422-script::
3423-
3424- bin/test_openerp --help
3425- bin/test_openerp -d test_db -i purchase,sale
3426-
3427-At the time of this writing, all this script does compared to the
3428-regular startup script is to bring uniformity across OpenERP versions
3429-by tweaking options internally.
3430-
3431-base_url
3432---------
3433-
3434-URL from which to download official and nightly versions
3435-(assuming the archive filenames are constistent with those in
3436-OpenERP download server). This is a basic mirroring capability::
3437-
3438- base_url = http://download.example.com/openerp/
3439-
3440-openerp-downloads-directory
3441----------------------------
3442-
3443-Allows to share OpenERP downloads among several buildouts. You should put this
3444-option in your ``~/.buildout/default.cfg`` file. It specifies the destination
3445-download directory for OpenERP archives. The path may be absolute or relative
3446-to the buildout directory.
3447-
3448-Example::
3449-
3450- [buildout]
3451- openerp-downloads-directory = /home/user/.buildout/openerp-downloads
3452+ script_name = start_erp
3453+
3454+
3455+.. _openerp_scripts:
3456+
3457+openerp_scripts
3458+---------------
3459+This option lets you install console scripts provided by any of the loaded eggs,
3460+so that they can access to OpenERP internals and load databases.
3461+
3462+.. note:: new in version 1.7.0
3463+
3464+Here we describe the format of the option only.
3465+For explanation about what it means and how to use it, please refer to
3466+:doc:`/scripts`.
3467+
3468+The option is multiline. Each line specifies exactly one
3469+script, and must respect the following format:
3470+
3471+ ``ENTRY_POINT_NAME[=WISHED_SCRIPT_NAME] [MODIFIER [MODIFIER […]]]``
3472+
3473+Each modifier takes the ``MODIFIER_NAME=MODIFIER_VALUE`` form.
3474+No whitespace is allowed in modifiers, entry point, nor produced script names.
3475+
3476+Here's the list of currently available modifiers, with links inside :doc:`the
3477+dedicated chapter about OpenERP scripts </scripts>`).
3478+
3479+:command-line-options: :ref:`command_line_options`
3480+:arguments: :ref:`arguments_session`
3481+
3482+Full example::
3483+
3484+ openerp_scripts = my_script arguments=session
3485+ my_other_script=actual-script-name arguments=3,session
3486+ nosetests=nosetests command-line-options=-d
3487+
3488+
3489+.. _upgrade_script_name:
3490+
3491+upgrade_script_name
3492+-------------------
3493+
3494+This option lets you specify the wished name for the upgrade script.
3495+The default value is ``upgrade_<part_name>``.
3496+
3497+.. note:: new in version 1.8.0.
3498+
3499+ We are actually not sure to keep that option, since it's
3500+ redundant with :ref:`openerp_scripts`.
3501+
3502+
3503+.. _upgrade_script:
3504+
3505+upgrade_script
3506+--------------
3507+
3508+.. note:: new in version 1.8.0
3509+
3510+This option lets you specify a source (``.py``) file and a callable
3511+defined in that file to perform database upgrades. The default value
3512+is::
3513+
3514+ upgrade_script = upgrade.py run
3515+
3516+If the specified source file doest not exist, the recipe will
3517+initialize it with a simple and meaningful sample content, consistent
3518+with the default value above.
3519+
3520+If you want *not* to have an upgrade script, just override this option
3521+with a blank value::
3522+
3523+ upgrade_script =
3524+
3525+See the full :ref:`upgrade_scripts` documentation to learn more
3526+about upgrade scripts.
3527+
3528+.. note:: new in version 1.8.0
3529+
3530+
3531+.. _gunicorn:
3532
3533 gunicorn
3534 --------
3535
3536-Gunicorn integration is only supported on OpenERP >= 6.1.
3537+Gunicorn integration is only supported on OpenERP ≥ 6.1.
3538 Any value of this option makes the recipe generate a script to start
3539 OpenERP with Gunicorn and (*new in version 1.1*) a dedicated script to
3540 handle cron jobs.
3541
3542 For OpenERP 6.1, the only accepted values are ``direct`` and
3543-``proxied``. Any value is suitable for OpenERP >= 7
3544+``proxied``. Any value is suitable for OpenERP ≥ 7
3545
3546 Proxied mode
3547 ````````````
3548@@ -503,7 +500,7 @@
3549
3550 gunicorn = proxied
3551
3552-This behaviour has been kept for OpenERP >= 7 to keep
3553+This behaviour has been kept for OpenERP ≥ 7 to keep
3554 backwards compatibility, but the option is now superseded by the
3555 general ``proxy_mode`` option of the server. In the buildout context,
3556 that'd be::
3557@@ -552,25 +549,24 @@
3558 allows for graceful restarts (use this for minor changes only).
3559
3560
3561+.. _openerp_command_name:
3562+
3563 openerp_command_name
3564 --------------------
3565-.. warning:: as of version 1.7.0, this option is deprecated, check
3566- ``openerp_scripts`` for more details.
3567+.. warning:: as of version 1.7.0, this option is deprecated because of
3568+ its redundancy with :ref:`openerp_scripts`.
3569
3570 OpenERP Command Line Tools (openerp-command for short) is an
3571 alternative set of command-line tools that may someday subsede the
3572 current monolithic startup script. Currently experimental, but
3573 already very useful in development mode.
3574
3575-It is currently enabled if the ``with_devtools`` option is on.
3576+It is currently enabled if the :ref:`with_devtools` option is on.
3577
3578 This works by requiring the ``openerp-command`` python
3579-distribution, which is not on PyPI as of this writting. You may want
3580-to use the ``vcsdevelop`` extension to get it from Launchpad::
3581-
3582- [buildout]
3583- extensions = gp.vcsdevelop
3584- vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command#egg=openerp-command
3585+distribution, which is not on PyPI as of this writting, but comes
3586+bundled with the current OpenERP trunk (believed to be the future
3587+OpenERP 8).
3588
3589 As for other scripts, you can control its name of the produced script, e.g::
3590
3591@@ -580,11 +576,226 @@
3592 ``oe`` is the classical name for this script outside of the realm of
3593 this buildout recipe.
3594
3595+.. note:: ``openerp-command`` has first been introduced as a separate
3596+ project while OpenERP 7.0 was in development stage. People
3597+ wanting to use it with OpenERP 7.0 can still grab it from
3598+ Launchpad with the ``gp.vcsdevelop`` extension::
3599+
3600+ [buildout]
3601+ extensions = gp.vcsdevelop
3602+ vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command@419#egg=openerp-command
3603+
3604+ The latest Launchpad revision is actually the final removal,
3605+ done at the time where it's been included in
3606+ ``lp:openobject-server``.
3607+
3608+
3609 .. warning::
3610
3611- Do not use to launch production servers, especially in an automatic
3612- way, openerp-command is really unstable and that may damage your
3613- installation.
3614+ On OpenERP 7, do not use to launch production servers, especially in
3615+ an automatic way, ``openerp-command`` is really unstable and that
3616+ may damage your installation.
3617+
3618+
3619+
3620+scripts
3621+-------
3622+.. note:: This option is useful for general purpose scripts
3623+ only. For scripts related to OpenERP, see
3624+ :doc:`/scripts`, and the :ref:`openerp_scripts` option.
3625+
3626+This option controls the generation of console scripts declared by the
3627+various involved Python distributions (either directly required with
3628+the :ref:`eggs` option, or by dependency).
3629+
3630+By default, no such script is generated, but you may specify some
3631+according to your needs, with the same semantics as in ``zc.recipe.egg``.
3632+
3633+ scripts = change_tz
3634+
3635+In the current state, beware to *not* require the same script in different
3636+parts or rename them. See
3637+https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for
3638+details.
3639+
3640+
3641+.. _startup_delay:
3642+
3643+startup_delay
3644+-------------
3645+
3646+Specifies a delay in seconds to wait before actually launching OpenERP. This
3647+option was a preliminary hack to support both gunicorn instance and a legacy
3648+instance. The Gunicorn startup script (see below) itself is not affected by
3649+this setting ::
3650+
3651+ startup_delay = 3
3652+
3653+Options for development, QA and introspection
3654+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3655+
3656+.. _with_devtools:
3657+
3658+with_devtools
3659+-------------
3660+Allows to load development and install useful devlopment and testing
3661+tools, notably the following scripts:
3662+
3663+* ``test_openerp``: a uniform test launcher for all supported
3664+ versions. See test_script_name option below for details.
3665+* ``openerp_command``: see openerp_command_name option below for
3666+ details. Not installed for OpenERP major versions less than or equal to 6.1.
3667+
3668+This option is False by default, hence it's activated this way::
3669+
3670+ with_devtools = true
3671+
3672+It will also add some dependencies that are typical to development
3673+setups (tests related packages etc.) and automatically load where
3674+needed helpers, such as `anybox.testing.datetime
3675+<http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to
3676+cheat with system time).
3677+
3678+
3679+.. _test_script_name:
3680+
3681+test_script_name
3682+----------------
3683+.. warning:: as of version 1.7.0, this option is deprecated because of its
3684+ redundancy with :ref:`openerp_scripts`.
3685+
3686+If the ``with_devtools`` is set to True, the recipe will create a
3687+test script, which is named by default ``test_<part_name>``. You may
3688+override the name in the configuration as in the following example::
3689+
3690+ test_script_name = test_erp
3691+
3692+The test script takes the same arguments as the regular startup
3693+script::
3694+
3695+ bin/test_openerp --help
3696+ bin/test_openerp -d test_db -i purchase,sale
3697+
3698+At the time of this writing, all this script does compared to the
3699+regular startup script is to bring uniformity across OpenERP versions
3700+by tweaking options internally.
3701+
3702+*As of version 1.8.2*, the ``--install-all`` additional option will be
3703+expanded on-the-fly as ``-i`` on all available modules (don't confuse
3704+with ``-i all``: the latter is equivalent to ``-i base``).
3705+
3706+
3707+.. _interpreter_name:
3708+
3709+interpreter_name
3710+----------------
3711+
3712+The recipe will automatically create a python interpreter with a
3713+``session`` object that can bootstrap OpenERP with a database right
3714+away. You can use that for interactive sessions or to launch a script::
3715+
3716+ $ bin/python_openerp
3717+ To start the OpenERP working session, just do:
3718+ session.open()
3719+ or
3720+ session.open(db=DATABASE_NAME)
3721+ Then you can issue commands such as
3722+ session.registry('res.users').browse(session.cr, 1, 1)
3723+
3724+ >>>
3725+
3726+The interpreter name is ``python_<part_name>`` by default; but it can
3727+be explicitely set like this::
3728+
3729+ interpreter_name = my_py
3730+
3731+If you want *not* to have the interpreter, juste do
3732+
3733+ interpreter_name =
3734+
3735+If you want to wrap a python script with such session objects, read
3736+:doc:`/scripts` and especially :ref:`arguments_session`.
3737+See also :ref:`openerp_scripts`.
3738+
3739+.. note:: this facility is new in version 1.6.0, and tested with
3740+ OpenERP ≥ 6.1 only for now.
3741+
3742+
3743+interpreter
3744+-----------
3745+With the ``gtkclient`` and ``webclient`` recipes,
3746+this behauves like the `interpreter` option of `zc.recipe.egg`: it
3747+gives you a Python interpreter in the ``bin`` subdirectory of the buildout::
3748+
3749+ interpreter = erp_python
3750+
3751+With the ``server`` recipe, the ``interpreter`` option will be ignored,
3752+because this recipe always creates an interpreter with preloaded objects to
3753+bootstrap openerp, and these depend on the configuration.
3754+Check :ref:`interpreter_name` for more details.
3755+
3756+
3757+
3758+
3759+Options for download and caching strategies
3760+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3761+
3762+Let us start by listing a few global buildout options (to be put in
3763+the ``[buildout]`` section), whose scope is much larger than the
3764+OpenERP recipe.
3765+
3766+:eggs-directory: control where eggs are stored after download and/or
3767+ build and reciprocally acts as a cache.
3768+:index: specifies where to get informations about distributions not found in
3769+ ``eggs-directory``.
3770+:find-links: direct URLs to look for distributions
3771+:allow-hosts: white list of URL patterns allowed for distributions
3772+ download. Great to exclude the numerous useless sites
3773+ that setuptools may want to crawl and which tend to
3774+ break each time a new version gets referenced on PyPI.
3775+
3776+The OpenERP recipes define a few more.
3777+
3778+
3779+.. _base_url:
3780+
3781+base_url
3782+--------
3783+This option is local to the *part*.
3784+
3785+URL from which to download official and nightly versions
3786+(assuming the archive filenames are constistent with those in
3787+OpenERP download server). This is a basic mirroring capability::
3788+
3789+ base_url = http://download.example.com/openerp/
3790+
3791+
3792+.. _openerp-downloads-directory:
3793+
3794+openerp-downloads-directory
3795+---------------------------
3796+This is an option for the ``[buildout]`` section
3797+
3798+Allows to share OpenERP downloads among several buildouts. You should put this
3799+option in your ``~/.buildout/default.cfg`` file. It specifies the destination
3800+download directory for OpenERP archives. The path may be absolute or relative
3801+to the buildout directory.
3802+
3803+Example::
3804+
3805+ [buildout]
3806+ openerp-downloads-directory = /home/user/.buildout/openerp-downloads
3807+
3808+
3809+
3810+Options for release and packaging
3811+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3812+
3813+.. note:: release and packaging should be provided by dedicated
3814+ executables, not by options. These options should disappear
3815+ at some point between 1.8 and 1.9 versions.
3816+
3817+.. _freeze-to:
3818
3819 freeze-to
3820 ---------
3821@@ -613,7 +824,7 @@
3822 bin/buildout -o openerp-server-1:freeze-to=frozen.cfg
3823
3824 This produces a buildout configuration file named ``frozen.cfg``,
3825-with notably an ``openerp-server-1`` part having a ``revisions`` option that
3826+with notably an ``openerp-server-1`` part having a :ref:`revisions` option that
3827 freezes everything.
3828
3829 For configurations with several openerp related parts, you can freeze
3830@@ -641,22 +852,25 @@
3831 .. warning:: currently ``freeze-to`` cannot fix eggs versions related
3832 to non-openerp parts.
3833
3834+.. _freeze-allow-picked-versions:
3835+
3836 freeze-allow-picked-versions
3837 ----------------------------
3838
3839-This option is to be used in conjunction with ``freeze-to``. If set to
3840+This option is to be used in conjunction with :ref:`freeze-to`. If set to
3841 ``False``, it will add ``allow-picked-versions = false``
3842 for ``zc.buildout`` versions that support this flag.
3843
3844 .. warning:: in the current state of things, this can cause problems
3845- if you have non-openerp parts (see warning in ``freeze-to``
3846- documentation).
3847+ if you have non-openerp parts (see the various warnings
3848+ in :ref:`freeze-to`)
3849
3850+.. _extract-downloads-to:
3851
3852 extract-downloads-to
3853 --------------------
3854
3855-Following the same kind of logic as ``freeze-to``, this option allows
3856+Following the same kind of logic as :ref:`freeze-to`, this option allows
3857 to turn a buildout that aggregates from various remote sources
3858 (tarball downloads, VCSes) into a self-contained buildout archive
3859 directory that can be packed for easy distribution.
3860@@ -685,8 +899,8 @@
3861 or further extended for system-dependent options such as port, db
3862 connection, etc.
3863
3864-The ``extract-downloads-to`` options can be used for several parts
3865-with the same target directory (same as ``freeze-to``).
3866+The ``extract-downloads-to`` option can be used for several parts
3867+with the same target directory (same as :ref:`freeze-to`).
3868
3869 Furthermore, a default ``freeze-to`` is issued, producing a buildout
3870 configuration called ``extracted_from.cfg`` in the target directory,
3871@@ -698,317 +912,3 @@
3872 same rules with respect to uncommitted changes.
3873
3874 Python distributions managed with ``gp.vcsdevelop`` are taken into account.
3875-
3876-
3877-OpenERP options
3878----------------
3879-
3880-You can define OpenERP options directly from the buildout file (usually
3881-``buildout.cfg``) in the recipe section.
3882-The OpenERP configuration files are generated by OpenERP itself in the directory
3883-specified by ``etc-directory`` which defaults to the `etc` directory under your
3884-buildout directory.
3885-The settings of the OpenERP configuration files can be controlled using a
3886-dotted notation prefixed by the name of the corresponding section of the
3887-OpenERP config file. The specified options will just overwrite the existing
3888-options in the corresponding config files. You don't have to replicate all the
3889-options in your section of the buildout file. If a setting or a section does
3890-not natively exist in the openerp config file, it can be created from there for
3891-your application.
3892-
3893-For example you can specify the xmlrpc port for the server or
3894-even an additional option that does not exist in the default config file::
3895-
3896- options.xmlrpc_port = 8069
3897- options.additional_option = "foobar"
3898-
3899-It will end-up in the server config as::
3900-
3901- [options]
3902- xmlrpc_port = 8069
3903- additional_option = "foobar"
3904-
3905-For the web client you can specify the company url with::
3906-
3907- global.server.socket_port = 8080
3908- openerp-web.company.url = 'http://anybox.fr'
3909-
3910-It will modify the corresponding web client config::
3911-
3912- [global]
3913- server.socket_port = 8080
3914-
3915- [openerp-web]
3916- company.url = 'http://anybox.fr'
3917-
3918-
3919-.. note:: Note that for security reason, the superadmin password is not set by
3920- default. If you want to create a database you should temporary set it manually
3921- in the etc/openerp.conf file
3922-
3923-
3924-
3925-.. _howto:
3926-
3927-How to create and bootstrap a buildout
3928-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3929-
3930-To create a buildout and run the build, you just need **1 file** and **2 commands**:
3931-
3932-- Create a single ``buildout.cfg`` file.
3933-- Be sure you installed all your build dependencies
3934-- Bootstrap the buildout with: ``python bootstrap.py``
3935-- Run the build with: ``bin/buildout``
3936-
3937-The same with more details below :
3938-
3939-Creating the buildout
3940----------------------
3941-
3942-Create a ``buildout.cfg`` file in an empty directory, containing the
3943-configuration of the `example 6.1`_ section.
3944-
3945-.. _dependencies:
3946-
3947-Installing build dependencies
3948------------------------------
3949-
3950-You basically need typical development tools needed to build all the Python
3951-dependency eggs of OpenERP. You can do this by yourself with your system or
3952-Linux distribution.
3953-
3954-Or if you're using a Debian system, we provide a single dependency package you
3955-can use to install all dependencies in one shot:
3956-
3957-Add the following line in your ``/etc/apt/sources.list``::
3958-
3959- deb http://apt.anybox.fr/openerp common main
3960-
3961-Install the dependency package::
3962-
3963- $ sudo aptitude update
3964- $ sudo aptitude install openerp-server-system-build-deps
3965-
3966-You can uninstall this package with `aptitude` after the build to
3967-automatically remove all un-needed dependencies, but you need to
3968-install *run dependencies* before that ::
3969-
3970- $ sudo aptitude install openerp-server-system-run-deps
3971- $ sudo aptitude remove openerp-server-system-build-deps
3972-
3973-Please note that these package will have your system install the
3974-*client* part of PostgreSQL software only. If you want a
3975-PostgreSQL server on the same host, that's not in the recipe scope,
3976-just install it as well.
3977-
3978-Bootstrapping the buildout
3979---------------------------
3980-
3981-Bootstrapping the buildout consists in creating the basic structure of the buildout, and installing buildout itself in the directory.
3982-
3983-The easiest and recommended way to bootstrap is to use a ``bootstrap.py`` script::
3984-
3985- $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py
3986- $ python bootstrap.py
3987-
3988-As an alternative and more complicated solution, you may also bootstrap by
3989-creating a virtualenv, installing zc.buildout, then run the bootstrap::
3990-
3991- $ virtualenv sandbox
3992- $ sandbox/bin/pip install zc.buildout
3993- $ sandbox/bin/buildout bootstrap
3994-
3995-Running the build
3996------------------
3997-
3998-Just run ::
3999-
4000- $ bin/buildout
4001-
4002-Starting OpenERP
4003-----------------
4004-
4005-Just run ::
4006-
4007- $ bin/start_openerp
4008-
4009-
4010-.. _example 6.1:
4011-
4012-Example OpenERP 6.1 buildout
4013-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4014-
4015-Here is a very simple example for a latest OpenERP 6.1 nightly and a
4016-custom addon hosted on Bitbucket:
4017-
4018-::
4019-
4020- [buildout]
4021- parts = openerp
4022- versions = versions
4023- find-links = http://download.gna.org/pychart/
4024-
4025- [openerp]
4026- recipe = anybox.recipe.openerp:server
4027- # replace '6.1' with 'trunk' to get a 7.0 current nightly:
4028- version = nightly 6.1 latest
4029- addons = hg https://bitbucket.org/anybox/anytracker addons-at default
4030-
4031- [versions]
4032- MarkupSafe = 0.15
4033- Pillow = 1.7.7
4034- PyXML = 0.8.4
4035- babel = 0.9.6
4036- feedparser = 5.1.1
4037- gdata = 2.0.16
4038- lxml = 2.3.3
4039- mako = 0.6.2
4040- psycopg2 = 2.4.4
4041- pychart = 1.39
4042- pydot = 1.0.28
4043- pyparsing = 1.5.6
4044- python-dateutil = 1.5
4045- python-ldap = 2.4.9
4046- python-openid = 2.2.5
4047- pytz = 2012b
4048- pywebdav = 0.9.4.1
4049- pyyaml = 3.10
4050- reportlab = 2.5
4051- simplejson = 2.4.0
4052- vatnumber = 1.0
4053- vobject = 0.8.1c
4054- werkzeug = 0.8.3
4055- xlwt = 0.7.3
4056- zc.buildout = 1.5.2
4057- zc.recipe.egg = 1.3.2
4058- zsi = 2.0-rc3
4059-
4060-
4061-.. note:: with OpenERP 6.1 the web client is natively included in the server as a
4062- simple module. In that case you don't need to write a separate part for the web
4063- client, unless that's what you really want to do.
4064-
4065-
4066-Example OpenERP 6.0 buildout
4067-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4068-
4069-Here is a sample buildout with version specification, 2 OpenERP servers (with
4070-one using the latest 6.0 branch on the launchpad) using only NETRPC and
4071-listening on 2 different ports, and 2 web clients::
4072-
4073- [buildout]
4074- parts = openerp1 web1 openerp2 web2
4075- #allow-picked-versions = false
4076- versions = versions
4077- find-links = http://download.gna.org/pychart/
4078-
4079- [openerp1]
4080- recipe = anybox.recipe.openerp:server
4081- version = 6.0.3
4082- options.xmlrpc = False
4083- options.xmlrpcs = False
4084-
4085- [web1]
4086- recipe = anybox.recipe.openerp:webclient
4087- version = 6.0.3
4088-
4089- [openerp2]
4090- recipe = anybox.recipe.openerp:server
4091- version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1
4092-
4093- options.xmlrpc = False
4094- options.xmlrpcs = False
4095- options.netrpc_port = 8170
4096-
4097- [web2]
4098- recipe = anybox.recipe.openerp:webclient
4099- version = 6.0.3
4100- global.openerp.server.port = '8170'
4101- global.server.socket_port = 8180
4102-
4103- [versions]
4104- MarkupSafe = 0.15
4105- Pillow = 1.7.7
4106- anybox.recipe.openerp = 0.9
4107- caldav = 0.1.10
4108- collective.recipe.cmd = 0.5
4109- coverage = 3.5
4110- distribute = 0.6.25
4111- feedparser = 5.0.1
4112- lxml = 2.1.5
4113- mako = 0.4.2
4114- nose = 1.1.2
4115- psycopg2 = 2.4.2
4116- pychart = 1.39
4117- pydot = 1.0.25
4118- pyparsing = 1.5.6
4119- python-dateutil = 1.5
4120- pytz = 2012b
4121- pywebdav = 0.9.4.1
4122- pyyaml = 3.10
4123- reportlab = 2.5
4124- vobject = 0.8.1c
4125- z3c.recipe.scripts = 1.0.1
4126- zc.buildout = 1.5.2
4127- zc.recipe.egg = 1.3.2
4128- Babel = 0.9.6
4129- FormEncode = 1.2.4
4130- simplejson = 2.1.6
4131-
4132-
4133-Other sample buildouts
4134-~~~~~~~~~~~~~~~~~~~~~~
4135-
4136-Here are a few ready-to-use buildouts:
4137-
4138-(Be sure to install system dependencies_ first)
4139-
4140-OpenERP with the development branches of the Magento connector addons::
4141-
4142- $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout
4143- $ cd openerp_connect_magento_buildout
4144- $ python bootstrap.py
4145- $ bin/buildout
4146- $ bin/start_openerp
4147-
4148-OpenERP with the development branches of the Prestashop connector addons::
4149-
4150- $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout
4151- $ cd openerp_connect_prestashop_buildout
4152- $ python bootstrap.py
4153- $ bin/buildout
4154- $ bin/start_openerp
4155-
4156-Other examples are available in the ``buildbot`` subdirectory of the
4157-source distribution archive of this recipe (the ``tar.gz`` file that
4158-can be downloaded `from the PyPI
4159-<http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are
4160-continuously tested in the
4161-`anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by
4162-`anybox.buildbot.openerp <http://pypi.python.org/pypi/anybox.buildbot.openerp>`_.
4163-
4164-
4165-Contribute
4166-~~~~~~~~~~
4167-
4168-Authors:
4169-
4170- * Christophe Combelles
4171- * Georges Racinet
4172-
4173-Contributors:
4174-
4175- * Jean-Sébastien Suzanne
4176- * Yannick Vaucher
4177- * Jacques-Etienne Baudoux
4178- * Laurent Mignon
4179- * Leonardo Pistone
4180-
4181-The primary branch is on the launchpad:
4182-
4183- * Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp
4184- * PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp
4185-
4186-Please don't hesitate to give feedback and especially report bugs or
4187-ask for new features through launchpad at this URL: https://bugs.launchpad.net/anybox.recipe.openerp/+bugs
4188-
4189
4190=== added file 'doc/contributing.rst'
4191--- doc/contributing.rst 1970-01-01 00:00:00 +0000
4192+++ doc/contributing.rst 2014-02-06 07:42:46 +0000
4193@@ -0,0 +1,187 @@
4194+For contributors
4195+================
4196+
4197+Source and tracking
4198+~~~~~~~~~~~~~~~~~~~
4199+The recipe is currently hosted as a launchpad project, under Bazaar
4200+version control: https://launchpad.net/anybox.recipe.openerp
4201+
4202+We follow the standard launchpad workflow (bugs, merge requests…).
4203+Code contributors are systematically added to the list of
4204+contributors at the end of the README, unless they explicitely wish
4205+not to (what Launchpad does is obvisouly out of our scope).
4206+
4207+There are currently no branch naming rules.
4208+
4209+Members of the "Anybox" team have push privileges on the main branches.
4210+
4211+Using a development version
4212+~~~~~~~~~~~~~~~~~~~~~~~~~~~
4213+
4214+To use a local version of the recipe, you may use the ``develop``
4215+general buildout option::
4216+
4217+ [buildout]
4218+ develop = /path/to/anybox.recipe.openerp
4219+
4220+To track the latest version of a ``bzr`` branch of the recipe, we find
4221+the
4222+`gp.vcsdevelop <https://pypi.python.org/pypi/gp.vcsdevelop>`_
4223+extension simple and useful. Here's an example (excerpt from
4224+``buildot/recipe-trunk.cfg``)::
4225+
4226+ [buildout]
4227+ extensions = gp.vcsdevelop
4228+ vcs-extend-develop = bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
4229+ vcs-update = True
4230+
4231+.. note::
4232+ Actually some parts of the recipe are aware of the possible use
4233+ of ``gp.vcsdevelop`` for python dependencies, and special care of it is
4234+ taken in the freeze and extract features. This is known to work even
4235+ for ``zc.buildout`` itself.
4236+
4237+Development setup
4238+~~~~~~~~~~~~~~~~~
4239+
4240+We recommend "developping" the source code in a virtualenv, together
4241+with ``bzr``. For instance::
4242+
4243+ virtualenv recipe-env
4244+ recipe-env/bin/pip install bzr
4245+ recipe-env/bin/bzr branch lp:anybox.recipe.openerp
4246+ cd anybox.recipe.openerp
4247+ python setup.py develop
4248+
4249+Coding style
4250+~~~~~~~~~~~~
4251+
4252+The recipe follows the same strong code development coding principles
4253+as many other projects:
4254+
4255+* Style enforcement : we follow the PEP8 guidelines
4256+* Static analysis with `flake8 <https://pypi.python.org/pypi/flake8>`_
4257+ (combines conveniently `pep8 <https://pypi.python.org/pypi/pep8>`_
4258+ and `pyflakes <https://pypi.python.org/pypi/pyflakes>`_).
4259+* Unit tests : we try and test as much as possible. It is hard to achieve a
4260+ real 100% with a tool that calls so many external processes, but
4261+ this is mitigated by our
4262+ :ref:`continuous integration <continuous_integration>` practice of
4263+ doing real OpenERP installations with the latest revision of the recipe.
4264+
4265+Launching static analysis and unit tests
4266+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4267+
4268+Install ``nose``, ``flake8`` and, optionally, ``coverage``::
4269+
4270+ recipe-env/bin/pip install nose coverage flake8==2.0 \
4271+ pep8=1.4.6 mccabe==0.2.1 pyflakes==0.7.3 nose
4272+
4273+
4274+.. note:: we've had problems lately with discrepancies in ``pep8``
4275+ versions, that's why versions of ``flake8`` and its
4276+ dependencies are fixed above. In case of doubt, check what
4277+ the buildbot is actually running.
4278+
4279+Run ``flake8`` and the tests::
4280+
4281+ cd anybox.recipe.openerp
4282+ flake8 anybox && nosetests anybox --with-doctest
4283+
4284+There is also this convenience to run the tests and output a coverage report::
4285+
4286+ source ./test-cover
4287+
4288+
4289+.. _integration tests:
4290+
4291+Integration tests
4292+~~~~~~~~~~~~~~~~~
4293+
4294+There is a special category of tests: those that need a real OpenERP
4295+instance, built with the recipe, to run.
4296+
4297+They are located within the ``tests_with_openerp`` subdirectory and
4298+need to be launched with a launcher script constructed by the recipe.
4299+
4300+For example, create a testing buildout like this::
4301+
4302+ [openerp]
4303+ # version as you wish
4304+ eggs = nose
4305+ openerp_scripts nosetests command-line-options = -d
4306+
4307+Then run ``bin/buildout``, create a database and initialize it. From
4308+the buildout directory::
4309+
4310+ createdb test-recipe
4311+ bin/start_openerp -d test-recipe -i base --stop-after-init
4312+
4313+You can then run the tests::
4314+
4315+ bin/nosetests_openerp -d test-recipe -- /path/to/recipe/branch/tests_with_openerp
4316+
4317+Currently, these tests are all about the ``Session`` objects, used in
4318+scripts.
4319+
4320+.. note:: you may use a different version of the recipe to build that
4321+ testing buildout. This is anyway what happens if you build
4322+ with your development version, and hack some changes
4323+ afterwards.
4324+
4325+ Using a very different version of the recipe could give
4326+ funky results, but you're supposed to know what you're doing
4327+ at this point.
4328+
4329+
4330+.. _continuous_integration:
4331+
4332+Continuous integration
4333+~~~~~~~~~~~~~~~~~~~~~~
4334+
4335+Basic builds
4336+------------
4337+
4338+Upon each push on the main branches, Anybox' public
4339+buildbot awakes to check the coding style, run the tests and build
4340+this documentation. You may check the status there:
4341+
4342+* `trunk builder
4343+ <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp>`_
4344+* `stable builder
4345+ <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp-stable>`_
4346+
4347+Actual runs
4348+-----------
4349+
4350+Furthermore, this buildbot instance runs `anybox.buildbot.openerp
4351+<https://pypi.python.org/pypi/anybox.buildbot.openerp>`_,
4352+a buildbot configurator for OpenERP installations based on the recipe.
4353+
4354+This is used in turn to run high-level integration tests, having the
4355+latest bzr version of the recipe actually install several combinations
4356+of OpenObject server and addons, and run their unit tests.
4357+
4358+The configuration is stored in the ``buildbot`` subdirectory of the
4359+recipe trunk branch. It is made of a high level configuration file
4360+(``MANIFEST.cfg``) and buildout configuration files. This buildbot
4361+instance actually aggregates several such configurations.
4362+
4363+The corresponding builders are those whose name starts with
4364+``recipe-`` or ``stable-recipe-`` in the `builders list
4365+<http://buildbot.anybox.fr/builders>`_.
4366+
4367+.. note:: the `integration tests`_ mentioned above are executed in
4368+ particular during this process, currently in the
4369+ ``recipe-7.0-postgresql-9.2`` builder.
4370+
4371+Some builds may appear to be broken because of tests failures been
4372+pushed by upstream in OpenERP itself or in the tested addons, but it's
4373+easy to check whether this is due to a recipe failure or not.
4374+
4375+.. note::
4376+
4377+ Anybox hardware resources are limited; contributing buildslaves would
4378+ be greatly appreciated.
4379+
4380+
4381
4382=== added file 'doc/dev_prod_workflow.rst'
4383--- doc/dev_prod_workflow.rst 1970-01-01 00:00:00 +0000
4384+++ doc/dev_prod_workflow.rst 2014-02-06 07:42:46 +0000
4385@@ -0,0 +1,32 @@
4386+Full development to production example
4387+=======================================
4388+
4389+In this example, we present one way of organizing a project, to
4390+provide easy to install development setups, continuous integration and
4391+production deployments.
4392+
4393+Please read this as a pattern among many others. If you decide to base
4394+your development process on it, you'll have to adapt it to your team's
4395+practice anyway.
4396+
4397+Common setup
4398+~~~~~~~~~~~~
4399+
4400+Developer's setup
4401+~~~~~~~~~~~~~~~~~
4402+Here we add private read-write access to version control systems.
4403+We need to version the buildout itself, and make decisions about which
4404+addons will be under active development within that project.
4405+
4406+At this point, asking a developer to work on the project is as simple
4407+as providing the main URL to get the buildout from VCS.
4408+
4409+Release and packaging
4410+~~~~~~~~~~~~~~~~~~~~~
4411+Use of ``freeze-to``, ``extract-downloads-to``, and production of a tarball.
4412+
4413+Deployment with a server-local configuration file
4414+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4415+You may decide to track the local files with a VCS, too, but it's
4416+preferable to keep it distinct from the main code base.
4417+
4418
4419=== added file 'doc/first_steps.rst'
4420--- doc/first_steps.rst 1970-01-01 00:00:00 +0000
4421+++ doc/first_steps.rst 2014-02-06 07:42:46 +0000
4422@@ -0,0 +1,351 @@
4423+First steps
4424+===========
4425+
4426+
4427+.. _howto:
4428+
4429+How to create and bootstrap a buildout
4430+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4431+
4432+To create a buildout and run the build, you just need **1 file** and **2 commands**:
4433+
4434+- Create a single ``buildout.cfg`` file.
4435+- Be sure you installed all your build dependencies
4436+- Bootstrap the buildout with: ``python bootstrap.py``
4437+- Run the build with: ``bin/buildout``
4438+
4439+The same with more details below :
4440+
4441+Creating the buildout
4442+---------------------
4443+
4444+Create a ``buildout.cfg`` file in an empty directory, containing the
4445+configuration of the `example 6.1`_ section.
4446+
4447+.. _dependencies:
4448+
4449+Installing build dependencies
4450+-----------------------------
4451+
4452+You basically need typical development tools needed to build all the Python
4453+dependency eggs of OpenERP. You can do this by yourself with your system or
4454+Linux distribution.
4455+
4456+Or if you're using a Debian based distribution, we provide a single
4457+dependency package you can use to install all dependencies in one shot:
4458+
4459+Add the following line in your ``/etc/apt/sources.list``::
4460+
4461+ deb http://apt.anybox.fr/openerp common main
4462+
4463+If you don't want your system to complain about non-signed packages,
4464+have it accept the signing key, e.g. by issuing::
4465+
4466+ sudo apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 0xE38CEB07
4467+
4468+(sometimes, the key server is too busy, you may need to wait a few
4469+minutes and try again)
4470+
4471+Install the dependency package::
4472+
4473+ $ sudo aptitude update
4474+ $ sudo aptitude install openerp-server-system-build-deps
4475+
4476+You can uninstall this package with ``aptitude`` after the build to
4477+automatically remove all un-needed dependencies, but you need to
4478+install *run dependencies* before that ::
4479+
4480+ $ sudo aptitude install openerp-server-system-run-deps
4481+ $ sudo aptitude remove openerp-server-system-build-deps
4482+
4483+Please note that these package will have your system install the
4484+*client* part of PostgreSQL software only. If you want a
4485+PostgreSQL server on the same host, that's not in the recipe scope,
4486+just install it as well.
4487+
4488+Bootstrapping the buildout
4489+--------------------------
4490+Bootstrapping the buildout consists in creating the basic structure of
4491+the buildout, and installing buildout itself in the directory.
4492+Once it's been done, everything is under tight control.
4493+
4494+The easiest way to bootstrap is to use the ``bootstrap.py`` script::
4495+
4496+ $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py
4497+
4498+As of zc.buildout version 2.2, strong isolation from the system-wide Python
4499+installation has been abandoned because of its redundancy with the
4500+very popular `virtualenv <https://pypi.python.org/pypi/virtualenv>`_.
4501+Besides, the bootstrap actually fails if a version of
4502+setuptools older than 0.7 is present system-wide (happens easily
4503+enough at the time of this writing).
4504+
4505+The universal current way of doing is therefore to start from a
4506+virtualenv *without setuptools*. For virtualenv >= 1.9, just do::
4507+
4508+ $ virtualenv sandbox --no-setuptools
4509+
4510+For older versions of virtualenv::
4511+
4512+ $ virtualenv sandbox
4513+ $ sandbox/bin/pip uninstall setuptools pip
4514+
4515+.. note:: to install virtualenv.
4516+
4517+ * Debian family: sudo aptitude install python-virtualenv
4518+ * Redhat/Fedora/CenOS family: sudo yum install python-virtualenv
4519+
4520+Finally, perform the bootstrap with the virtualenv's Python::
4521+
4522+ $ sandbox/bin/python bootstrap.py
4523+
4524+From now on, all buildout related operations, including OpenERP
4525+startup script, custom scripts will be protected by this virtualenv.
4526+
4527+.. note:: nothing, not even ``zc.buildout`` actually gets installed by
4528+ buildout in such a virtualenv.
4529+ It's *totally safe* if you're managing several buildouts to
4530+ share a single such virtualenv among all of them.
4531+
4532+.. note:: since the bootstrap operation is so sensitive, we recommend
4533+ package managers to include the precise ``bootstrap.py`` in
4534+ their distributed buildout, and to bundle a future-proof
4535+ shell script, using options such as ``-v``.
4536+
4537+
4538+Running the build
4539+-----------------
4540+
4541+Just run ::
4542+
4543+ $ bin/buildout
4544+
4545+Starting OpenERP
4546+----------------
4547+
4548+Just run ::
4549+
4550+ $ bin/start_openerp
4551+
4552+.. _example 7.0:
4553+
4554+Example OpenERP 7.0 buildouts
4555+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4556+This example builds the latest nightly OpenERP 7 version.
4557+Note how most Python distribution versions are pinned.
4558+
4559+While not mandatory, version pinning is an
4560+important part of the buildout culture. Note also how even ``zc.buildout``
4561+and the current recipe versions can be pinned::
4562+
4563+ [buildout]
4564+ parts = openerp
4565+ versions = versions
4566+ find-links = http://download.gna.org/pychart/
4567+
4568+ [openerp]
4569+ recipe = anybox.recipe.openerp[bzr]:server
4570+ version = nightly 7.0 latest
4571+
4572+ [versions]
4573+ setuptools = 1.1.0
4574+ zc.buildout = 2.2.1
4575+ zc.recipe.eggs = 2.0.0
4576+ anybox.recipe.openerp = 1.7.1
4577+ babel = 0.9.6
4578+ Pillow = 1.7.1
4579+ pywebdav = 0.9.4.1
4580+ PyXML = 0.8.4
4581+ pyyaml = 3.10
4582+ werkzeug = 0.8.3
4583+ zsi = 2.0-rc3
4584+ feedparser = 5.1.1
4585+ gdata = 2.0.16
4586+ lxml = 2.3.3
4587+ psycopg2 = 2.4.4
4588+ pydot = 1.0.28
4589+ pyparsing = 1.5.6
4590+ python-dateutil = 1.5
4591+ python-ldap = 2.4.9
4592+ python-openid = 2.2.5
4593+ pytz = 2012b
4594+ vatnumber = 1.0
4595+ vobject = 0.8.1c
4596+ xlwt = 0.7.3
4597+
4598+Of course, installing the latest nightly release provided by OpenERP
4599+is not really interesting. The flexibility is.
4600+
4601+Here's an example with the latest versions of the 7.0 Bazaar branches
4602+on Launchpad as lightweight checkouts (to avoid hour long downloads).
4603+We don't repeat the ``buildout`` and ``versions`` sections::
4604+
4605+ [openerp]
4606+ recipe = anybox.recipe.openerp[bzr]:server
4607+ version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 bzr-init=lightweight-checkout
4608+ addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 bzr-init=lightweight-checkout
4609+ bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons bzr-init=lightweight-checkout
4610+
4611+Now imagine how easily one can switch branches and redistribute a
4612+ready-to-run buildout on some dedicated support branch, Git mirrors, etc.
4613+
4614+The next example is on 6.1 and demonstrates both how to add specific addons
4615+directories, and how uniform it is.
4616+
4617+.. _example 6.1:
4618+
4619+Example OpenERP 6.1 buildout with a custom addon
4620+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4621+
4622+Here is a very simple example for a latest OpenERP 6.1 nightly and a
4623+custom addon hosted on Bitbucket::
4624+
4625+ [buildout]
4626+ parts = openerp
4627+ versions = versions
4628+ find-links = http://download.gna.org/pychart/
4629+
4630+ [openerp]
4631+ recipe = anybox.recipe.openerp:server
4632+ version = nightly 6.1 latest
4633+ addons = hg https://bitbucket.org/anybox/anytracker addons-at default
4634+
4635+ [versions]
4636+ MarkupSafe = 0.15
4637+ Pillow = 1.7.7
4638+ PyXML = 0.8.4
4639+ babel = 0.9.6
4640+ feedparser = 5.1.1
4641+ gdata = 2.0.16
4642+ lxml = 2.3.3
4643+ mako = 0.6.2
4644+ psycopg2 = 2.4.4
4645+ pychart = 1.39
4646+ pydot = 1.0.28
4647+ pyparsing = 1.5.6
4648+ python-dateutil = 1.5
4649+ python-ldap = 2.4.9
4650+ python-openid = 2.2.5
4651+ pytz = 2012b
4652+ pywebdav = 0.9.4.1
4653+ pyyaml = 3.10
4654+ reportlab = 2.5
4655+ simplejson = 2.4.0
4656+ vatnumber = 1.0
4657+ vobject = 0.8.1c
4658+ werkzeug = 0.8.3
4659+ xlwt = 0.7.3
4660+ zc.buildout = 1.5.2
4661+ zc.recipe.egg = 1.3.2
4662+ zsi = 2.0-rc3
4663+
4664+
4665+.. note:: with OpenERP 6.1 the web client is natively included in the server as a
4666+ simple module. In that case you don't need to write a separate part for the web
4667+ client, unless that's what you really want to do.
4668+
4669+
4670+Example OpenERP 6.0 buildout (server and clients)
4671+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4672+
4673+Here is a sample buildout with version specification, 2 OpenERP servers (with
4674+one using the latest 6.0 branch on the launchpad) using only NETRPC and
4675+listening on 2 different ports, and 2 web clients::
4676+
4677+ [buildout]
4678+ parts = openerp1 web1 openerp2 web2
4679+ #allow-picked-versions = false
4680+ versions = versions
4681+ find-links = http://download.gna.org/pychart/
4682+
4683+ [openerp1]
4684+ recipe = anybox.recipe.openerp:server
4685+ version = 6.0.3
4686+ options.xmlrpc = False
4687+ options.xmlrpcs = False
4688+
4689+ [web1]
4690+ recipe = anybox.recipe.openerp:webclient
4691+ version = 6.0.3
4692+
4693+ [openerp2]
4694+ recipe = anybox.recipe.openerp[bzr]:server
4695+ version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1
4696+
4697+ options.xmlrpc = False
4698+ options.xmlrpcs = False
4699+ options.netrpc_port = 8170
4700+
4701+ [web2]
4702+ recipe = anybox.recipe.openerp:webclient
4703+ version = 6.0.3
4704+ global.openerp.server.port = '8170'
4705+ global.server.socket_port = 8180
4706+
4707+ [versions]
4708+ MarkupSafe = 0.15
4709+ Pillow = 1.7.7
4710+ anybox.recipe.openerp = 0.9
4711+ caldav = 0.1.10
4712+ collective.recipe.cmd = 0.5
4713+ coverage = 3.5
4714+ distribute = 0.6.25
4715+ feedparser = 5.0.1
4716+ lxml = 2.1.5
4717+ mako = 0.4.2
4718+ nose = 1.1.2
4719+ psycopg2 = 2.4.2
4720+ pychart = 1.39
4721+ pydot = 1.0.25
4722+ pyparsing = 1.5.6
4723+ python-dateutil = 1.5
4724+ pytz = 2012b
4725+ pywebdav = 0.9.4.1
4726+ pyyaml = 3.10
4727+ reportlab = 2.5
4728+ vobject = 0.8.1c
4729+ z3c.recipe.scripts = 1.0.1
4730+ zc.buildout = 1.5.2
4731+ zc.recipe.egg = 1.3.2
4732+ Babel = 0.9.6
4733+ FormEncode = 1.2.4
4734+ simplejson = 2.1.6
4735+
4736+Continuously tested examples
4737+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4738+
4739+Other examples are available in the ``buildbot`` subdirectory of the
4740+source distribution archive of this recipe (the ``tar.gz`` file that
4741+can be downloaded `from the PyPI
4742+<http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are
4743+continuously tested in the
4744+`anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by
4745+`anybox.buildbot.openerp
4746+<http://pypi.python.org/pypi/anybox.buildbot.openerp>`_.
4747+
4748+See also :ref:`continuous_integration` for more details about these
4749+tested examples.
4750+
4751+Other sample buildouts
4752+~~~~~~~~~~~~~~~~~~~~~~
4753+
4754+Here are a few ready-to-use buildouts:
4755+
4756+(Be sure to install system dependencies_ first)
4757+
4758+OpenERP with the development branches of the Magento connector addons::
4759+
4760+ $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout
4761+ $ cd openerp_connect_magento_buildout
4762+ $ python bootstrap.py
4763+ $ bin/buildout
4764+ $ bin/start_openerp
4765+
4766+OpenERP with the development branches of the Prestashop connector addons::
4767+
4768+ $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout
4769+ $ cd openerp_connect_prestashop_buildout
4770+ $ python bootstrap.py
4771+ $ bin/buildout
4772+ $ bin/start_openerp
4773+
4774
4775=== added file 'doc/index.rst'
4776--- doc/index.rst 1970-01-01 00:00:00 +0000
4777+++ doc/index.rst 2014-02-06 07:42:46 +0000
4778@@ -0,0 +1,79 @@
4779+.. OpenERP buildout recipe documentation master file, created by
4780+ sphinx-quickstart on Wed Jul 24 18:32:19 2013.
4781+ You can adapt this file completely to your liking, but it should at least
4782+ contain the root `toctree` directive.
4783+
4784+OpenERP buildout recipe
4785+=======================
4786+
4787+This recipe for `Buildout <https://github.com/buildout/buildout>`_ is
4788+a fully featured tool allowing you to define and deploy quickly
4789+OpenERP installations of any kinds, ranging from development setups to
4790+fully automated production deployments or continuous integration.
4791+
4792+Some of its main features include:
4793+
4794+* uniformity across OpenERP versions (from 5.0 onwards)
4795+* installation of OpenERP server and, if meaningful, GTK and web clients.
4796+* retrieval of main software and addons from various sources,
4797+ including the major version control systems
4798+* ability to pinpoint everything for replayability
4799+* management of OpenERP configuration
4800+* dedicated scripts creation for easy integration of external tools,
4801+ such as test launchers
4802+* packaging: creation of self-contained equivalents for easy
4803+ deployment in tightly controlled hosting environmenents.
4804+
4805+All these to be considered together with zc.buildout‘s general
4806+properties, such as an extensible configuration file format for easy
4807+variation or separation of concerns, native Python distributions
4808+installation, and of course the huge ecosystem of other recipes.
4809+
4810+About this documentation
4811+------------------------
4812+
4813+The full documentation is written with `Sphinx
4814+<http://sphinx-doc.org>`_, built continuously and
4815+uploaded to http://docs.anybox.fr/anybox.recipe.openerp/trunk by Anybox' public
4816+buildbot.
4817+The Sphinx source tree is to be found under the ``doc`` subdirectory
4818+of this project.
4819+
4820+Although this Sphinx documentation started with version 1.8.0, most of
4821+its contents applies to the 1.7 series: features introduced with 1.8
4822+are highlighted, and readers may consult the `changelog on PyPI
4823+<https://pypi.python.org/pypi/anybox.recipe.openerp#changes>`_.
4824+
4825+We plan to upload released versions of the documentation to
4826+http://pythonhosted.org
4827+
4828+Contents
4829+--------
4830+
4831+.. toctree::
4832+ :maxdepth: 2
4833+ :glob:
4834+
4835+ first_steps
4836+ configuration
4837+ scripts
4838+ dev_prod_workflow
4839+ contributing
4840+
4841+Code documentation
4842+------------------
4843+
4844+.. toctree::
4845+ :maxdepth: 1
4846+ :glob:
4847+
4848+ apidoc/anybox*
4849+
4850+
4851+Indices and tables
4852+------------------
4853+
4854+* :ref:`genindex`
4855+* :ref:`modindex`
4856+* :ref:`search`
4857+
4858
4859=== added file 'doc/scripts.rst'
4860--- doc/scripts.rst 1970-01-01 00:00:00 +0000
4861+++ doc/scripts.rst 2014-02-06 07:42:46 +0000
4862@@ -0,0 +1,471 @@
4863+OpenERP Scripts
4864+===============
4865+
4866+The server recipe actually includes a general engine to install Python
4867+code that needs access to the OpenERP API and build
4868+configuration-aware executables.
4869+
4870+As usual, it tries and do so by bridging the standard Python packaging
4871+practice (setuptools-style console scripts, as in
4872+``zc.recipe.egg:scripts``) and OpenERP specificities.
4873+
4874+We call such scripts *OpenERP scripts* to distinguish them among the
4875+more general concept of console scripts.
4876+
4877+.. warning:: OpenERP scripts are currently supported for OpenERP ≥ 6.1 only.
4878+
4879+
4880+Use cases
4881+~~~~~~~~~
4882+
4883+OpenERP scripts can do great in situations where an RPC script might
4884+not be powerful enough or not practical. Some examples:
4885+
4886+* specific batch jobs, especially for large databases (you get to
4887+ control the transaction).
4888+* introspection tools.
4889+* general-purposes test launchers that don't have any knowledge of
4890+ OpenERP specifics, such as ``nose``. See :ref:`command_line_options`
4891+ for details about that.
4892+
4893+OpenERP vs RPC scripts for administrative tasks
4894+-----------------------------------------------
4895+
4896+There are several Python distributions that wrap the OpenERP RPC APIs
4897+for easy use within Python code.
4898+
4899+Using an RPC script for administrative tasks usually leads to
4900+wrap it in a shell script, with the admin password in clear text.
4901+
4902+In this author's experience of applicative maintainance,
4903+this always turns to be an
4904+easy source of breakage that may look to be trivial at first sight but
4905+has actually two nasty properties : it may stay unnoticed for a while,
4906+and it lies at the interface between responsibilities.
4907+
4908+In case of password change, the persons who can do it
4909+in the database and in the system usually differ, and may not
4910+communicate on a regular basis. In enterprise hosting environments,
4911+you may have to explain stuff to several project managers with
4912+different responsabilities, go through crisis management meetings,
4913+etc. Who wants to waste hours of their life interacting with people
4914+under stress to try and persuade them that it's only a matter of
4915+changing an obscure password ?
4916+
4917+
4918+OpenERP scripts vs Openerp cron jobs
4919+------------------------------------
4920+
4921+Because they are part of addons, OpenERP cron jobs also have full
4922+unrestricted access to the internal API, and obviously don't suffer
4923+from the password plague.
4924+
4925+Some ideas to make a choice:
4926+
4927+* who should control, schedule and tune execution (a system administrator or
4928+ a functional admin)
4929+* which one the script author finds easiest to write for
4930+* reuse and distribution issues : OpenERP scripts are in Python
4931+ distributions, cron jobs are in addons.
4932+* OpenERP scripts must implement their own transaction control,
4933+ whereas cron jobs don't bother about it but rely on the framework's
4934+ decisions.
4935+
4936+Perhaps, the best is not to choose : put the bulk of the logic in some
4937+technical addon, it's easy to rewrap it in an OpenERP script and as a
4938+cron job.
4939+
4940+
4941+Declaring OpenERP Scripts
4942+~~~~~~~~~~~~~~~~~~~~~~~~~
4943+There are several cases, depending on the script authors
4944+intentions. Script authors should therefore state clearly in their
4945+documentation how to declare them.
4946+
4947+Assume to fix ideas there is a Python distribution ``my.script``
4948+that declares a console script entry point named ``my_script`` in its
4949+``setup.py``::
4950+
4951+ entry_points="""
4952+
4953+ [console_scripts]
4954+ my_script = my.script.main:run
4955+ """
4956+
4957+The first thing to do is to require that distribution using the
4958+``eggs`` option::
4959+
4960+ [my-openerp]
4961+ (...)
4962+ eggs = my.script
4963+
4964+:ref:`How that distribution can be made available to buildout
4965+<making_available>` is a different question.
4966+
4967+Bare declararations
4968+-------------------
4969+The following configuration::
4970+
4971+ [openerp-one]
4972+ (...)
4973+ openerp_scripts = my_script
4974+
4975+Produces an executable ``bin/my_script-openerp-one``, that can import
4976+OpenERP server and addons code, and in which the OpenERP configuration
4977+related to the appropriate buildout part (here, ``openerp-one``) is
4978+loaded in the standard ``openerp.tools.config``, for use in the
4979+script. The script has to take care of all database management operations.
4980+
4981+Optionally, it's possible to specify the name of the produced script::
4982+
4983+ [openerp-one]
4984+ (...)
4985+ openerp_scripts = my_script=wished_name
4986+
4987+That would build the script as ``bin/wished_name``.
4988+
4989+This is good
4990+enough for scripts that'd take care of many bootstrapping details, but
4991+there is a more integrated way that script authors should be aware of:
4992+the special ``session`` argument.
4993+
4994+.. _arguments_session:
4995+
4996+Arguments and session
4997+---------------------
4998+.. note:: new in version 1.7.0
4999+
5000+An ``arguments`` parameter, similar to the one of
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: