Commit Graph
1685 Commits
Author SHA1 Message Date
qdp-odoo ccd58febd4 [FIX] base, account: usability on company currency selection.
We now display all the existing currencies (even the unactivated) instead of a link to activate more of them, and upon the save we make sure to activate the selected currency if it's not yet the case. That's better from a point of view since it avoids jumping off of the screen then come back to make this setting
2018-04-19 10:59:24 +02:00
Christophe Simonis c309ccd7b3 [MERGE] forward port branch saas-11.2 up to fed775bc0c 2018-04-18 18:30:35 +02:00
Christophe Simonis fed775bc0c [MERGE] forward port branch 11.0 up to 8c64159b88 2018-04-18 18:20:40 +02:00
Martin Trigaux c74f975994 [FIX] base: correct Arabic iso_code
The Arabic we use on Transifex is "simple" Arabic, not the one from Syria.
The .po files we synchronise are named 'ar.po', not 'ar_SY.po'

Change the iso_code to match the one we actually use.
transifex module relies on the iso_code to make its URL
2018-04-18 15:51:30 +02:00
Christophe Simonis 2c1c9c21f1 [MERGE] forward port branch saas-15 up to 16ec176620 2018-04-18 14:43:35 +02:00
Christophe Simonis 16ec176620 [MERGE] forward port branch saas-14 up to 67054b6dcb 2018-04-18 13:49:24 +02:00
Christophe Simonis 67054b6dcb [MERGE] forward port branch 10.0 up to 2f037a13ca 2018-04-18 12:14:53 +02:00
Mathieu Duckerts-Antoine 1f5cce174c [FIX] models: remove useless assertion in _read_group_raw
For historical reasons, a field in the read_group grouby parameter was required to be in the list of fields parameter without any necessity. This is not the case anymore. A byproduct of this commit is that it fixes a bug in pivot view introduced earlier in [47395c6].
2018-04-18 11:38:34 +02:00
Christophe Simonis 2f037a13ca [MERGE] forward port branch 9.0 up to cf163d19ee 2018-04-18 11:32:27 +02:00
Christophe Simonis 74033eb007 [MERGE] forward port branch saas-11.2 up to 90f8f17fb4 2018-04-16 19:50:50 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Christophe Simonis aab0908818 [MERGE] forward port branch 10.0 up to c92d43c04b 2018-04-16 12:33:49 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
Christophe Simonis 412501a5dc [MERGE] forward port branch 10.0 up to 7147622665 2018-04-16 11:18:08 +02:00
Kiril Vangelovski ff07f078fa [FIX] base: reason json payload using get_data
Replace `httprequest.stream.read()` by `httprequest.get_data()` so the
payload content remains available: get_data stores the request body (by
default) so it remains available for alternative processing or checks
(MAC checks for webhook validations for instance). With `stream.read()`,
once the data is read if it's not stored separately it is lost.
2018-04-16 10:29:13 +02:00
Odoo Translation Bot cc583a4ab2 [I18N] Update translation terms from Transifex 2018-04-15 07:03:16 +02:00
Odoo Translation Bot 4bc2581521 [I18N] Update translation terms from Transifex 2018-04-15 04:12:33 +02:00
Odoo Translation Bot 2901c0f0e5 [I18N] Update translation terms from Transifex 2018-04-15 00:29:26 +02:00
Martin Trigaux e09609bb31 [FIX] base: set correct Sudanese currency
Since July 1, 2007, the Sudanese pound is the only legal tender.

Closes #13802
2018-04-14 16:29:07 +02:00
Xavier Morel 1e6da402d7 [FIX] export performance regression from d28f8f7
d28f8f704f carefully clears only the
relevant bit of the cache (only the top-level object which we're
exporting), however the commit did not considert that _export_rows
calls itself recursively for relational fields, and thus when
exporting relational fields the relation would become the new
top-level and get cache-cleared on every iteration, significantly
slowing down cases where such records are shared and would need to be
re-fetched every iteration, even more so if they're somewhat/somehow
expensive.

OPW-1833545
OPW-1836361
2018-04-13 17:42:52 +02:00
Xavier Morel 115fa8f2d7 [FIX] export time regression by b5c660d8
While c059e7b93c64b9dd9bc96eeb6ee5cadf significantly lowers the cost
of generating xids, a safety invalidate cache can regress cases
significantly e.g. 18s -> 430s (7mn) for some recursive exports of
xids as the cache would be completely cleared *after each record*
requiring complete fetching & recomputation of the following records.

Fix by only clearing the cache if we've actually had to create
xids *and* only for ir.model.data records.

It's possible that clearing the cache isn't even necessary at all (?),
check with @rco-odoo

OPW-1835226
2018-04-13 17:42:52 +02:00
Nicolas Lempereur b79d8b99ff [FIX] base: amount_to_text possible difference
In 79038055 amount_to_text was refactored and improved, but there is a
drawback.

ie. if we have .29 cents with two decimals, `Twenty-Eight` was displayed
because `int(0.29 * 100) == 28` due to floating-point representation.

This commit keeps the improvements and fix this issue by using string
formatting of float as was done before.

opw-1829924
closes #24161
2018-04-11 08:57:20 +02:00
Christophe Monniez b696fa1b72 [REL] saas-11.3 2018-04-10 17:58:06 +02:00
Vincent Schippefilt 02a063fd73 [IMP] web: keyboard navigation in form view
The goal of this commit is to allow fast entry of the same model using
the keyboard for navigating through the form once, by blocking the user
from advancing in the form if there is a required field or once they
went through the form once to get them to a primary action (button)

This commit includes the following changes
    1) Enable moving forward from field to field using the TAB key
    2) Entering the one to many and many to many using the TAB key
        a. When entering it, set the focus on the "add new line" link or
            button
		b. When adding a new line, set the focus on the field visible
            editable field of the new line
        c. Discard adding a new line with ESC key
        d. If the user leaves the first field empty and uses TAB, we
            will cancel the adding of a new line and move to the next
            field of the form
    3) When a field is required and not filled in, do not allow the user
        to move out of the field using the TAB key (the user is still
        allowed to use the mouse though), mark the field as invalid
        instead
    4) After going though the form once, using the TAB key on the last
        field will move the focus to the first primary button of the page
    5) When the focus is on a primary button (EDIT/SAVE), the user cannot
        move the focus forward using the TAB key. Hitting TAB again will
        display a tooltip telling to hit ENTER to activate the button.
        The mouse is still available to move the focus.
    6) When the user saves, the focus is placed on the first primary
        button of the form renderer (like VALIDATE for a new invoice)
    7) On dialogs, primary buttons should stop the users from moving out
        of them, and showing a popup if the user tries
    8) When closing a dialog, the focus will be moved back to the widget
        that opened it.

This commit does not include the following features
    1) Navigation with the keyboard on a selection one to man
    2) Navigate between tabs in a form using the keyboard
    3) Cancelling the adding of a new line in a many to many using the
        ESC key do not set the focus correctly
    4) Enhancing the focusses fields (like blue underline)
2018-04-10 09:39:08 +02:00
Christophe Monniez 4ba6d2a405 [IMP] tests: make phantomjs work on Windows
Since Python 3.2, close_fds parameter is True by default on POSIX
platforms. On Windows, it's set to False when one of the standard descriptors
is set.

This commit will give the opportunity to run phantom js tests on
Windows.
2018-04-10 09:32:30 +02:00
Thibault Delavallée a03f8da8e4 [IMP] tests: allow to add a margin on performance tests
Purpose of this commit is to avoid errors for some performance tests that
have a slightly variable number of queries. Indeed some tests in test_mail
module vary of 1 or 2 queries due to a behavior still not found that does
not seem deterministic.

This should not be considered as a real error, but should not be considered
as completely valid. This is why a margin is accepted in some tests that
will raise a warning instead of an error. This warning tells people to
check if they have increased the query counter or if it is due to a random
effect in query count.

This is a manual forward-port of saas-11.2 commit 3fe0ee5ae6 .
2018-04-09 17:28:03 +02:00
Thibault Delavallée 3fe0ee5ae6 [IMP] tests: allow to add a margin on performance tests
Purpose of this commit is to avoid errors for some performance tests that
have a slightly variable number of queries. Indeed some tests in test_mail
module vary of 1 or 2 queries due to a behavior still not found that does
not seem deterministic.

This should not be considered as a real error, but should not be considered
as completely valid. This is why a margin is accepted in some tests that
will raise a warning instead of an error. This warning tells people to
check if they have increased the query counter or if it is due to a random
effect in query count.
2018-04-09 16:52:12 +02:00
Thibault Delavallée 3bb498d696 [REVERT] "[IMP] core: tolerate a 10% deviation for number of queries"
This reverts commit d565596868. Indeed whole purpose of having tests
based on query counters is to fail every time query count is greater than
expected. Query count could be greater than expected because
 * either it is required by a bug fix or a feature and tests should be
   updated accordingly in the same commit;
 * either implementation can be improved to avoid or lessen query count
   impact and code should be updated accordingly;
 * either we have some random queries due to nondeterministic behavior;

It seems purpose of the commit was to solve the third case. However we think
hiding first two cases can be dangerous compared to solving third case.
Moreover having a threshold of 10% does not make sense. It means some complex
test case could take 30 queries more without being noticed. Some tests could
fail after several commits adding queries and finding them afterwards could
be complicated.

Another solution based on flagging some tests that have a small random
behavior will come soon.
2018-04-09 16:52:12 +02:00
Lucas Perais (lpe) 6ee5b6fd6f [FIX] base: update module list without translating fields
Install a database in some other language than en_US
In debug mode and in the app list viewer,
   you'll see that the apps field are translated into your language
Then do an "Update App List"
Reload your page

Before this commit, the Apps' field lost their translation
This was because when checking for any updated data for known modules,
the ORM fetched the translation automatically, and compared the old (translated)
value with the new (English) value from the manifest

After this commit, This operation doesn't make the translations to be lost,
because only english values are compared

OPW 1832796
closes #23910
closes #24091
2018-04-09 09:22:11 +02:00
Odoo Translation Bot 5864fa7896 [I18N] Update translation terms from Transifex 2018-04-08 07:06:57 +02:00
Odoo Translation Bot d9f7490f55 [I18N] Update translation terms from Transifex 2018-04-08 04:13:24 +02:00
Odoo Translation Bot 1735ac582c [I18N] Update translation terms from Transifex 2018-04-08 00:29:15 +02:00
Christophe Simonis d565596868 [IMP] core: tolerate a 10% deviation for number of queries 2018-04-06 18:39:51 +02:00
Arnold Moyaux f384db9b67 [IMP] base, web: define landscape in report template
Since report refactoring the function to override is get_report_values
that only returns a dict of value that are used in rendering.
In order to render a pdf with a landscape orientation, a context key could
be added however since it's not possible to return a report object in
get_report_values, it's difficult to add a contexti without using some tricks.

This commit add a report option to use in the template that will be used
in order to modify the pdf orientation. The process used was already existing
for other options like dpi,...
2018-04-06 17:05:14 +02:00
Christophe Simonis 860dfb5586 [MERGE] forward port branch 11.0 up to d277adf4d5 2018-04-06 15:36:10 +02:00
Christophe Simonis c94d30541c [MERGE] forward port branch saas-15 up to 97a70c2d8e 2018-04-06 14:33:40 +02:00
Christophe Simonis 97a70c2d8e [MERGE] forward port branch saas-14 up to 5eb6e14e85 2018-04-06 13:43:57 +02:00
Raphael Collet 0eb8518786 [IMP] fields: describe group_operator when given on all field types 2018-04-06 10:57:02 +02:00
Christophe Simonis 76131b7970 [MERGE] forward port branch 10.0 up to ea42f6c176 2018-04-06 10:35:25 +02:00
Alexis de Lattre c41f7297d3 [FIX] report: create a new environment
self is a rml_parse instance, not a BaseModel
create new environment to call ORM methods
prevent crash when calling formatLang on a RML report

Closes #24068
2018-04-06 09:27:35 +02:00
Adrian Torres 2875b94e03 [FIX] osv.expression: normalize domains in combine
Before this rev:

* Take 2 domains that contain at least two leaves, and at least one of
them must use the implicit `&` operator

e.g.:
    d1 = [('so_line', 'in', [91]), ('amount', '<=', 0.0)]
    d2 = ['&', ('so_line', 'in', []), ('project_id', '!=', False)]

* Perform osv.expression.OR() between both domains

Expected result:
    d3 = ['|', d1, d2]

Actual result (after normalization):
    d3 = ['&', '|', d1, d2]

This is because, since the `&` is implicit for the first domain, when we
OR it, we give it an explicit `|` operator, so when we pass this domain
through the normalize_domain function, d1 no longer contains an implicit
`&` operator but instead the implicit operator is the one between d1 and
d2, therefore giving us a completely wrong domain.

The `combine` function states that it only accepts normalized domains,
however neither the OR nor AND functions do, this leads to a lot of
developers putting non-normalized domains into these functions, and
there's no error checking or anything that obviously indicates that the
domain is incorrect, so we might as well normalize all domains being
passed since it's already pretty optimized.
2018-04-06 07:45:25 +02:00
Raphael Collet 5f06926093 [FIX] models: in _read_group_raw, do not aggregate grouped fields 2018-04-05 18:44:40 +02:00
Christophe Simonis ff46163bca [MERGE] forward port branch 10.0 up to f4326b4dab 2018-04-05 16:21:23 +02:00
Fabien Meghazi fd4939dc78 [FIX] base: honor registry/cache signaling for multiple threaded servers
Before this patch the registry and cache signaling was only activated
for PreforkServer. In case Odoo was deployed in a multi process/multi
threaded architecture the signaling was not ensured, causing registry
de-synchronisation amongst threaded servers.

This fix will be backported in v10.0 and v11.0 as soon as it has been
battle tested.
2018-04-05 14:22:32 +02:00
Nicolas Martinelli 9b6ca49b58 [FIX] http: Bokmål language code
- Install Website
- Load the 'Norwegian Bokmål' translation, and choose to translate the
  website
- Logout

When accessing the website, the language displayed is not consistent to
the browser language.
1. `no` shows homepage in `nb_NO` (Firefox only) => expected since
    Bokmål is the main language in Norway
2. `nb` shows homepage in `en_US` => unexpected
3. `nn` shows homepage in `en_US` => expected since 'Norwegian Nynorsk'
   is not a language available (this will be the topic of another PR)

The issues comes from Babel's side, since `nb` is not in the
`LOCALE_ALIASES` while `no` is. We monkey-patch the value to avoid this
while Babel is corrected.

opw-1827258
2018-04-05 11:01:11 +02:00
xmo-odoo b5c660d8c0 [IMP] base: batch XID generation during export
* add UUIDs to XID sections (4 bytes / 8 hex digits) so it's not
  necessary to handle collisions & add a fallback generator
* use COPY for performances over executemany: executemany just
  performs an implicit loop on all statements (in psycopg2)
* ~pure SQL was possible:

      INSERT INTO ir_model_data (module, model, name, res_id)
      SELECT
          '__export__',
          '{model}',
          '{table}_' || A.id || '_' || uuid_generate_v4(),
          A.id
      FROM {table} A
      LEFT JOIN ir_model_data B
             ON A.id = B.res_id AND B.model = %s
      WHERE B.res_id IS NULL;

  but would have required installing pg extensions (problematic
  especially in stable) and performances are about the same as
  the COPY version

task 36343
Fixes #22493
2018-04-05 10:34:48 +02:00
xmo-odoo 14840d2064 [IMP] core: modernize tgz translations export
* don't use FS to do export
* update translations export dialog to fix outdated links (launchpad
  & 6.1 translations doc)

Note: can't use ``TarFile.gettarinfo`` to create the TarInfo object
because it wants an actual file object with a ``name`` attribute and
possibly even an fd.

closes #22798
2018-04-04 13:12:33 +02:00
Nicolas Martinelli 6eefb7fb39 [FIX] base: user.share recomputation
When saving the settings, we perform a `write` on the groups and implied
groups. This will trigger a recomputation of the fields `share` on
`res.users` and `partner_share` on `res.partner`.

On a database with many users, this can lead to a non-negligible time
spent in these methods.

opw-1830145
2018-04-04 09:24:58 +02:00