summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorToufik Ben Jaa <tbe@odoo.com>2020-03-31 16:05:32 +0000
committerOlivier Dony <odo@odoo.com>2020-04-01 00:30:30 +0000
commit707522cb010ac4efc04a5eeeb04d02b04d721521 (patch)
tree7b63c0be2c5fba6ab1e8a648c259a0b7bec9e4a3 /doc/reference/javascript_reference.rst
parentd05c81365347b1e61f9ff09d3d0005c8788bc060 (diff)
[FIX] sql_db: flush when no `uid` in environment
- A bug has been introduced by the PR https://github.com/odoo/odoo/pull/46719 This issue prevented flushes to database when no `uid` is set in the current environment. This happens when database changes are made in `auth="none"` routes. In a MonoDB setup this was working because Odoo consider `None`, `False` as `null` and was always bound to a database. Nothing prevents to write `null` in the columns `create_uid` and `write_uid` in database. The PR that introduced the bug wanted to block the cases where `uid` is an instance of the class `RequestUID` to avoid `Cannot adapt type` errors. So testing that `uid` is an integer isn't enough. Two fixes were possible here, either check if `uid` is an instance of the class `RequestUID` or if it is either an integer, `False` or `None`. To avoid noise and imports from `odoo`, we test that `uid` is an instance of `None`. The case where it is `False` is already tested in the python code: ```python isinstance(env.uid, int) ``` (manual) forward-port of odoo/odoo#48685 closes odoo/odoo#48693 Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com> Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions