Commit Graph
10 Commits
Author SHA1 Message Date
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Raphael Collet b59318ec12 [REF] registry: always perform registry/cache signaling at the end of request
Problem: the update of custom models/fields is not fully transactional, and may
potentially lead to an inconsistent database.  An other problem is creating two
custom fields by writing on a model: if the second one fails, the first one has
been committed without notice.  Retrying the request will give an unexpected
error (duplicate field name).

Solution: never commit in the middle of a request.  If the changes have an
impact on the registry, then mark it as invalid (with a new flag), and signal
registry invalidation after everything has been committed.  If the request
fails, reset the registry.  Both registry and cache invalidation are handled
the same way.
2017-05-03 15:41:05 +02:00
Raphael Collet 1458f1b313 [REF] registry: delegate addition of custom models/fields
Delegate to models `ir.model` and `ir.model.fields`, so that this functionality
can be extended easily.
2017-05-03 15:41:05 +02:00
Raphael Collet f3f41ec551 [REF] registry: replace partial by attribute registry.loaded 2017-05-03 15:41:05 +02: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
Christophe Simonis 98c71b23d3 [MERGE] forward port branch saas-11 up to 9073ecb6f5 2017-01-06 18:06:14 +01:00
Christophe Simonis 799e7f7740 [FIX] core: leftover openerp use from last forward-port 2017-01-04 19:24:16 +01:00
Christophe Simonis 2217b37130 [MERGE] forward port branch saas-11 up to 573293a06d 2017-01-04 19:15:31 +01: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