Commit Graph

116 Commits

Author SHA1 Message Date
Raphael Collet d9fedfebbd [IMP] registry loading: setup models only if necessary
When loading the registry without any module installation/upgrade, models are
set up once instead of twice.  In other cases, models are always set up before
installations/upgrades.
2014-12-19 13:57:08 +01:00
Raphael Collet 8f38a7806a [IMP] enable loading custom models/fields and views from module data files
Loading views for custom models from module data files was not possible because
custom models and fields were introduced into the registry after all modules
were loaded.  As a consequence, the view architecture did not pass the checks.

This patch takes a different approach: custom models and fields are loaded
early on in the registry, so that views can be validated.  The trick is to take
special care of relational custom fields: we skip them if their comodel does
not appear in the registry.  This allows to install and upgrade modules that
create/modify custom models, fields and views for them.
2014-12-19 13:57:08 +01:00
Raphael Collet 7afbb0a7ed [IMP] module/loading: do not try to load module graph when nothing to load
This simple optimization in load_marked_modules() avoids unnecessary calls to
load_module_graph().  This provides a small speedup, and avoids confusing log:
some module updates were making it look like the registry was loaded 5 times
instead of once.
2014-12-15 14:51:18 +01:00
Denis Ledoux 1c6c289f7b [FIX] api: clear environments on module installation 2014-10-02 17:46:25 +02:00
Olivier Dony e5bff82aff [MERGE] Forward-port saas-5 up to f9bcd67 2014-09-17 16:39:06 +02:00
Olivier Dony c926b54a49 [MERGE] Forward-port saas-3 up to 09ab2d4 2014-09-17 15:16:30 +02:00
Olivier Dony 09ab2d4109 [MERGE] Forward-port 7.0 up to 938502a 2014-09-17 15:13:42 +02:00
Olivier Dony 938502aa37 [FIX] loading: always process auto-installed modules for new databases
If the server was started without -i or -u and
happened to initialize a fresh database,
auto-installed modules that depend
on `base` only would stay in status "to install"
without actually being installed (until the next
installation round was triggered).
This was of little consequence in 7.0, but causes
a crash in 8.0.

Fixes #953
2014-09-17 15:11:01 +02:00
Raphael Collet 2d2274aeed [FIX] module loading: manual x2x fields can now refer to manual models
The fix consists in this: when setting up models, ignore manual fields that
refer to unknown models if all models have not been loaded yet.
2014-08-04 15:10:12 +02:00
Xavier Morel 92be431236 [REM] asynchronous database creation method
It's broken (though easy to fix) and not very useful, if third parties want to
create databases asynchronously they can handle the asynchronicity on the
client-side (an HTTP request is easy to make asynchronously after all) and
call the synchronous `create_database()`.

fixes #1137, after a fashion
2014-07-15 12:26:55 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Antony Lesuisse ed34640d3a [IMP] test display sql query counter 2014-07-01 21:57:55 +02:00
Antony Lesuisse 78e044b5c7 [IMP] test impprove HTTPCase opener
Simplify website crawler using the generic HTTPCase opener
2014-06-29 20:04:30 +02:00
Antony Lesuisse f9e24e1918 [IMP] module loading and tests profiling
Add a loglevel 25 to log some INFO to runbot
Add timers for loading and testing
Silence empty test suite
ir_logging use relative pathname, warning this doesnt work for --addons-path modules yet.
2014-06-29 18:58:15 +02:00
Christophe Simonis 1f57528bc6 [MERGE] forward port of branch saas-5 up to 8dfd5ea 2014-06-27 16:14:40 +02:00
Christophe Simonis a4bc65cdba [MERGE] forward port of branch saas-3 up to bdc4dd4 2014-06-27 16:06:37 +02:00
Christophe Simonis bdc4dd4a65 [MERGE] forward port of branch 7.0 up to 95cff0b 2014-06-27 16:00:28 +02:00
Yann Papouin 2c28adaade Overwrite translation on module update if option is set
Launchpad bug: https://bugs.launchpad.net/ocb-server/+bug/1319285
2014-06-20 11:48:18 +02:00
Christophe Simonis 4105b5f028 [ADD] module install/uninstall hooks.
Since 4ec71c74d1, migration scripts
are not executed at module install anymore.
As this behavior was missused as "init" scripts (see [1]), this
commit re-add this possiblity via hooks.

There are 3 hooks that can be declared in the manifest file:
 - pre_init_hook: called before module installation
 - post_init_hook: called after module installation
 - uninstall_hook: called before module uninstallation

Like the "post_load" manifest option, the values for these hooks
must be a string containing the name of a method available at the
module root.
The signatures of these functions are:
 - (cr) for pre_init_hook
 - (cr, registry) for post_init_hook and uninstall_hook

[1] https://bugs.launchpad.net/openobject-server/+bug/1314680
2014-06-07 00:41:29 +02:00
Christophe Simonis c3cf8000e6 [FIX] module loading: mark module as initialized *after* the data files have been loaded
When the registry is updating, the view verification only validates the views 
from initialized modules. Not taking the current module allow update of views
that have also an inherited view in the same module. The verification of the base view
must not try to apply the old inherited view against it as it may not be applicable
anymore. 

After module update, we re-validate all the views of this module. This is needed because
a module can declare two (or more) inherited views that are correct when applyed alone,
but not when combined with others.

bzr revid: chs@openerp.com-20140418141550-7b57b1xl4fx0rgqq
2014-04-18 16:15:50 +02:00
chm@openerp.com bbca8bd17e [PATCH] sle
bzr revid: chm@openerp.com-20140318122250-22bt2bcfzvxowkvf
2014-03-18 13:22:50 +01:00
Fabien Meghazi 3d2452e8d4 [FIX] Force routing map to be rebuilt between each module test suite
bzr revid: fme@openerp.com-20140317151810-tgsvv0ip4you1qko
2014-03-17 16:18:10 +01:00
Antony Lesuisse 278ed718e9 new test execution engine
remove deprecated zipfile support
add preload_registry option when server is running
allow registries to be used in contruction in test mode
add a rollback test case for http tests
add a phantomjs helper

bzr revid: al@openerp.com-20140209004005-p5pwym4sqc23vw5b
2014-02-09 01:40:05 +01:00
Olivier Dony 30513f498c [FIX] modules.loading: clear caches after test rollback, to avoid stale caches
bzr revid: odo@openerp.com-20140130153835-i5wb7nr0cwl3kjee
2014-01-30 16:38:35 +01:00
jke-openerp b7a001866d [IMP] Move threading.currentThread().testing from load_test to load_data. The purpose is to dont send mail when we are installing the demo data
bzr revid: jke@openerp.com-20131218123858-09hitdpxxqa5uh3j
2013-12-18 13:38:58 +01:00
Christophe Simonis 56bb1b9869 [MERGE] forward port of branch saas-2 up to revid 4992 chs@openerp.com-20131202105848-33gcz1715w370rve
bzr revid: chs@openerp.com-20131127110757-5kaay2kcxq0ysb59
bzr revid: chs@openerp.com-20131127161639-yur4rdh3wx43kxle
bzr revid: chs@openerp.com-20131127180647-f8uws77gaym5kfvd
bzr revid: chs@openerp.com-20131202110030-gf20dv2uj5fqv7c2
2013-12-02 12:00:30 +01:00
Christophe Simonis c901141cec [FIX] module loading: do not warn about missing access rules for AbstractModels
bzr revid: chs@openerp.com-20131127180530-aoslbam8almrmpbl
2013-11-27 19:05:30 +01:00
Christophe Simonis ab386c0f5f [MERGE] forward port of branch saas-2 up to revid 4984 chs@openerp.com-20131125151017-lmj53bxg1pfrr4a7
bzr revid: chs@openerp.com-20131125154140-cpbk4tcdml2a3b9n
2013-11-25 16:41:40 +01:00
Denis Ledoux 6fd552c3ce [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5139 rev-id: dle@openerp.com-20131121132305-qjlclgz5v9tze1fr
bzr revid: odo@openerp.com-20131120102545-2tlp031yib6viz35
bzr revid: chs@openerp.com-20131120161708-c8sbom592moukwxw
bzr revid: dle@openerp.com-20131121155457-lh7fzouk2upeiu16
2013-11-21 16:54:57 +01:00
Christophe Simonis 864af467e1 [FIX] module loading: do not warn about missing access rules for AbstractModels
bzr revid: chs@openerp.com-20131031193228-agj0qa9ceolpmvy6
2013-10-31 20:32:28 +01:00
Christophe Simonis 6a1079822e [IMP] module loading: run post- migration scripts before running the tests. This allow migration of demo databases
bzr revid: chs@openerp.com-20131016100540-i9nospifzzzsilt2
2013-10-16 12:05:40 +02:00
Christophe Simonis fd9a9577df [MERGE] forward port of branch saas-1 up to revid 4908 dle@openerp.com-20130918160049-fo88fl7uyhfoofkv
bzr revid: chs@openerp.com-20130918171816-cxxt3c9ktcq4a8oz
2013-09-18 19:18:16 +02:00
Christophe Simonis 7081038378 [IMP] validate custom views at the end of update of database
bzr revid: chs@openerp.com-20130912182926-3lectt8mvd9smwfb
2013-09-12 20:29:26 +02:00
Christophe Simonis e13ffe7e11 [MERGE] forward port of branch 7.0 up to revid 5075 chs@openerp.com-20130912141018-qmcyase8zqov9d01
bzr revid: chs@openerp.com-20130906165207-1oklc8cqs0rex3kg
bzr revid: dle@openerp.com-20130909170248-a4t5y6qd5ikkhhac
bzr revid: dle@openerp.com-20130911083736-6jfkb140jxbbx7j6
bzr revid: chs@openerp.com-20130912150616-v0c383trj7gaa7eu
2013-09-12 17:06:16 +02:00
Christophe Simonis 4327e09a55 [MERGE] forward port of branch saas-1 up to revid 4903 dle@openerp.com-20130909170248-a4t5y6qd5ikkhhac
bzr revid: chs@openerp.com-20130910121230-xcr2yj6rpbo83wy0
2013-09-10 14:12:30 +02:00
Antony Lesuisse dfb9d317f2 [MERGE] data file loading refactoring, ready for code autoreload
bzr revid: al@openerp.com-20130909105523-jkffhy5gr34k25hr
2013-09-09 12:55:23 +02:00
Samus CTO (OpenERP) 4dd565b647 [FIX] modules.loading: extra loop when installing/upgrading modules to help solve missing deps
In some rare cases the dependencies have changed, and modules that depend on an uninstalled module
will not be processed on the first pass.

bzr revid: odo@openerp.com-20130909095004-n1dp2w5wnlb36742
2013-09-09 11:50:04 +02:00
Olivier Dony 54ad990e48 [MERGE] Forward-port of 7.0 bugfixes up to rev.4970
revision-id: odo@openerp.com-20130507104025-em6w03pcxeq92az9

bzr revid: odo@openerp.com-20130507112024-p3cukmwp7d8xm2e0
2013-05-07 13:20:24 +02:00
Quentin (OpenERP) 0d21c3eba3 [IMP] modules loading: log as INFO test files because, if they are logged as TEST, the loading statement get lost in the mass of real TEST logs in case there are a lot of test files (more visible that way) + there are no reason to special case these files
bzr revid: qdp-launchpad@openerp.com-20130507092422-co9w0qug8k9zw16n
2013-05-07 11:24:22 +02:00
Raphael Collet 05851d21ba [MERGE] from trunk
bzr revid: rco@openerp.com-20130411073017-x6e4h8xbvmy3ofdw
2013-04-11 09:30:17 +02:00
Vo Minh Thu 307ca374d6 [MERGE] forward merge 7.0 until revision 4919.
bzr revid: vmt@openerp.com-20130404130704-24vsmczw34cssytd
2013-04-04 15:07:04 +02:00
Vo Minh Thu 27ab383508 [FIX] loading: typo.
lp bug: https://launchpad.net/bugs/1162753 fixed

bzr revid: vmt@openerp.com-20130402092914-cqrjxveg66gbpm3s
2013-04-02 11:29:14 +02:00
Raphael Collet 09be864f1d [IMP] replace all tests like 'registry.get(X)' by 'X in registry' where X is non static
bzr revid: rco@openerp.com-20130329140723-dnrl02saky570xg0
2013-03-29 15:07:23 +01:00
Vo Minh Thu 4ed7ec95b7 [MERGE] removed LocalService("workflow"), Logger class, and TEST log level.
bzr revid: vmt@openerp.com-20130327170639-uamgg7shlmtxgpxv
2013-03-27 18:06:39 +01:00
Vo Minh Thu 7b8f4fe5ee [REF] tests: use the openerp.tests namespace for test-related logging.
bzr revid: vmt@openerp.com-20130327153843-u62ftp74qv01u1ww
2013-03-27 16:38:43 +01:00
Vo Minh Thu 684bd35442 [REF] registry: begin to remove openerp.pooler:
- call openerp.modules.registry.RegistryManager instead
- expose openerp.get_pool()

bzr revid: vmt@openerp.com-20130327093125-iqsyvvjm0ej7do14
2013-03-27 10:31:25 +01:00
Vo Minh Thu c313b4073a [REF] logging: removed pseudo log-level TEST.
When --test-enable is used, it is expected that test output is visible,
thus using log-level INFO is natural.

On the down side you lose the nice blue hint that tests did actually
run when --log-level test was given.

bzr revid: vmt@openerp.com-20130326155844-83e2tcqokvblr0ln
2013-03-26 16:58:44 +01:00
Vo Minh Thu 69fefde965 [IMP] The open openerp namespace is removed.
bzr revid: vmt@openerp.com-20130209060246-o7qs51c2uc0kecjo
2013-02-09 07:02:46 +01:00
Christophe Simonis 4857a8a020 [FIX] module loading: call adapt_version() instead of computing it ourself
bzr revid: chs@openerp.com-20130117135108-a4wt4wtbtfdwiui3
2013-01-17 14:51:08 +01:00
Olivier Dony 9770caedf3 [FIX] registry: another pass of cleanup for registry signaling
Some important points to consider:
 - signaling should be done after any schema alteration (including module [un]installation),
   service registration (e.g. reports)
 - the changes need to be committed to the database *before* signaling, otherwise an
   obvious race condition occurs during reload by other workers
 - any call to restart_pool() must be considered a possible candidate for
   signaling, and the 2 above conditions must be checked

The number of explicit calls was reduced by forcing the signaling at the end of
Registry.new() in case `update_module` was passed as True. In that situation
we always want to signal the changes - so all the redundant signaling calls
can be centralized. We can also assume that the relevant changes have already
been committed at that point, otherwise the registry update would not
have worked in the first place.
This means that there is no need for explicit signaling anymore everytime
`restart_pool` is called with `update_module=True`.

Some missing cr.commit() and explicit signaling calls were added or
moved to the right place. As a reminder: signaling must be done
*after* committing the changes, and usually *after* reloading the
registry on the current worker.

bzr revid: odo@openerp.com-20130301143203-e2csf5pkllwhmwqs
2013-03-01 15:32:03 +01:00