diff options
| author | Yannick Tivisse <yti@odoo.com> | 2016-07-28 16:05:43 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2016-07-29 12:20:41 +0200 |
| commit | 42b891700e8279af388480825a10270583c95697 (patch) | |
| tree | 710cccfae4f1eb4feb89d49042baaa04cd6ff662 /addons/website/static/src/js/website.contentMenu.js | |
| parent | 3025951982a93da773da727fed8215bdff42782b (diff) | |
[FIX] report: allow 'get_action' to receive id, ids or browse records as 'docids'
1/ If no docids are passed in get_action (empty list) do not put in context
2/ The method should accept ids or browse records as docids for retrocompatibility.
- The api.v7 method took ids as docids
- The api.v8 method took a browse records 'records' to call the api.v7 method with
'records.ids' as docids
In python, we cannot write 2 functions with the same name that takes differents types
for the same argument. The function 'guess' in api.py will lead to a crash if we expect
a browse record and we send a list
The only way to allow the method to receive different types for the same argument is
to decorate it with '@api.noguess' to prevent any effect from guess method.
That way, we check directly if 'docids' is an id, ids or a browserecord and we always set
a list instead.
Diffstat (limited to 'addons/website/static/src/js/website.contentMenu.js')
0 files changed, 0 insertions, 0 deletions
