summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2015-03-03 11:51:50 +0100
committerXavier Morel <xmo@odoo.com>2015-03-03 11:51:50 +0100
commit752e21a633be22e30cb8ff9d63ad2ee656ff6b71 (patch)
tree50a624f44736a8ec8fb342609e6c6dcb8ca0844b
parenteb9c8912a94dca26852ef6ffd979703489ae70e4 (diff)
[FIX] py.js: arguments dispatching in PY_call
When providing an args of ``null`` (or ``undefined``) and a non-empty kwargs, the kwargs would be removed/ignored. While explicitly providing a null args is not necessary, it's perfectly valid.
-rw-r--r--addons/web/static/lib/py.js/lib/py.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/lib/py.js/lib/py.js b/addons/web/static/lib/py.js/lib/py.js
index 2c738dc95d1..ed5657c8f3b 100644
--- a/addons/web/static/lib/py.js/lib/py.js
+++ b/addons/web/static/lib/py.js/lib/py.js
@@ -547,11 +547,13 @@ var py = {};
};
py.PY_call = function (callable, args, kwargs) {
if (!args) {
- args = []; kwargs = {};
- } else if (typeof args === 'object' && !(args instanceof Array)) {
+ args = [];
+ }
+ if (typeof args === 'object' && !(args instanceof Array)) {
kwargs = args;
args = [];
- } else if (!kwargs) {
+ }
+ if (!kwargs) {
kwargs = {};
}
if (callable.__is_type) {