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
Cédric Krier
e77e0c2349
Add icon for list-form
2024-11-10 02:10:28 +01:00
Cédric Krier
48e6a7374d
Use more explicit icons for form, list and tree
...
Closes #11391
2024-11-10 02:10:04 +01:00
Cédric Krier
25322bc0d1
Set label on form view as help text of record rules
2024-11-27 19:58:38 +01:00
Cédric Krier
fd903381db
Improve naming of the tested view
...
It is more useful to have the filename of the view if possible or the model
name and type.
2024-11-29 13:43:47 +01:00
Cédric Krier
e2ee8f5b13
Remove unused EMAIL_REFKEYS from action
...
Since 8288b688cfeb this global variable is no more used.
2024-12-05 16:27:17 +01:00
Cédric Krier
57ca116d24
Do not clear string field translations of model
...
Since de19952c097a the 'name' field has been renamed into 'string' also for the
translations.
2024-12-01 10:32:48 +01:00
Cédric Krier
cd0bcf8ff5
Document gettext and ngettext methods added to the report context
...
They were added by 9403850c8ead but without documentation.
2024-12-01 19:06:26 +01:00
Cédric Krier
26930ddda9
Add msg_gettext and msg_ngettext to Report context
2024-12-01 19:04:56 +01:00
Cédric Krier
e1121fd3e9
Do not quit the SMTP sever on 421 error code
...
smtplib is already closing the connection when such error code is received.
Closes #13710
2024-11-28 14:47:11 +01:00
Cédric Krier
27e589ccd7
Do not set empty To, Cc nor Bcc in email message
...
Since gh-102988, email.utils.getaddresses() return [('', '')] for invalid email
addresses which includes empty string if the header is set with an empty list.
Closes #13649
2024-11-18 08:44:57 +01:00
Cédric Krier
f93146919f
Drop constraints using cascade
...
This is needed when dropping a constraint used to enforce a foreign key for
example.
2024-11-20 11:17:15 +01:00
Cédric Krier
2b8642b6ee
Add manual migration to documentation
2024-11-24 00:35:36 +01:00