Commit Graph
10 Commits
Author SHA1 Message Date
Christophe Simonis 737ca0eb42 [FIX] web: adapt newly added test (2) 2018-09-06 17:27:50 +02:00
Christophe Simonis 63f95760ef [FIX] web: adapt newly added test
Oversight of previous forward-port
2018-09-06 17:23:27 +02:00
Christophe Simonis 505e42b78b [MERGE] forward port branch saas-15 up to 5a5d6d1e8e 2018-09-06 17:00:26 +02:00
true-datura 67f67b5124 [FIX] web: 'image_small' field not displayed for non-latin translations
Before this commit, images in kanban view of the Contact app were not displayed
on non-latin languages, such as Russian.

This was caused by the is_bin_size helper that wrongly assumes that a certain
string is not a binary size, although it is (e.g. 64.2 Кб).

This commit fixes the issue by including such strings as valid binary sizes.

Bug found and fixed by @true-datura
Test by @alexkuhn

closes #23526
closes #22519
2018-03-08 14:29:36 +01:00
Nicolas Martinelli e703d07e68 [FIX] web: read_group RPC
Example of failing request:
```
rpc.query({
    model: 'link.tracker.click',
    method: 'read_group',
    args: [[links_domain, ['create_date', '>', interval]], ['country_id']],
    kwargs: {groupby:'country_id'},
});
```

The RPC request built contains the following:
```
args: [[["link_id", "=", 1]], ["create_date"]]
kwargs: {groupby: "create_date:day", domain: [], fields: []}
```

This will be interpreted server side as:
```
model.read_group([['link_id', '=', 1]], ['create_date'], groupby=['create_date:day'], domain=[], fields=[])
```

2 arguments match `domain` and `fields`, which causes a crash.

opw-781300
2017-11-24 14:16:13 +01:00
Aaron Bohy 05282fd434 [FIX] web: pyeval_tests: typo
Introduced by forwardport 34b432d528
2017-06-27 10:22:35 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
David Monjoie d99ae3fd87 [FIX] web: keep positional args for search_read
The previous code used to create its own args array
for the search_read method, replacing the one that
was originally given to it.

This lead to silent errors since positional arguments
to this function were completely ignored in the case
of search_read.

I took this commit as an opportunity to improve a
bit on the current state of these rpc helpers.
Namely, the basic args/kwargs priority is the following (top-to-bottom):
- kwargs defined in the rpc call
- kwargs defined in the kwargs key of the params kwarg of the rpc call
- positional arguments are passed as is

For read_group and search_read methods, the priority is the following:
- kwargs defined in the rpc call
- kwargs defined in the params kwarg to the rpc call
- kwargs defined in the kwargs key of the params kwarg of the rpc call
- positional arguments are passed as is

For the /web/dataset/search_read controller, only the params kwarg is
supported, resulting in the following priority:
- kwargs defined in the rpc call
- kwargs defined in the params kwarg to the rpc call
- positional arguments are passed as is

If both a kwargs and a positional arg is given for the same parameter,
it will be sent as is to the server which will crash with a typical
"got multiple values for keyword argument" TypeError. However, in the
MockServer however, we give priority to kwargs over args in this case.

Please note that I also chose to remove unnecessary default values so
that the ones actually used are the ones from the server, not the ones
that were duplicating those in the rpc js file.
2017-05-02 15:24:56 +02:00
Géry Debongnie 51e9aba2cb [FIX] web: do_action should properly resolves when complete
We changed the do_action method recently: before, it was calling
recursively its parent, now it simply triggers up an event.  We also
moved it to the 'services' mixin.  However, we did not properly connect
the 'on_success' option: it is not an option for the view manager, but
for the abstract web client.  As such, it should not be in the options
parameter, but it should simply be a key in the event payload.

This commit was found by solving the two following issues:
- open sale application, click on 'Inbox' icon to go to discuss,
  Discuss is opened, but the navbar stays with sales application
- after installing module website_crm_partner_assign in kanban view for apps,
  it does not reload...

Both of these were caused by the need to do something after a do_action,
and the deferred was not resolved at all.
2017-04-27 09:24:59 +02:00
Géry Debongnie 875ea7964c [REF] account, web, web_diagram: rename static test folder
For consistency, every static test folder should be named 'tests', with
a s.
2017-04-11 19:44:38 +02:00