Commit Graph
5604 Commits
Author SHA1 Message Date
Nicolas Évrard 8d7279778b Get ir.model Model from the pool
Closes #14131
2025-07-23 18:01:24 +02:00
Cédric Krier 750bfe2045 Do not convert integer value from binary function field
Binary fields can have two types bytes and integer when only the size is
requested. So integer value should not be converted to bytes.

Closes #14100
2025-07-03 23:10:30 +02:00
Cédric Krier 8ce69b1055 Use only foreign Many2One for domain on field for field access
The Char fields are not filled when using the foreign Many2One so the domain
must rely only on the foreign Many2One.

Closes #14081
2025-06-17 15:25:09 +02:00
Cédric Krier 380f7c6941 Slugify filename of email attachment
This gives more chance for the email to not be blocked as some mail server
implement restrictions on the filename of attachment.

Closes #14074
2025-06-15 12:19:39 +02:00
Cédric Krier 1fc8fa8809 Use chain to iterate over records to create and to write 2025-06-29 19:14:36 +02:00
Cédric Krier dbb65081b0 Do not restore values for created records when exception is raised when saving
Once a record has been created, the id is modified which change its hash value
such that it can not be found anymore.
But as the creation succeeded (and only the write part has failed) we can just
restore the values to None.

Closes #14093
2025-06-29 19:13:42 +02:00
Cédric Krier 4238add5e3 Do not set Content-Length header to data response
Since version 0.8 werkzeug set the header automatically by default.

Closes #14010
2025-06-21 23:02:52 +02:00
Nicolas Évrard 69690daa2c Fix a typo introduced in 71bad2d56f96 2025-07-02 01:02:22 +02:00
Cédric Krier b63c28503c Use recursive CTE for child/parent-of clause when the number of ids is too large
The path or MPTT queries are faster than the recursive CTE only when the number
of OR-ed clauses does not require more index scan than the CTE.
This number can be approximate to the depth of the tree.
Log10 is used to estimate the depth of the tree if it has an average of 10
children per node.

Closes #14078
2025-06-16 13:48:00 +02:00
Cédric Krier ea1393bb84 Reduce the clauses of child-of using common roots
For the path, if the longer path contains another searched path, we can ignore
it.
For MPTT, if a range is inside a larger range, we can also ignore it.

Closes #14064
2025-06-10 23:22:01 +02:00
Cédric Krier 6718a613cf Convert UnidentifiedImageError from PIL into validation error
The image conversion that are done as preprocessing of the user input should be
considered as data validation.

Closes #14084
2025-06-18 01:26:39 +02:00
Cédric Krier c3a9faea42 Convert domain without checking access
The searcher of Function field may execute code for which the user has no
access.

Closes #14077
2025-06-16 19:42:12 +02:00
Cédric Krier 98f6f4b037 Convert tuple from XML ID into string before join them
9941357a9b7c modified the 'ref' method of the eval context of XML file to
return reference string but get_id return a tuple of string and integer. So the
integer must be converted to string before being joined.

Closes #14066
2025-06-19 09:45:55 +02:00
Cédric Krier a41611ddd5 Do not fail if the cache name to clear does not exist
Cache instance can be created on usage like in ValueMixin, so a process may not
have an instance of the cleared cache.

Closes #14067
2025-06-12 12:48:22 +02:00
Maxime Richez 207f097a95 Do not check access when register button click
e6c72b1f23e7 missed to add the decorator on the register method.

Closes #14060
2025-06-19 23:40:11 +02:00
Cédric Krier 1921487213 Replace the usage of field definitions with field attributes in the ModelStorage
Model.fields_get is expensive to call as it create a new dictionary for each field.

Closes #14061
2025-06-10 14:31:11 +02:00
Cédric Krier 5e560afbdc Do not use field definitions when exporting data
Calling Model.fields_get is expensive especially for each record to export.

Closes #14061
2025-06-10 14:29:07 +02:00
Cédric Krier 16d36ff2f7 Export Many2One and Reference using record name 2025-05-21 17:03:43 +02:00
Cédric Krier d769ff12c3 Support import of one2many as list of name 2025-05-21 17:03:21 +02:00
Cédric Krier eab2b6deb0 Support export of xxx2many fields as list of name 2025-05-21 17:00:31 +02:00
Cédric Krier 9843587815 Import multiselection field as CSV list
Closes #13995
2025-05-21 16:58:36 +02:00
Cédric Krier 840a342214 Export multiselection field as CSV list
Closes #13995
2025-05-21 18:38:40 +02:00
Cédric Krier 0ad9570070 Document preferred languages order for get_email 2025-05-23 17:13:37 +02:00
Cédric Krier 5307e3303a Set email content with maintype when needed and correctly set Content-Language header
When the content is not a string, EmailMessage.set_content requires a maintype
argument but not when it is a string. The maintype is then deduced using the
mimetypes module.
The Content-Language of content or alternate must be set using the headers
parameter instead of params which is for the Content-Type.
And finally the Content-Language must be set on the main message only if it
contains multiparts otherwise it is set twice.

Closes #14028
2025-05-23 17:07:57 +02:00
Nicolas Évrard d3f93b46f8 Use class access model when testing for parent access 2025-05-22 10:59:36 +02:00
Cédric Krier c22cef7e23 Remove empty files when exporting translations of a module
If the module has no translations, no file should be created. If they exist,
they must be removed.

Closes #14021
2025-05-15 13:33:44 +02:00
Nicolas Évrard a190aae17f Remove notification events from the queue after the wait times out
Closes #14022
2025-05-14 12:12:54 +02:00
Cédric Krier d58b9e2d90 Set Message-Id to email sent
Closes #13974
2025-04-14 15:56:38 +02:00
Cédric Krier 301982d6f2 Add pair/unpair in tools 2025-04-30 15:12:49 +02:00
Cédric Krier 4b906352b1 Add tests for view tree width 2025-05-04 10:11:03 +02:00
Cédric Krier a69b2b6b69 Delete tree width records when field is set multiple times
There is no unique constraint so the method to set width should not rely on the
unicity of the field per screen size.

Closes #13997
2025-05-04 08:40:40 +02:00
Cédric Krier 5738a5fb46 Do not precede negative currency symbol in Italian 2025-04-10 09:10:12 +02:00
Cédric Krier ae5b18eba0 Increase version number 2025-04-28 16:40:56 +02:00
Cédric Krier 04487b81d4 Prepare release 7.6.0 2025-04-28 16:12:25 +02:00
Cédric Krier 2e1d79d050 Do not lock table on SQLite when checking unsupported constraint
It is not needed as SQLite does not have an explicit lock mechanism but such
call restart the transaction anyway.
2025-04-27 17:20:45 +02:00
Cédric Krier b85d6e9efa Update translations [skip ci] 2025-04-27 11:36:15 +02:00
Cédric Krier 8b1c044274 Do not clear non unique help translation
The help translations may be composed of partitioned strings.

Closes #13978
2025-04-23 18:32:04 +02:00
Cédric Krier e45be331a7 Lock records on transaction start
Same as c8771e45b861 but when locking only records instead of the table.

Closes #13943
2025-03-27 13:39:04 +01:00
Cédric Krier 220fd433c9 Add checkout option to cookiecutter command line in tutorial 2025-03-25 09:30:22 +01:00
Cédric Krier 854562ad6e Add default value to user in set_user testing tool 2025-03-30 15:21:11 +02:00
Cédric Krier fff5663ae1 Add DecimalNull as tools 2025-04-08 09:59:33 +02:00
Nicolas Évrard cfc38c8070 Store column widths by screen size 2025-04-14 22:57:36 +02:00
Nicolas Évrard 8b6e83e5b2 Allow column widths to be reset 2025-04-14 23:16:26 +02:00
Nicolas Évrard 4f195c7ffe Add simple chat widget on sidebar of clients 2025-04-12 17:25:28 +02:00
Cédric Krier e5c35f988b Add chat 2025-04-12 16:54:16 +02:00
Nicolas Évrard 0e9cfb3e84 Do not refresh the pool when the notification comes from the same process 2024-12-18 17:08:26 +01:00
Nicolas Évrard 3cf1d64372 Use process-local data structure to store process related data 2025-01-08 23:20:32 +01:00
Nicolas Évrard 26f7c7142b Add process local objects ala threading.local 2025-02-14 17:16:55 +01:00
Nicolas Évrard c643794a85 Remove a useless call to Cache.refresh_pool
Since Pool.init is called with a non empty update, it will make a call to
Cache.refresh_pool at the end of its call to load_modules
2024-12-17 15:16:51 +01:00
Nicolas Évrard ac6e93b078 Reset the pool instances only on the pool initialization
In a scenario where cache_timeout is set to zero, concurrent updates to the
pool might result in an empty pool dictionary because the process making the
update lose its reference to the updated pool thus replacing it with an empty
dictionary on the following instantiation of Pool.

Closes #13763
2024-12-17 15:14:04 +01:00