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
Cédric Krier
5adb1e9356
Test default_get with instance value and rec_name
2024-12-22 17:25:46 +01:00
Cédric Krier
be5d4fcfc4
Do not compute record name for negative id
...
With ba6b8ce0e692 the record name of default values are also computed for
one2one and reference but reference fields can have a default value with only
the model part by using a negative id. In this case we should not compute a
record name.
2024-12-22 17:24:22 +01:00
Cédric Krier
88b7266c6e
Enforce record rules on resources
...
The rules of the resource record must be enforced like the model access.
Closes #13706
2024-11-27 19:48:27 +01:00
Cédric Krier
e492b6d048
Convert None as empty string when searching on Char or Text
...
Closes #13584
2024-11-24 18:01:51 +01:00
Cédric Krier
c03dff9352
Support instances as default value
...
Closes #13694
2024-11-20 12:08:20 +01:00
Cédric Krier
44957156d3
Ignore KeyError from the pool when filtering model names
...
When the database is updating, Model.get_name_items can be called while the
pool is not yet completely filled. So some model stored in the table may not
yet be in the pool. In this case we should ignore them.
Closes #13761
2024-12-18 17:01:24 +01:00
Cédric Krier
7464e4005c
Keep raising HTTPException in with_pool wrapper
...
This was removed by mistake in c8ebaa541e21
Closes #13771
2024-12-21 18:58:50 +01:00
Cédric Krier
1fd50fb805
Retry locking tables at the same speed as the dispatcher request
2024-12-18 13:51:44 +01:00
Cédric Krier
f1161d2aba
Log request duration at wsgi_app level instead of with_pool
...
This gives more accurate duration as other decorators may take time to execute.
Closes #13650
2024-11-05 19:05:41 +01:00
Cédric Krier
b26ff9757e
Add metadata columns to ModelSQL with table query
...
Closes #9414
2024-10-25 00:24:39 +02:00