diff options
| author | Xavier Morel <xmo@odoo.com> | 2015-03-03 11:51:50 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2015-03-03 11:51:50 +0100 |
| commit | 752e21a633be22e30cb8ff9d63ad2ee656ff6b71 (patch) | |
| tree | 50a624f44736a8ec8fb342609e6c6dcb8ca0844b /addons | |
| parent | eb9c8912a94dca26852ef6ffd979703489ae70e4 (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.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/lib/py.js/lib/py.js | 8 |
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) { |
