Commit Graph
105 Commits
Author SHA1 Message Date
Christophe Simonis ba202dbe63 [MERGE] forward port branch saas-11.2 up to 3c521f6d05 2018-07-24 18:10:32 +02:00
Christophe Simonis 4e76173a43 [MERGE] forward port branch 11.0 up to 219d2296d6 2018-07-23 16:03:25 +02:00
Christophe Simonis 219d2296d6 [MERGE] forward port branch saas-15 up to c4ee29345a 2018-07-23 15:45:08 +02:00
Christophe Simonis c4ee29345a [MERGE] forward port branch saas-14 up to 9ee882564f 2018-07-23 14:57:03 +02:00
Christophe Simonis 6e71cf8a71 [MERGE] forward port branch 9.0 up to af2e480e41 2018-07-23 13:41:04 +02:00
Xavier Morel 9f8eae34d1 [FIX] undefined variables (potential nameerror)
Backport 9ec0455abc and
6a601fe6dc as they fixed various
possible NameError but did so in later sub-releases.
2018-07-19 13:37:10 +02:00
Christophe Simonis 2214bffefb [MERGE] forward port branch saas-11.2 up to 45329c0cf2 2018-07-05 18:53:17 +02:00
Christophe Simonis 45329c0cf2 [MERGE] forward port branch 11.0 up to 84210074e5 2018-07-05 17:21:01 +02:00
Christophe Simonis 84210074e5 [MERGE] forward port branch saas-15 up to b06c09db60 2018-07-05 16:23:47 +02:00
Christophe Simonis b06c09db60 [MERGE] forward port branch saas-14 up to 92e5da6b8f 2018-07-05 15:35:24 +02:00
Christophe Simonis 26e7d5d8ee [MERGE] forward port branch 9.0 up to b5c50fa824 2018-07-05 14:19:33 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 803df909b1 [MERGE] forward port branch saas-14 up to 804d68efe5 2018-06-14 18:05:38 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
Christophe Simonis 969eb3fa2f [MERGE] forward port branch saas-11.2 up to c834c0f587 2018-06-06 15:46:36 +02:00
Christophe Simonis aba8c2b8fb [MERGE] forward port branch 11.0 up to 1b272a2050 2018-06-05 16:27:49 +02:00
Christophe Simonis c301122b5f [MERGE] forward port branch saas-14 up to a002210d93 2018-06-05 12:00:11 +02:00
Adrian Torres c25b68f324 [FIX] orm: re-create constraints of extended fields
Before this commit:

* Module A defines a field X of model M
* Module B inherits from model M without touching field X
* Module C inherits from model M and extends field X by giving an INDEX
/ NOT NULL constraint.
* Module B and C depend from Module A, but not each other

If all three modules are installed and Module B is updated, the INDEX /
NOT NULL constraint could be dropped.

This happens because Module B can be loaded before Module C is loaded,
if that's the case, then after the upgrade of Module B, during the
schema checking, we verify that the field object we have and the field
on the DB are the same, since Module B doesn't introduce the index then
this check is false and we drop the index. When we get to loading Module
C, we do not do any schema checking because the module is not marked as
`to upgrade`, therefore the index is lost forever.

To solve this, we re-init the models that belong to the set of the intersection
between upgraded and modified models and loaded and modified models.

Fixes #24958
2018-06-05 11:07:33 +02:00
Adrian Torres a5ccc1b6b5 [FIX] orm: re-create constraints of extended fields
Before this commit:

* Module A defines a field X of model M
* Module B inherits from model M without touching field X
* Module C inherits from model M and extends field X by giving an INDEX
/ NOT NULL constraint.
* Module B and C depend from Module A, but not each other

If all three modules are installed and Module B is updated, the INDEX /
NOT NULL constraint could be dropped.

This happens because Module B can be loaded before Module C is loaded,
if that's the case, then after the upgrade of Module B, during the
schema checking, we verify that the field object we have and the field
on the DB are the same, since Module B doesn't introduce the index then
this check is false and we drop the index. When we get to loading Module
C, we do not do any schema checking because the module is not marked as
`to upgrade`, therefore the index is lost forever.

To solve this, we re-init the models that belong to the set of the intersection
between upgraded and modified models and loaded and modified models.

Fixes #24958
2018-06-01 10:55:35 +02:00
Christophe Simonis 2bc6ea1b37 [MERGE] forward port branch 11.0 up to 02ee3fd88e 2018-05-23 19:33:40 +02:00
Christophe Simonis 021d0e6a98 [MERGE] forward port branch saas-14 up to cabe0951af 2018-05-18 18:54:26 +02:00
Fabien Meghazi 3862c03ec2 [FIX] base: honor registry/cache signaling for multiple threaded servers
Before this patch the registry and cache signaling was only activated
for PreforkServer. In case Odoo was deployed in a multi process/multi
threaded architecture the signaling was not ensured, causing registry
de-synchronisation amongst threaded servers.

Backported from fd4939dc78
2018-05-18 14:33:22 +02:00
Fabien Meghazi c60b22335b [FIX] base: honor registry/cache signaling for multiple threaded servers
Before this patch the registry and cache signaling was only activated
for PreforkServer. In case Odoo was deployed in a multi process/multi
threaded architecture the signaling was not ensured, causing registry
de-synchronisation amongst threaded servers.
2018-05-18 14:20:35 +02:00
Fabien Meghazi fd4939dc78 [FIX] base: honor registry/cache signaling for multiple threaded servers
Before this patch the registry and cache signaling was only activated
for PreforkServer. In case Odoo was deployed in a multi process/multi
threaded architecture the signaling was not ensured, causing registry
de-synchronisation amongst threaded servers.

This fix will be backported in v10.0 and v11.0 as soon as it has been
battle tested.
2018-04-05 14:22:32 +02:00
Christophe Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Adrian Torres 84b6c46943 [FIX] registry, loading: re-init inherited SQL views
Before this commit:

* Install any module that creates a SQL view and another that extends
this view.
    e.g.: sale and pos_sale for `report.all.channels.sales`.

* Uninstall the module that extended the SQL view.
    e.g.: uninstall pos_sale.

* Try to access the view from the web client -> Traceback, table not
found.

This happens because when reloading the registry, postgres drops the sql
view and it must be re-initialized.

After this commit:

We solve this issue by calculating all missing tables/views during the
uninstallation process, and re-initializing all of them right before
reloading the registry.

Also remove sql-view hacks in the modules `sale` and `sale_margin`.

Fixes #23528, #23529, #23530
2018-03-13 09:41:43 +01:00
Raphael Collet 80f1ac3599 [REF] never defer parent_store computation
Simplify the implementation of parent_left/parent_right by removing this
optimization.
2018-02-28 10:33:44 +01:00
Christophe Simonis 806f42b065 [MERGE] forward port branch saas-11.2 up to 8b9e854be4 2018-02-15 13:46:23 +01:00
Christophe Simonis 3b959c313d [MERGE] forward port branch saas-11.1 up to a277b58507 2018-02-15 11:52:10 +01:00
Christophe Simonis a277b58507 [MERGE] forward port branch 11.0 up to 259686ba78 2018-02-15 10:58:08 +01:00
Christophe Simonis 72508cc241 [MERGE] forward port branch saas-16 up to 7792755946 2018-02-14 18:26:57 +01:00
Christophe Simonis 7792755946 [MERGE] forward port branch saas-15 up to d24bdbde81 2018-02-14 17:18:59 +01:00
Christophe Simonis d24bdbde81 [MERGE] forward port branch saas-14 up to 9d0de61114 2018-02-14 16:34:13 +01:00
Christophe Simonis 73c2ac451a [MERGE] forward port branch 9.0 up to b7b82f1267 2018-02-14 15:32:37 +01:00
Raphael Collet 7ea4f13f16 [REF] tests: TestCursor is now a proxy to a real Cursor
This allows rpc requests in `HttpCase` to use the cursor `self.cr`, which is
now shared between the Python test and the rpc requests.  This simplifies code
to prepare a JS test, and code to check the result of a JS tour.

Fixes #12237
2018-02-12 10:31:59 +01:00
Christophe Monniez ad7bf6b9c9 [REM] config, loading: remove test-commit and test-report-directory
As there are few use cases for the --test-commit and --test-report-directory
options, they are removed.
2018-01-18 13:27:33 +01:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
Purpose: When running tests, all the tests for the installed/updated
files are done. This commit adds a 'tagged' decorator that can be used to
tag tests. Combined with a new 'test-tags' CLI option, it adds the ability
to filter which tests are executed. For example, @tagged('slow') will
add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will
only run tests tagged 'slow'.

One can use prefixes to select cases with tags.
'+' or no prefix means that the tests tagged with this tag are selected
for execution. '-' prefix will exclude the tests tagged with this tag.
Exclusion takes precedence over inclusion.

Also, by default, all Odoo tests cases are tagged 'standard' and with
the technical name of the module.
This means that when selecting tests with the 'test-tags'
parameter, if '-standard' is not specified, all tests tags are
going to be executed.
When tagging tests, one can remove such automatic tag by prefixing the
tag name with '-'. E.g. @tagged('-standard') will remove the standard
tag from the test.

Another example, if one wants to test the 'sale' module alone,
even without adding any 'tagged' decorator thos tests can be selected
like that: --test-tags="sale"

Tests are selected or deselected using a TagsSelector. When instanciated,
 a string is passed with comma separated tests selectors like
'+slow,-standard'. When the 'check' method is called  with a test as argument,
it returns True or False if the test has to be executed or not.
2018-01-18 13:20:37 +01:00
Raphael Collet 2ed137af3e [REF] models: refactor code to update parent_left/parent_right
Put the code to update the MPTT in specific methods, and reduce the number of
queries being made (from 5-6 queries to 2-3 queries).  Add test on MPTT to
validate the refactoring.
2018-01-16 10:47:13 +01:00
Christophe Simonis 8ef7af6afe [MERGE] forward port branch 11.0 up to f96a797fe6 2017-12-06 12:02:58 +01:00
Christophe Simonis f96a797fe6 [MERGE] forward port branch saas-16 up to b8540eefe3 2017-12-06 11:59:38 +01:00
Christophe Simonis a8d01cbf4e [MERGE] forward port branch saas-15 up to a447da75fd 2017-12-04 20:12:19 +01:00
Christophe Simonis a447da75fd [MERGE] forward port branch saas-14 up to e7d174a142 2017-12-04 19:25:51 +01:00
Adrian Torres 3d1e23aaba [FIX] *: Reset module states on registry init error
Commit 763d714 introduced cron job locking for databases which had
modules with states set to 'to x', however if an
installation/uninstallation/upgrade fails, the state will stay at 'to
x', and it may stay in that state for an indefinite amount of time,
meaning that cron jobs could stay locked forever.

This commit fixes this in part by adding a cleanup function to loading.py that
will be executed whenever load_modules fails, the function will change
every 'to x' module to their original state, effectively unlocking the
execution of cron jobs.

This however only works to prevent "zombie" transient states for
brand new databases, however for existing databases which already
contain some modules in a zombie state it won't do anything unless
a module is installed/uninstalled/upgraded, which may never happen.

This is where the second part comes in (ir_cron.py), when failing to
execute crons, we check if the failure was due to bad module state
and if an arbitrary amount of time (5 hours as of this commit) has passed
since the last time it was supposed to be executed, if it is the case, it means
that the cron execution failed around 5 * 60 times (1 failure per minute for 5h)
in which case we assume that the crons are stuck because the db
has zombie states and we force a call to reset_module_states.
2017-12-01 14:15:42 +00:00
Thibault Delavallée ca1a207aa3 [MOV] base: move base.sql to data/base_data.sql 2017-11-27 11:13:39 +01:00
Yannick Tivisse 77eb1f82d9 [REM] tools: Remove the yml import engine 2017-11-16 14:49:06 +01:00
Adrian Torres e0b6eb3e62 [FIX] loading: Don't add None to installed apps (#19850)
Previous to this rev., sometimes None could be added
to the list of _init_modules in the registry, this would
then be problematic in ir_http since a sorted would be
performed on this list, which works in py2 but in py3
None and string can't be compared implicitly.
2017-10-09 09:35:59 +02:00
Richard Mathot e2349f4546 [FIX] odoo: bad imports in tests don't fail silently anymore
Before this fix, you can break a test class by simply adding an
incorrect import like this:
`from gloubiboulga import Casimir`
--> No error message, the test is simply not run

This is due to the fact that we want to ignore ImportError's... only
when there is no `.tests` submodules (actually, we ignored them all!)

This commit fixes the condition and re-enables error logging when tests
actually encounter ImportErrors
2017-10-03 14:29:01 +02:00