Commit Graph

325 Commits

Author SHA1 Message Date
Olivier Dony 8874fb058f [FIX] module.loading: ensure installed modules are all loaded before installing new ones
After the recent change to make module install
atomically (code *and* data), we ran into issues
when installing a new module indirectly triggers
code of a not-yet-loaded-but-installed module,
via its data that is already in the database
(e.g. worflows or reports modified by this module
within another module, that now refer to its
code).
To avoid this, we now make sure that we only
install new modules on top of a consistent system
(code *and* data), by loading all installed or
'to upgrade' modules *before* starting to install
new ones.

lp bug: https://launchpad.net/bugs/809168 fixed

bzr revid: odo@openerp.com-20110712133343-unf610k23fa6d3pk
2011-07-12 15:33:43 +02:00
Vo Minh Thu 0568b08bea [FIX] loading: pool.get("ir.module.module") was done before it was available.
bzr revid: vmt@openerp.com-20110711141045-c3pyqe0zuwxlljip
2011-07-11 16:10:45 +02:00
Olivier Dony cc7fae257f [IMP] module.loading: attempt to load each module atomically within load_module_graph (untested, work-in-progress)
bzr revid: odo@openerp.com-20110711124958-p91752exwv21sdf8
2011-07-11 14:49:58 +02:00
Vo Minh Thu abb606aa7c [MERGE] orm: _auto_init made of smaller methods, use a metaclass to discover new models.
bzr revid: vmt@openerp.com-20110615160123-7bk8u94y916mdpkj
2011-06-15 18:01:23 +02:00
Vo Minh Thu 26f22874d9 [LINT] removed unused variable, forgot to change two variables in last commit, corrected typo introduced at 3417.6.6.
bzr revid: vmt@openerp.com-20110615072231-jh977xk1jupekkpp
2011-06-15 09:22:31 +02:00
Vo Minh Thu e375049414 [REF] osv: moved osv_pool to modules/registry.
bzr revid: vmt@openerp.com-20110614142226-yd3y39a8z3ubwvxm
2011-06-14 16:22:26 +02:00
Vo Minh Thu 1b45a892dd [REF] orm: defer foreign key creation.
bzr revid: vmt@openerp.com-20110610140521-mdd6zvvzeoubier4
2011-06-10 16:05:21 +02:00
Vo Minh Thu a87ebe9600 [REF] osv:
- make it more explcicit in osv_pool that afreshly instanciated object is added to the pool
- osv_pool.init_set() is called just once with False, so
  no need to check if it is the first time it is called or
  if is called with True
- and rename it in do_parent_store as it is what it does.

bzr revid: vmt@openerp.com-20110526210532-a8i91shptz5h4k48
2011-05-26 23:05:32 +02:00
Vo Minh Thu 16ac84af68 [REF] moved openerp/registry/manager.py => openerp/modules/registry.py
- Maybe it should be called registries.py... Argh, consistency...

bzr revid: vmt@openerp.com-20110519073935-81kwuhlqcxxw1z32
2011-05-19 09:39:35 +02:00
Vo Minh Thu a09b91d8fd [REF] simplified init_db/load_modules:
- removed unnecessary call to openerp.modules.db.initialize() in openerp/service/web_services.py
  as the pooler.restart_pool() call just next after is already doing it.
- made the try/finally section bigger in openerp/modules/loading.py, to inlcude
  the first cr.execute.
- abstracted the test to check if a database is initialized.
- removed unnecessary "if cr:" as the cr is nevertheless used after that.

bzr revid: vmt@openerp.com-20110517091822-pjtw6sc1s5assbr5
2011-05-17 11:18:22 +02:00
Vo Minh Thu 40bce2fead [REF] renamed modules.__init__ to modules.loading.
bzr revid: vmt@openerp.com-20110511174841-wk1yyr9971pu0pwh
2011-05-11 19:48:41 +02:00
Vo Minh Thu 1fe579d8ec [REF] module code goes into openerp.modules.module.
bzr revid: vmt@openerp.com-20110511172448-p12p1rizvf3lqv97
2011-05-11 19:24:48 +02:00
Vo Minh Thu fb476648e0 [REF] openerp.modules: migration manager code moved to openerp.modules.migration.
bzr revid: vmt@openerp.com-20110511164144-8o1bl6jfb8k7keak
2011-05-11 18:41:44 +02:00
Vo Minh Thu 52d1291506 [REF] moved graph code from modules.__init__ to modules.graph
- made upgrade_graph a method of Graph called add_modules
- removed unnecessary create_graph function.

bzr revid: vmt@openerp.com-20110511152810-etqru9pct1zwyqno
2011-05-11 17:28:10 +02:00
Vo Minh Thu 5ca0f64b4e [REF] moved init_db from tools.misc to modules.db.
bzr revid: vmt@openerp.com-20110511144754-m06exg4dsn2jbdgz
2011-05-11 16:47:54 +02:00
Vo Minh Thu b158805af7 [REF] module info (descriptor) dictionary default values in one place.
bzr revid: vmt@openerp.com-20110511135332-87kd5vo4rdeb6b3l
2011-05-11 15:53:32 +02:00
Vo Minh Thu 8b878de82d [REF] modules.__init__:
- added some comments
- the "updating modules list" log appears only when actually updating the list
- similar code to read the module descriptor file is combined
- default values for some descriptor entries are given only once
- in particular, the default version is always 0, instead of 0 when
  reading a descriptor for migration and 1.0 when writing its value in
  database.

bzr revid: vmt@openerp.com-20110511103455-lqezcrjf2996j7mc
2011-05-11 12:34:55 +02:00
Vo Minh Thu 71de92dc44 [FIX] db.get_progress was broken:
- the status dictionary was ignored
- it is still slightly broken (see added comment in openerp/modules/__init__.py)

bzr revid: vmt@openerp.com-20110510142849-p9kcd60agybpm8bd
2011-05-10 16:28:49 +02:00
Vo Minh Thu 853e354b55 [REF] modules.__init__: combined _load_data and _load_xml:
- pass the report argument to xml_import
- allow .sql in demo
- noupdate is True for both init and demo
- the pathname given to convert_csv_import is different
  but the way it is processed in convert_csv_import should
  make it alright.

bzr revid: vmt@openerp.com-20110510125242-ig74vtich2g3bjhc
2011-05-10 14:52:42 +02:00
Vo Minh Thu e82aeba808 [REF] it seems ok to get the ir.module.module model only once.
bzr revid: vmt@openerp.com-20110519090410-a89n7ivs2nvn60bt
2011-05-19 11:04:10 +02:00
Vo Minh Thu 7963da3f94 [REF] modules.__init__:
- combined code from load_init_update_xml and load_demo_xml
- made explicit the "report" kwarg of load_module_graph

bzr revid: vmt@openerp.com-20110510094908-txzj3oeypz7iralk
2011-05-10 11:49:08 +02:00
Vo Minh Thu 4ba3f3c804 [REF] osv, modules/__init__cosmetic renaming, added comments.
bzr revid: vmt@openerp.com-20110519090300-bodss011798ep5cy
2011-05-19 11:03:00 +02:00
Vo Minh Thu 0770057935 [REF] explicit service objects instanciation.
bzr revid: vmt@openerp.com-20110507112129-hfrly9easfby9hns
2011-05-07 13:21:29 +02:00
Vo Minh Thu 081b6d98ab [REF] separate/expose some code.
bzr revid: vmt@openerp.com-20110428151330-m8qkggoqmsry3w2z
2011-04-28 17:13:30 +02:00
Vo Minh Thu 545a438c03 [REF] openerp.modules
- for the moment it is a copy of openerp.addons

bzr revid: vmt@openerp.com-20110420152718-eok61oule6p2x58z
2011-04-20 17:27:18 +02:00