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
Cédric Krier
2b8e4fb2dc
Use record name for subtest based on record
2024-10-25 00:28:09 +02:00
Cédric Krier
16da4be04f
Add report data to header_key
...
Closes #13627
2024-10-24 18:11:42 +02:00
Cédric Krier
58647f9ee7
Remove unused docstring in Model definition testing field depends
...
docstrings are no more used since 23ce421d3bb9
2024-12-05 16:29:42 +01:00
Cédric Krier
4cbce5729e
Include the depends of the getter function when depending on a Function field
...
Since c47b3642f1a6, the getter of a Function field may be called if there is no
value set for it on the instance.
In the on_change context, this may set the missing fields to None if they were
not defined in the depends of the method called. In addition to compute a wrong
value, those fields are then returned as modified.
Closes #13735
2024-12-05 16:25:16 +01:00
Cédric Krier
1360ae6c5d
Do not use init values for new record without id to compute the changed values
...
When using new instance to fill a xxx2Many field, all the values must be
considered as changed and we should not expect any initial value.
Closes #13716
2024-11-30 12:56:41 +01:00
Cédric Krier
ce2bc3a3a0
Limit keyword action to ModelView
2024-11-16 18:42:42 +01:00
Cédric Krier
2e974388b9
Limit resource reference to subclass of ModelView and ModelStorage
...
Closes #13689
2024-11-16 18:42:17 +01:00
Cédric Krier
d661f3d8da
Allow filtering model names by subclasses
2024-11-16 18:41:25 +01:00
Cédric Krier
b8e124efaa
Better naming between session and wizard instance when testing wizard
2024-11-21 18:09:22 +01:00
Cédric Krier
838cee8307
Do not re-instantiate action report when printing workflow graph
2024-11-21 18:08:54 +01:00
Cédric Krier
3481debb43
Convert value to integer when setting reference value as string
2024-11-21 18:07:57 +01:00
Cédric Krier
f5a9f36823
Test _ids type when instantiate ModelStorage
2024-11-21 18:06:48 +01:00
Cédric Krier
6cff740d3c
Validate integer digits
...
Closes #12975
2024-10-20 18:22:26 +02:00
Cédric Krier
d85f0b4456
Add support for DATE_TRUNC from INTERVAL to SQLite backend
2024-12-15 20:55:42 +01:00
Cédric Krier
90ffa4ad8a
Fix DATE_TRUNC with date and time
...
Since 96bc08db1fd5, fromisoformat is used so the value may be a date or a time.
So not all the attributes are available for those types.
And SQL requires to always return a datetime.
2024-12-15 20:54:23 +01:00
Cédric Krier
c51e0157aa
Use fromisoformat to parse value in SQLite functions
2024-12-14 16:20:10 +01:00
Cédric Krier
40c5010b77
Import datetime as dt in SQLite database
2024-12-14 16:16:07 +01:00
Cédric Krier
81cd587477
Add support for EXTRACT from INTERVAL to SQLite backend
...
Closes #13305
2024-12-14 16:22:59 +01:00
Cédric Krier
e8f0704d0b
Do not check for integrity error the required fields with set method
...
Closes #13745
2024-12-11 11:02:07 +01:00
Cédric Krier
1c9682e7ae
Set default icon for board and list-form action window
2024-11-10 02:11:09 +01:00