Commit Graph
1580 Commits
Author SHA1 Message Date
Martin Trigaux 96f01c08f8 [FIX] service: properly invalidate session of deteled users
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 #25530
Closes #25654
Closes #25682
2018-07-10 13:49:41 +02:00
Christophe Simonis e354142ce7 [MERGE] forward port branch saas-15 up to c22e479246 2018-07-10 13:21:06 +02:00
Christophe Simonis c22e479246 [MERGE] forward port branch saas-14 up to 5d8076c842 2018-07-10 12:22:55 +02:00
Christophe Simonis 5d8076c842 [MERGE] forward port branch 10.0 up to 5e682451cb 2018-07-10 11:30:59 +02:00
Christophe Simonis 5e682451cb [MERGE] forward port branch 9.0 up to 8b25099aea 2018-07-10 11:25:27 +02:00
Odoo Translation Bot d6a71fae93 [I18N] Update translation terms from Transifex 2018-07-08 04:09:36 +02:00
Odoo Translation Bot 33b698254a [I18N] Update translation terms from Transifex 2018-07-08 00:26:19 +02:00
len-odoo dc5e0e5833 [FIX] base: allow to give a name attribute to the res.groups copy method
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
2018-07-06 14:47:51 +02:00
len-odoo 6a3b2b94d0 [FIX] base: allow to give a name attribute to the res.partner copy method
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
2018-07-06 08:45:40 +02:00
Christophe Simonis 84210074e5 [MERGE] forward port branch saas-15 up to b06c09db60 2018-07-05 16:23:47 +02:00
Christophe Simonis b06c09db60 [MERGE] forward port branch saas-14 up to 92e5da6b8f 2018-07-05 15:35:24 +02:00
Christophe Simonis 92e5da6b8f [MERGE] forward port branch 10.0 up to 26e7d5d8ee 2018-07-05 15:05:21 +02:00
Christophe Simonis 26e7d5d8ee [MERGE] forward port branch 9.0 up to b5c50fa824 2018-07-05 14:19:33 +02:00
Adrian Torres bca2926b01 [FIX] base: properly unlink child views
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.
2018-07-03 11:11:25 +02:00
Martin Trigaux 055a8828c4 [FIX] base: remove oudated filter
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
2018-07-02 15:47:49 +02:00
Odoo Translation Bot 5316406ad7 [I18N] Update translation terms from Transifex 2018-07-01 04:09:17 +02:00
Odoo Translation Bot cebab1eb7e [I18N] Update translation terms from Transifex 2018-07-01 00:24:24 +02:00
Christophe Matthieu 39f0f5db77 [FIX] ir_qweb: send template options in context to the fields
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
2018-06-27 15:11:37 +02:00
Nicolas Lempereur f52a5a7255 [FIX] base: print multi record report no outlines
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
2018-06-27 13:21:13 +02:00
Martin Trigaux bc69d1298b [I18N] export saas-15 source terms
To be able to properly translate them
Linked to translation report at opw-1859044
2018-06-27 12:18:30 +02:00
Christophe Simonis 24f18e995e [MERGE] forward port branch saas-15 up to bda926034a 2018-06-26 14:58:48 +02:00
Christophe Simonis bda926034a [MERGE] forward port branch saas-14 up to c9a01ab30a 2018-06-26 13:13:05 +02:00
Christophe Simonis c9a01ab30a [MERGE] forward port branch 10.0 up to 58c92d9374 2018-06-26 12:57:31 +02:00
Nicolas Martinelli 2254b5cf1c [FIX] base: default value in set_multi
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
2018-06-26 09:46:53 +02:00
Odoo Translation Bot f9737d79e7 [I18N] Update translation terms from Transifex 2018-06-24 04:09:30 +02:00
Odoo Translation Bot 268357bf15 [I18N] Update translation terms from Transifex 2018-06-24 00:25:09 +02:00
Denis Ledoux 6edf49e36f [IMP] ir_qweb: provide a clean way to ovverride the AssetsBundle to use
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
2018-06-22 15:36:28 +02:00
Jeremy Kersten df4072b0b4 [FIX] base: keep _get_asset for retro compatibility
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.
2018-06-22 11:10:50 +02:00
Christophe Matthieu ab85e95946 [FIX] ir_qweb: remove browse records from context
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
2018-06-20 14:14:36 +02:00
Odoo Translation Bot 94e49c251a [I18N] Update translation terms from Transifex 2018-06-17 04:40:39 +02:00
Odoo Translation Bot 74c567329a [I18N] Update translation terms from Transifex 2018-06-17 00:26:55 +02:00
Christophe Matthieu eee1b39806 [FIX] ir_qweb: post process the attributes in widget html value
issue: Blog doe not use the cdn because the widget html value is not
compiled by the qweb and does not use the attribute post processing.
2018-06-15 08:42:15 +02:00
Christophe Matthieu 9cd982bcc8 [FIX] qweb: use cdn for asset files
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.
2018-06-15 08:42:15 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 803df909b1 [MERGE] forward port branch saas-14 up to 804d68efe5 2018-06-14 18:05:38 +02:00
Christophe Simonis 804d68efe5 [MERGE] forward port branch 10.0 up to 23a1bce2a9 2018-06-14 18:03:26 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
Christophe Simonis d45c32baac [MERGE] forward port branch saas-15 up to bdd051bf78 2018-06-13 18:13:48 +02:00
Christophe Simonis bdd051bf78 [MERGE] forward port branch saas-14 up to c43c540172 2018-06-13 14:12:12 +02:00
Christophe Simonis c43c540172 [MERGE] forward port branch 10.0 up to 788750ea51 2018-06-13 10:55:58 +02:00
Andreas Perhab bb8ded772a [FIX] db: close connection of incompatible DB only
Close connections of incompatible databases instead of closing all
connections.

Introduced in 610036756a

Closes #24479
opw-1852793
2018-06-12 18:26:35 +02:00
Toufik Benjaa c8243e71c6 [FIX] http: Consume less cursors for session checks
- 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.
2018-06-12 18:10:37 +02:00
Christophe Simonis e3658d6f56 [MERGE] forward port branch saas-15 up to d44cd77884 2018-06-12 16:31:54 +02:00
Nicolas Martinelli 9a3fc2a06f [FIX] base: P3.5 - P3.6 compatibility
In P3.6, the error message has changed.
2018-06-12 15:48:43 +02:00
Carlos Dauden ac68eb5b3d [FIX] base: ir_qweb fix timezone for datetime with widget=date
Before this commit, display a datetime field with the widget="date" was ignoring
the timezone.

This commit closes #24761
2018-06-12 15:48:21 +02:00
Nicolas LempereurandRaphael Collet e60a8762fb [FIX] base: depends if no depends is ()
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>
2018-06-12 13:12:39 +02:00
Christophe Simonis d44cd77884 [MERGE] forward port branch saas-14 up to 284ed9216c 2018-06-12 12:19:14 +02:00
Daniel Dico 8be5cc0980 [ADD] base: set vat_label for Canada
Closes #25052
2018-06-12 10:19:11 +02:00
Luis González d5d797360a [FIX] base: Avoid exception when showing error in namespaced qweb node
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
2018-06-12 10:14:29 +02:00
Andreas Perhab e34a9ba58f [FIX] test_pylint: incompatibility between pylint 1.6 and python 3.6
reference: https://github.com/PyCQA/pylint/issues/1349

pylint 1.6 and python 3.5 (and below) should work fine, so no need to
force people to upgrade there.
2018-06-12 10:12:09 +02:00