If a user A deletes the res.users record of user B while B is connected,
the verification of the session token fails with a comparison of a boolean and
bytes values.
While the check should obviously fail, this patch gracefully inform the user B
its session has expired and redirect him to the login page.
Without the patch, the session is never invalidated in the user browser,
redirecting to a forbidden error page as long as the session has not been manually
cleared from the browser.
Fixes#25530Closes#25654Closes#25682
Before, the name given to the copy method was always 'the old name (copy)'
(even bypassing what might have been given to the default values dict).
opw 1862214
Before, the name given to the copy method was always 'the old name (copy)'
(even bypassing what might have been given to the default values dict).
opw 1862214
Before this commit:
* Install module A
* Edit a view from module A, add a custom field
* Uninstall module A
* Reinstall module A
* Try to access the module A's previously modified view
-> Can't access the view, or even sometimes the app at all.
Cause:
When uninstalling module A, the custom field added to module A's is
properly unlinked, however the custom/studio view is not unlinked, therefore
the view references a field that no longer exists, when accessing the
view it will obviously crash (sometimes the traceback is not even
displayed to the user!).
Solution:
Emulate an ondelete cascade for child views only when in uninstall mode.
There is no reason to prevent creating a menu linked to a top menu
It does work to have only one parent level as a menu
Error reported during technical training
Application of a fix more specific to the problem of the contact widget
which can not serialize the dictionary because it contains the values of
the context of which browse record. (because contact try to
json.dumps options for multi-edition feature in web_editor)
opw-1859848
https://github.com/odoo/odoo/commit/ab85e9594651fd33ffd2747f4d3c5b360e7c7922
In b446930dc there has been a number of changes in report to improve
performances.
In one of these change, printing several documents with result such as:
```
<div class="article"><h1><span data-oe-model="mymodel" data-oe-id="1" data-oe-field="myfield" /></h1></div>
<div class="article"><h1><span data-oe-model="mymodel" data-oe-id="3" data-oe-field="myfield" /></h1></div>
```
The system will know it is rendering 2 mymodel records (with IDs: 1, 3)
and will try from the document to determines what part (called
"outlines") of the PDF corresponds to these IDs.
This is done by splitting the document over semantical delimitations
such as h1, h2, *.
If all is fine: each part of the PDF will be saved for each record, so
if we print records 1 and 3 they will be saved separately and will be
possibly used as is the next time they are to be printed.
But in the instance of printing a report which has:
- field that are displayed,
- several records printed at the same time,
- save and getting document back from attachment enabled,
- no h1 or other semantic delimitation
The matching of part of PDF and outlines can't be done since there is no
outlines, this was not expected by the code and caused an error.
With this change, if there is no outline each part of the PDF will not
be saved as attachment.
opw-1856469
closes#25496
Make sure to test `None` instead of any falsy value. Indeed, when we
want to explicitly pass a `False` default value, `set_multi` might
select an incorrect default value.
This is for example the case of `_inverse_product_pricelist`, where
`default_for_country` might be `False` on purpose.
opw-1858271
This revision follows revisions
- 9cd982bcc8
- df4072b0b4
We noticed modules implementing multi-websites features
override `_get_asset` to be able to provide their
own overriden `AssetsBunble` class.
Private methods are meant for internal usage of the code/module,
overriding is never a good idea given the fact their signature
can change. As this is the case in commit
9cd982bcc8.
That said, we understand their was no other way to go.
We therefore decide to provide one,
by adding a method that can be overriden to pass
their own AssetsBunble class instance.
opw-1860136
Return of _get_assets has been altered with commit 9cd982bcc8
We keep it for retro compatibility, but devs that override it before need to
override now _get_asset_node to be called correctly by t-call-asset.
The context is send to qweb as option, the options are converted into a
frozen dict, the browse records can have a closer cursor, takes the place
in the cache, and raise and exception in qweb (because contact try to
json.dumps options for multi-edition feature in web_editor.
opw-1859848
Refactoring of qweb to call _post_processing_att for each nodes. This
change remove the crappy ovewrite in website module. The website overwrite
only the _post_processing_att to add the cdn parameters.
The static node (without t- attributes) can stay static (remove overwrite
of _is_static_node), the cdn is applied at the compile time for this
nodes instead of at the running time like the dynamic node.
- Each time we check if a session is valid we create a new cursor.
This could lead to issues with db_maxconn that limits the number of
connections to the postgresql server.
In a perfect world, a worker should use a single connection to
postgres to process the request.
The only known side effect is that the cursor is created earlier in
the execution of the code.
- This commit fixes issues with the longpolling raising
Psycopg2.PoolError exceptions on databases with a lot of clients.
With saas-11.2's 3fbd86b some trigger towards other fields are improved
but this caused an issue when a inherited field towards a custom
computed field had no depends.
When we created a computed field x_custo on res.partner, we have a
inherited x_custo on res.users automatically created.
Both these fields have a depends computed to `('',)`, this caused an
error for the one on res.partner: but this was ignored with dd048ae7.
Since saas-11.2's 3fbd86b this also caused an error on the inherited
field but since an inherited field is not "manual" the error was not
ignored. Thus it was not possible to create custom field on a model
inheriting of another model if the fields had no depends.
opw-1854786
closes#25146
Co-authored-by: Raphael Collet <rco@odoo.com>
Before this commit, if a SyntaxError or any other exception occurs in a
qweb attribute, and the path to the node contains at least one
namespaced tag, e.g.:
<mynode:node xmlns:mynode="http://example.com/mynode">
<field t-att-value="'This is a TypeError' + []"/>
</mynode:node>
the following exception is raised, instead of the actual one:
lxml.etree.XPathEvalError: Undefined namespace prefix
After this commit, if the path to the failing node contains a namespaced
tag, the node is not retrieved, to avoid the above exception, So this
one will be raised:
Error to render compiling AST
TypeError: Can't convert 'list' object to str implicitly
Template: module.template_name
Path: /templates/mynode:node/field
In addition, a test case was included, to ensure this works as expected
Closes#24824
opw-1853232