Christophe Simonis
2df5faa551
[MERGE] forward port branch saas-14 up to 2f68e9e93a
2017-03-28 18:05:31 +02:00
Raphael Collet
c9edb9dccb
[FIX] registry: use a weak dictionary for model_cache to avoid memory leaks
...
The class attribute `model_cache` refers to model classes, which refer to their
own registry. This cache potentially keeps all past registries alive!
2017-03-21 15:50:20 +01:00
Raphael Collet
d024c76021
[REF] tools: add functions for SQL schema manipulation
...
This helps factoring out a certain number of similar queries, and removing a
few methods from `BaseModel`.
2017-02-22 15:24:07 +01:00
Raphael Collet
8225f36497
[IMP] models: speed up schema update for models
...
Simply remove most `commit()` statements from code that updates the database
schema. This improves the performance of the schema update by 30%.
2017-02-22 15:24:06 +01:00
Raphael Collet
daa1eb1fc4
[IMP] base: remove ir_model_* tables from base.sql
2017-02-22 15:24:05 +01:00
Raphael Collet
b6103d0b1b
[REF] models: foreign keys use Registry.post_init() instead of BaseModel._auto_end()
...
Also use Registry.post_init() for the creation of foreign keys in
`_sql_constraints`.
2017-02-22 15:22:26 +01:00
Raphael Collet
a1d061080e
[REF] models: improve the API for post-init functions
...
Add a method to the registry to register function calls that must be done after
methods `_auto_init` and `init` have been invoked on all models.
2017-02-22 15:22:26 +01:00
mge-odoo
ff2f188d20
[IMP] tests: allow post-install tests to play real transactions
...
Move the post-install tests execution outside `Registry.new`, and add a flag on
class `HttpCase` to enable/disable the registry "test mode".
This allows a test to run actual transactions that will reload the registry,
which may be used to test the creation of `ir.model` instances, etc.
2017-02-08 16:13:01 +01:00
Raphael Collet
f825f415f8
[FIX] registry: ensure that all non-abstract models have a table ( #14194 )
...
After modifying the database schema, if some models do not have a table/view,
attempt to recreate it by calling their method `init()`, following inter-model
dependencies.
Fix the model `board.board` by making it an abstract model.
Add the missing model dependencies on report `crm.partner.report.assign` to make
it depend on report `account.invoice.report`.
2016-11-10 13:50:04 +01:00
Raphael Collet
979c553918
[IMP] base: refactor _instanciate on ir.model to make it extendable
2016-09-28 16:55:51 +02:00
Christophe Simonis
09c2e4a5bc
[FIX] core: fix registry initialisation
...
Registry.init_models now expect a list of model names instead of the
models themself.
2016-09-22 16:15:26 +02:00
Christophe Simonis
856476d441
[MERGE] forward port branch saas-12 up to b1b700a
2016-09-22 15:23:45 +02:00
Raphael Collet
4a700d0ad9
[FIX] odoo: rename imports and adapt import hooks
2016-09-02 17:28:12 +02:00
Raphael Collet
9e64f9f951
[REF] openerp: move openerp to odoo
2016-09-02 17:28:12 +02:00