Commit Graph
5490 Commits
Author SHA1 Message Date
Cédric Krier 4852175b27 Close the SQLite connection to memory database when the database has been dropped
Instead of relying on the garbage collector to close the connection by deleting
the object, this ensures that the memory database is actually dropped before a
new connection is instantiated and keep the database.

Closes #13796
2025-01-16 09:47:25 +01:00
Cédric Krier 8da34d06d6 Create target SQLite database before copying when restoring SQLite database
Closes #13795
2025-01-05 16:15:17 +01:00
Cédric Krier ec6f30318b Remove shared memory and write-ahead log files when dropping SQLite database
Since 6837a618f53d SQLite may create such temporary files.

Closes #13794
2025-01-05 16:12:14 +01:00
Cédric Krier d4493f0a53 Ignore operational error when optimize SQLite database on connection
The 'PRAGMA optimize' command can not run on a locked database which may happen
when a nested transaction is started.

Closes #13793
2025-01-05 16:07:54 +01:00
Cédric Krier b5148a248c Allow running field binary tests with a non memory SQLite database
By setting the filestore path as a global variable, we can modify it for the
test without changing the database path where the SQLite databases are stored.

Closes #13792
2025-01-05 16:02:39 +01:00
Cédric Krier 6fb00e2bed Test context on target instance of One2One 2025-01-14 01:19:50 +01:00
Cédric Krier 5f3e83f66f Instantiate One2One target when the context of the field
Closes #13819
2025-01-14 01:19:00 +01:00
Cédric Krier 7aeee5f06e Test setting value to xxx2One fields 2025-01-14 01:08:05 +01:00
Cédric Krier f908ccc85a Expand dictionary value set to a One2One field
Closes #13818
2025-01-14 01:07:33 +01:00
Cédric Krier 590102e87e Remove python type inherited from Many2Many of One2One
The python type is used to test the type of value set but for One2One it is an
instance which can not be tested with a simple Python type.

Closes #13817
2025-01-14 01:04:46 +01:00
Cédric Krier f42f4eba6e Add super call to setUpClass in custom test case
This is needed to catch the Python warnings.
2025-01-03 23:51:00 +01:00
Cédric Krier 4ff7ca6d6e Use None as default value for module of view
Since 53fc70c2139f the module column of ir_ui_view has a foreign key constraint
on ir_module table so the default value must be NULL to ignore the constraint
when there is no module.

Closes #13816
2025-01-13 19:28:18 +01:00
Cédric Krier 77bb47a3a4 Make field_names optional in Model.default_get 2024-12-26 16:08:18 +01:00
Cédric Krier e656cccb7f Replace loading attribute by visible for loading xxx2Many fields with dotted notation
Override the loading attribute breaks the dependencies between fields.
Such xxx2Many becoming eager loading may miss some lazy loading fields which
may break the behavior like the domain inversion (which may set the wrong
value).

Closes #13452
2024-12-28 18:24:51 +01:00
Cédric Krier d1ce25bd4f Limit the worker retry delay to maximum 1 hour
Closes #13779
2024-12-26 12:47:08 +01:00
Cédric Krier 5ca8a1edf2 Restore raising KeyError when file system ID is not found
75936f10ee95 removed this behavior but some modules relies on it.
2025-01-01 20:51:44 +01:00
Cédric Krier c928c61f0e Do not initialize ir_ui_view table with model NOT NULL
Closes #13788
2025-01-01 19:15:38 +01:00
Cédric Krier 81669a33c9 Use proper BOOLEAN type in init SQL of SQLite 2025-01-01 17:39:20 +01:00
Cédric Krier 7f56ab27a7 Remove unused docstring
Since 23ce421d3bb9 the docstring's are no more used as string for the model.
2025-01-01 18:20:47 +01:00
Cédric Krier debaff1cd8 Create translation entry for model without docstring
Since 23ce421d3bb9 it is the __doc__ attribute that is used as string for the
module.
2025-01-01 18:10:12 +01:00
Cédric Krier f20c36e2a6 Test actually the translation when writing on model and field 2025-01-01 16:25:37 +01:00
Cédric Krier 2c97c87ce2 Create translation of model and field using the proper name 2025-01-01 16:24:55 +01:00
Cédric Krier 1f66be2076 Register model string translation as string field of ir.model 2025-01-01 16:22:25 +01:00
Cédric Krier ab19901d85 Fallback to plural message when index is greater than 0 2025-01-01 16:20:28 +01:00
Cédric Krier 592240fdb3 Always export the first plurals string and only consecutive plurals
To have a valid pofile we need to have all the plural form from index 0.
2025-01-01 11:50:13 +01:00
Cédric Krier fb714566f2 Add generic test for the default value of ModelStorage.copy 2024-12-03 19:06:33 +01:00
Cédric Krier 8ab7c421f2 Test that on_change_with getter use the name of the Function field 2024-12-16 18:18:48 +01:00
Cédric Krier 4454098479 Add foreign key for relation of model field
Closes #9050
2024-11-11 19:17:11 +01:00
Cédric Krier 620854a2d9 Display groups of record rules in list and form view
Closes #12000
2024-11-27 19:54:51 +01:00
Cédric Krier 2f8ce57d0b Remove required on user's menu and fallback to menu tree 2024-11-11 19:00:07 +01:00
Cédric Krier d7f89c8cba Move ir customization from res module to ir module 2024-11-10 02:14:34 +01:00
Cédric Krier ceb299a96a Setup and register ir and res modules earlier 2024-11-09 15:42:58 +01:00
Cédric Krier a82b9d35d0 Synchronize SQLite initialization SQL with PostgreSQL 2024-11-10 15:59:26 +01:00
Cédric Krier 81efba13d1 Optimize can_modify of model data
By searching only the records useful to raise error, it reduces the data read
and it can use an index.
2024-11-11 18:42:40 +01:00
Cédric Krier 7e827dd521 Ensure XML ID are unique per module 2024-11-11 16:39:56 +01:00
Cédric Krier 81f674082b Remove check_xml_record from ModelStorage 2024-11-11 15:19:51 +01:00
Cédric Krier f22c335057 Enforce unique DB ID per model in model data 2024-11-11 14:14:42 +01:00
Cédric Krier 534c5c28a9 Use message for unique constraint on model data 2024-11-11 14:11:11 +01:00
Cédric Krier 639482fd37 Update noupdate attribute on model data 2024-11-11 16:19:25 +01:00
Cédric Krier fabb5340e9 Always synchronize XML data with database
Closes #13668
2024-11-11 18:24:06 +01:00
Cédric Krier 0ef20b9571 Test model graph report 2024-12-23 15:36:47 +01:00
Cédric Krier c715844bb7 Move test workflow graph under ir module test 2024-12-23 15:32:11 +01:00
Cédric Krier d9ef6a486f Do not fail to render field without type in model graph 2024-12-23 15:29:56 +01:00
Cédric Krier 7ac5427f1c Search relational models by name in model graph
Since a4f347999b83 the name of the model is stored in the name field.
2024-12-23 15:29:00 +01:00
Cédric Krier ee79c18d80 Support TEST_PYTHONWARNINGS in doctest
We restore the doctest_setup to setup the python warnings based on
TEST_PYTHONWARNINGS.
2024-12-15 14:45:15 +01:00
Cédric Krier 2e61af81bb Fill ModelStorage caches only for records no further away then the read size
The read size is the size limit of the cache so filling it for record further
away will discard existing value closest.
2024-11-27 10:32:26 +01:00
Cédric Krier 523264e287 Compute default values of wizard view only for fields defined by value method
ba6b8ce0e692 introduces the reuse of Model.default_get to set the rec_name for
the values but it does by computing for all the fields which override the
actual default values.
2024-12-23 16:44:11 +01:00
Cédric Krier 00dff7193c Do not delete optional value for fields not set by the call
The same view may have different set of fields if it is extended conditionally.

Closes #13758
2024-12-16 15:38:11 +01:00
Cédric Krier 13a3f882a9 Share the same local cache for alone records saved together
The local cache must be shared between records from the same list of ids.

Closes #13704
2024-11-27 10:26:31 +01:00
Cédric Krier ab06c97ade Set journal mode, synchronous and optimize on SQLite connection
Closes #13609
2024-12-15 01:46:39 +01:00