Commit Graph
318 Commits
Author SHA1 Message Date
Martin Trigaux 1421949c67 [FIX] tools: import translation file without pot
Due to fccfd36 and 4ba7fbb the translations were only imported, considering the
.pot as the reference.

During import or a manual csv or po file, there is no pot file.

Add tests with Klingon and Dothraki

Fixes #27044
2018-09-18 18:02:19 +02:00
Martin Trigaux 4ba7fbbf81 [FIX] tools: use pot as reference file
In the first attempt at #26134, the pot_targets was cleared after creating
the pot_rows object.

Since the rows not present in the pot_targets are now skipped, clearing the pot
should not be done.

Still use a temporary list pot_rows to avoid modifying the list we are iterating
on.

Update the .po test file to match the new file format

Closes #26881
2018-09-11 09:16:59 +02:00
Martin Trigaux fccfd36e05 [FIX] tools: skip bad translations
cherry-pick of 428fbd0381 that was reverted at 737ba55e1e as it was making
tests fail

The following commit will correct the tests
This commit only reverts the revert
2018-09-11 09:14:53 +02:00
Christophe Simonis 5020f41b95 Revert "[FIX] tools: skip bad translations"
This actually broke some valid use cases (catch by new translations tests)

This reverts commit 428fbd0381.
2018-09-07 17:24:10 +02:00
Christophe Simonis 49c3264ce0 [MERGE] forward port branch saas-11.3 up to 4850fb0838 2018-09-07 14:43:48 +02:00
Christophe Simonis f19e6ce561 [MERGE] forward port branch 11.0 up to 213759b03e 2018-09-05 18:52:27 +02:00
Toufik Benjaa 7700bd172f [FIX] mail: Avoid using default value for track fields logging
- When a tracked field is modified, a mail.message is created.
  When create is called its tries to fill missing values with "default
values".
  It first tries to find the default values in the context, which may
occurs.
  For example, modifying a tracked field on a subtask will add a key
"default_parent_id" in the context, which is the parent_id of the project.task.
  Create will try to use "default_parent_id" for the mail.message
parent_id field, which make the SQL Request invalid.
2018-09-05 18:36:54 +02:00
Martin Trigaux 1566c0ab3b [FIX] tools: avoid loading duplicated code translation
This commit fixes two bugs:

- a8469c45 was fixing the case where the first line was not 'code' but broke
  the usecase where a po started with code line

- Correct the usecase where a pot and po file do not have the same line of code
  by matching on res_id=0

This avoids to have a pot expecting a code message at line 42 and a translation
at line 43

Closes #26722
2018-09-03 11:02:43 +02:00
Martin Trigaux a8469c4590 [FIX] tools: handle code in po
The previous code, as explained at b505ba9e0a, was to avoid creating duplicated
code entries for the same source (as only one is considered).

In case of a po comment like
 #. openerp-web
 #: model:ir.ui.view,arch_db:base.ir_access_view_search
 #: code:addons/web/static/src/js/chrome/search_inputs.js:716
 #: code:addons/web/static/src/xml/base.xml:1125
 #, python-format

the condition was not triggered (trans_type is model), creating two code entries

Necessary in #26614 to fix #26553
2018-08-28 18:10:03 +02:00
Lucas Perais (lpe) 7768abd40b [FIX] tools:image: reset stream on crop
When cropping the image with a size, we crop it first and then we make a thumbnail out of it

Before this commit, the same byte stream was used, meaning that the thumbnail was
appended to the original

After this commit, we reset the stream

OPW 1876496
closes #26575
2018-08-27 10:31:43 +02:00
Christophe Simonis ef6b574eda [MERGE] forward port branch saas-11.3 up to 6cc7d3f945 2018-08-21 18:48:13 +02:00
Christophe Simonis 70d0148d0d [MERGE] forward port branch 11.0 up to fbfb91799e 2018-08-21 16:58:17 +02:00
Lucas Perais (lpe) 412c471e78 [FIX] tools: sanitize allow white-space style
OPW 1870847
2018-08-17 12:58:21 +02:00
Martin Trigaux 428fbd0381 [FIX] tools: skip bad translations 2018-08-17 01:29:54 +12:00
Christophe Simonis dabe59df9c [MERGE] forward port branch saas-11.3 up to 27d8daf8a7 2018-08-14 19:43:32 +02:00
Christophe Simonis 27d8daf8a7 [MERGE] forward port branch 11.0 up to 51225c9b9f 2018-08-14 18:59:57 +02:00
Christophe Simonis 51225c9b9f [MERGE] forward port branch saas-15 up to 52e88036f2 2018-08-14 18:24:40 +02:00
Christophe Simonis 52e88036f2 [MERGE] forward port branch saas-14 up to d4ee30b4fa 2018-08-14 17:45:46 +02:00
Christophe Simonis d4ee30b4fa [MERGE] forward port branch 10.0 up to a487d7d397 2018-08-14 17:09:32 +02:00
Xavier ALT c5e1bffa3d [FIX] tools: formatLang should use cached lang 2018-08-13 11:18:00 +02:00
Christophe Simonis 7717f082c0 [MERGE] forward port branch saas-11.3 up to af35aea6b0 2018-08-09 19:33:32 +02:00
Christophe Simonis 9cb97a8c2d [MERGE] forward port branch saas-11.2 up to 499af66727 2018-08-09 15:06:31 +02:00
Christophe Simonis efe2dcd7ae [MERGE] forward port branch 11.0 up to ced9156a97 2018-08-07 19:08:07 +02:00
Christophe Simonis 65a80cf3fd [MERGE] forward port branch saas-14 up to 0c5cbbe0bb 2018-08-07 17:01:16 +02:00
Christophe Simonis 0c5cbbe0bb [MERGE] forward port branch 10.0 up to 692a32e780 2018-08-07 16:54:18 +02:00
Christophe Simonis 33e7479865 [MERGE] forward port branch saas-11.2 up to d7e2c767ce 2018-08-07 13:59:40 +02:00
Christophe Simonis d7e2c767ce [MERGE] forward port branch 11.0 up to 3513e599a7 2018-08-07 13:58:20 +02:00
Deep Patel 1369272f1a [FIX] base: inline buttons was breaking into multiple lines (outlook hack)
Because we converted buttons into tables so inline buttons was
breaking into multiple lines so we need to add display inline and vertical align
properties in tables.

We allowed display property from mail sensitizer whitelist.

Because in this commit https://github.com/odoo/odoo/commit/cf15030ed09f7479f5b2701ba101a5bed71f7409
we use display property for align items
2018-08-06 16:17:48 +02:00
Christophe Simonis a719cf2563 [MERGE] forward port branch saas-11.3 up to b4555df336 2018-07-30 17:02:28 +02:00
Christophe Simonis b4555df336 [MERGE] forward port branch saas-11.2 up to 3376bad191 2018-07-30 15:51:38 +02:00
Christophe Simonis a6e401a2ee [MERGE] forward port branch 11.0 up to 44ea58234e 2018-07-30 14:08:56 +02:00
Olivier Laurent 8ee329c1dc [FIX] P3: add missing opcode
In Python 3, SETUP_FINALLY is used if the exception object is bound in
the except block — even if there is no finally block — in order to
unbind and cleanup the exception's binding as part of PEP 3110:
https://www.python.org/dev/peps/pep-3110/#semantic-changes

This allows both using exception objects in Python 3 and using
finally blocks in both version.

opw 1824211
2018-07-30 09:49:59 +02:00
Christophe Simonis ba202dbe63 [MERGE] forward port branch saas-11.2 up to 3c521f6d05 2018-07-24 18:10:32 +02:00
Christophe Simonis 4e76173a43 [MERGE] forward port branch 11.0 up to 219d2296d6 2018-07-23 16:03:25 +02:00
Christophe Simonis 1f7a39964b [MERGE] forward port branch saas-11.3 up to 0c42dcfc22 2018-07-19 15:36:54 +02:00
Xavier Morel 9f8eae34d1 [FIX] undefined variables (potential nameerror)
Backport 9ec0455abc and
6a601fe6dc as they fixed various
possible NameError but did so in later sub-releases.
2018-07-19 13:37:10 +02:00
Christophe Simonis e5fab318d9 [MERGE] forward port branch saas-11.2 up to 02f38beffb 2018-07-18 17:59:23 +02:00
Christophe Simonis 5b9a51bb1d [MERGE] forward port branch 11.0 up to 44b77d3702 2018-07-17 17:48:34 +02:00
Martin Trigaux af9d6b86a1 [ADD] tools: add new 3.7 opcodes
Python 3.7 introduced two new opcodes LOAD_METHOD and CALL_METHOD.
https://docs.python.org/3/whatsnew/3.7.html#cpython-bytecode-changes
https://bugs.python.org/issue26110

Basic QWeb rendering was failing on operations like
      request.csrf_token()
ValueError: forbidden opcode(s) in 'request.csrf_token()': LOAD_METHOD, CALL_METHOD

Closes #25783
2018-07-17 13:42:50 +02:00
Olivier Dony 21bb14d177 [FIX] base: always preload dateutil
The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.

Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.

This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
2018-07-23 16:15:10 +02:00
Olivier Dony ef017ab1ab [FIX] base: always preload dateutil
The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.

Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.

This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
2018-07-23 16:15:10 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
Christophe Simonis d45c32baac [MERGE] forward port branch saas-15 up to bdd051bf78 2018-06-13 18:13:48 +02:00
Christophe Simonis bdd051bf78 [MERGE] forward port branch saas-14 up to c43c540172 2018-06-13 14:12:12 +02:00
Pratima Gupta caf400fa7c [IMP] tools: allow more items in styling white list when sanitizing
Some of the templates Odoo proposed do not display well on all email readers
as too much styling attributes are sanitized. This commit adds some styling
in the white list to allow having stylized templates while still having a
coherent white list.

This commit is related to task 51122 (and PR #24052).
2018-06-08 15:20:03 +02:00
qdp-odoo a6b75d401d [REF] mail_thread: refactoring of _find_partner_from_emails()
More flexibility equals more powa
2018-06-06 14:17:03 +02:00
Christophe Simonis 279d928693 [FIX] core: always load base and web as server wide modules
Since 285ead28e3, `base` should be loaded
as a server wide module to enable rpc routes.
2018-06-05 14:46:24 +02:00
Raphael Collet 627292f7f3 [IMP] convert: simplify context when creating records
The context was containing a dictionary under the key `install_mode_data`,
which was informing about the model, xml_id, module, filename.  Actually only
the module and filename were necessary, and the others were slowing down the
import because of generating artificially different environments.

The context now has two entries `install_module` and `install_filename`.
2018-06-01 13:30:28 +02:00