Commit Graph

1027 Commits

Author SHA1 Message Date
Lucas Perais (lpe) 7805cf5fef [FIX] tools: fix amount to text in fr and nl
Correct rendering of 70 and 90 in french
And manage inversion [unit]-en-[tens] in nl

opw 757048

closes #19297
2017-09-08 09:40:56 +02:00
Richard Mathot 63ad8b9597
[FIX] tools: prevent crashes with Pillow >= 4.2.0
From Pillow 4.2, it is forbidden to save RGBA images as JPEG
( e4d6223c94 )

A crash was occurring when loading demo JPGs as
image_resize_and_sharpen() was silently changing image mode to RGBA.
Now we ensure that we return the original image mode.

We also avoid crashes when converting from PNG to JPG
2017-07-07 10:11:40 +02:00
Olivier Dony d18d606a55
[FIX] tools: verify path before opening 2017-06-02 22:29:47 +02:00
Olivier Dony 58114e4954
[FIX] tools: always preload PIL with basic formats
Ensures that only the desired list of images formats are made
available via PIL: BMP, GIF, PNG, JPEG, TIFF and PPM.
2017-05-05 16:56:31 +02:00
Olivier Dony 492d8ce4d0
[FIX] config: correctly bootstrap data_dir
Complements the patch in 15583a4813
in order to properly bootstrap a writeable data_dir when it is
(partially) nonexistant.
Depending on the startup parameters the data_dir might otherwise
have ended up read-only, preventing the creation of its necessary
components (session store, file store). Only the `addons` directory
of the data_dir needs to be read-only by default.
2017-01-28 00:53:20 +01:00
Olivier Dony 15583a4813
[FIX] module: allow disabling 1-click install
As discussed on issue #15225, it should be possible for system administrators
to disable the 1-click installation system.
The plan is to disable the feature by default, but make it relatively easy
to turn on when it is explicitly desired.

1. At the moment we cannot guarantee that all Apps published on the Odoo Apps
   Store are safe. And it is a security risk to let end-users deploy Python
   code on their Odoo servers without requiring any review/deployment by a
   competent system administrator.
   We will work on improving the validation process of the Store, but this
   will require time, and won't probably be a 100% safe process in any case.
2. The one-click install feature is however really useful to help
   non-technical users install Apps, as long as the feature has been
   explicitly allowed by the system administrator. This is a common feature
   in other software suites as well. So we'd like to keep it as an opt-in
   feature.
3. Administrators of multi-tenant servers, cloud hosting services, etc.
   understandably expect to be able to turn off the feature for
   security/control reasons.
4. By turning off the feature by default, but still exposing it in the UI,
   we keep it *discoverable* for users. The error message should be
   helpful to direct users to their sysadmins.
5. By using the permissions of the download folder as a flag for turning
   off the feature, we avoid introducing an extra server parameter.
   The folder is still created (read-only) by default, for the sole purpose
   of making it easier to locate.

Fixes #15225
2017-01-27 13:00:42 +01:00
Martin Trigaux 254afc6c9d
[FIX] tools: colorize image with pillow 4.0
Introduced by python-pillow/Pillow@c3fe5d43 and integrated into pillow 4.0
The size of the image is ignored and must be set using an image or a mask.

This patch is retrocompatible with the previous versions as the changed code was
in the box size computation. With this patch a 4 points box size is given so the
modified code is not executed.

Fixes #14927
2017-01-19 10:36:21 +01:00
Wolfgang Taferner c39ca45c6d [FIX] config: avoid to accept server-wide-modules with None as a module
Fixes #14048
Fixes #14045
Closes #14051
2016-10-28 15:02:52 +02:00
Leonardo Rochael Almeida 5ee4344efd [IMP] Allow configuration of server_wide_modules from file
Allow reading and saving the value of `server_wide_modules` from the
configuration file, instead of just the command line.
2016-10-25 15:23:41 +02:00
Christophe Simonis ecb6055b0f [FIX] tools/config: avoid sharing init/demo config
Theses config options should not share the same dict as `init` dict
may be modified by migration scripts to handle new module dependencies.
2016-10-11 16:46:32 +02:00
Olivier Dony 3d55aff1c8
[FIX] convert: properly catch Value/Name Errors 2016-10-03 23:41:44 +02:00
Olivier Dony 12634e1227
[FIX] base_import_module, tools: raise a clear error for unsupported file types
Also restrict XML data attribute evaluation context
even for real module data files. This will prevent
accidentally depending on context parameters that
would not be available inside base_import_module.
2016-10-03 19:48:09 +02:00
Jairo Llopis 295f62741d
[FIX] tools: cherry-pick of 0529a7f9
extract terms in correct folder

If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).

In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.

Force the module path to ends with a folder separator to avoid wrong matching.

Closes #13363
2016-09-28 13:43:41 +02:00
Christophe Simonis 5e18f5a080 [FIX] tools: correct Burmese locale 2016-05-13 12:53:17 +02:00
Martin Trigaux e93cf3f3dd
[ADD] tools: Burmese language 2016-05-11 11:42:02 +02:00
Andreas Stauder 9b70650adc
[ADD] tools: Swiss German language
Closes #4722
2016-05-11 11:41:32 +02:00
Stefan Rijnhart 0c2f7bdbc2 [FIX] tools: export translated fields not included in _columns
Non-stored new API computed fields are only defined in _fields
but not in _columns, and they were never exported within translation
files.

Closes #9081
2016-04-26 19:12:51 +02:00
Olivier Dony 67a63e2cc9 [MERGE] Forward-port 7.0 up to rev. cb609bd425 2016-02-03 16:42:29 +01:00
Olivier Dony cb609bd425 [FIX] tools.misc: log errors when parsing fails 2016-02-03 02:25:09 +01:00
Olivier Dony e8d06f7b20 [MERGE] Forward-port 7.0 up to bdbcbea285 2016-02-03 00:40:27 +01:00
Olivier Dony cc724c2e61 [FIX] base: centralize custom data serialization for builtin types only 2016-02-02 22:42:31 +01:00
Martin Trigaux a46f8bb9c5 [FIX] tools: do not generate translations for exported records
When a record is exported, an external ID, in the form of __export__.<model>_<id>
is created on this record.

When the translations are generated (e.g. "synchronise terms" wizard), the
translations may be duplicated for records that have been exported. If a
translation is submitted before the export (when the record had no external ID
yet), a new empty translation is created as the module differs in the import.

Creating a new translation may be a problem as the new term (equal to the source
term) will be used as the translation value.

Fixes 9480
2016-02-01 14:13:34 +01:00
Denis Ledoux 7f29a23118 [FIX] tools: email TLDs can be longer than 6 chars
According to the RFC1034
https://tools.ietf.org/html/rfc1034

A TLD can use up to 63 octets.

The regex checking that an email address is valid
should there allow emails using a TLD with such a length.

Besides, the use of TLD domains exceeding 6 characters is more
and more common, nowadays.

e.g. using a domain `.amsterdam`

opw-660014
2015-12-16 17:11:08 +01:00
Thibault Delavallée 3f758e2fab [FIX] tools, mail: do not strip name from email_to
When sending a mail.mail with email_to, the processing split the email_to into
a list of addresses. However if the found addresses use the form name <email>
the name if lost in the process. A new email_split_and_format method is introduced
in tools and used to avoid loosing that information.
2015-12-11 11:22:40 +01:00
Christophe Simonis 83a4a582fa [MERGE] forward port of branch saas-3 up to 513cea6 2015-12-08 12:28:41 +01:00
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Denis Ledoux 31e8bb8e9d [FIX] mail: better signature detection
This revision back-ports revisions
983d5eb9fa
&
ccbb8e09a6
regarding this signature regex.

Besides, it adds the fact the dashes have to
be at the beginning of the line
to make them detected as a signature.

opw-655834
2015-11-30 14:48:59 +01:00
Olivier Dony d117d6645e [MERGE] Forward-port 7.0 up to 051b2ce539 2015-11-17 17:55:17 +01:00
Olivier Dony 051b2ce539 [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00
Olivier Dony e99358415a [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00
Christophe Simonis a6b11a151e [MERGE] forward port of branch 7.0 up to f8b56e4 2015-10-10 14:25:35 +02:00
Leonardo Rochael Almeida 1005299955 [FIX] YAML: `!menuitem` tag handling
The fetched ID was the one of the parent instead of the ID of the imported menu.
2015-09-28 17:15:38 +02:00
Leonardo Rochael Almeida 39745a4290 [FIX] YAML: Add support for `reference` fields in YAML
YAML import was missing support for loading values into fields
where `field.type == 'reference'`.
2015-09-28 17:15:38 +02:00
Leonardo Rochael Almeida 11886f4d9f [FIX] YAML: typos 2015-09-28 17:15:37 +02:00
Leonardo Rochael Almeida 5760a5d547 [IMP] YAML: Better Error message for bad xml_id
Use the original xml_id, which is present in the file, instead of the
checked one.
2015-09-28 17:15:37 +02:00
Ronald Portier (Therp BV) 65d4b25565 [FIX] tools: i18n_extra loading, backport of 7c2795ca
In case of different directory for stroing po and pot files than 'i18n'
(e.g. 'i18n_extra'), a po could be linked to a wrong pot file.
Use the same folder as the po file to look for pot.
Closes #4323
2015-09-28 15:38:39 +02:00
Martin Trigaux 95a376040f [FIX] tools: error in cafe326b
If defined, use module_name, otherwise not doing much...
Courtesy of @KangOl
2015-09-18 10:49:29 +02:00
Martin Trigaux cafe326b59 [FIX] tools: avoid duplicates when synchronising translation
The "Synchronise translation" wizard almost doubles the number of translated
terms in database.
This is due to the loss of the module reference at the synchronisation
(`module_name` is empty as updating all modules)
Only overwrite the module when it is set (default None)
Fixes #6149

Second part of the patches avoid inserting translations without any module for
locale xml ids.
2015-09-17 17:09:55 +02:00
Christophe Simonis 35233dbbe2 [FIX] core: tools.html_sanitize: allow svg images 2015-09-11 16:42:47 +02:00
Martin Trigaux 8ac392873b [FIX] tools: export translations of models.py
When exporting the translations, the terms stored in individual files outside of
addons folders (e.g. openerp/models.py) needs to be scanned as well and added in
base translations.
Some folders like osv and report were enough to add these files but with the new
api moving the ORM to openerp folder, a non-recusrive scan needs to be added.

Fixes #7482
2015-09-08 16:55:36 +02:00
agaldona db6514ea48 [IMP] tools: add language eu_ES Basque / Euskara
As a new translation team has been composed.
Closes #8346
2015-09-07 12:30:06 +02:00
Christophe Simonis 88e8107e01 [MERGE] forward port of branch saas-3 up to 505e308 2015-07-14 15:13:03 +02:00
Christophe Simonis 505e308cd6 [MERGE] forward port of branch 7.0 up to e12cece 2015-07-14 15:00:33 +02:00
Olivier LAURENT e12cecea9d [FIX] tools: separator in po comments
Comments in .po(t) files for translations of type "code" (e.g. field labels)
specify the path to the file containing the translation. This path should be
OS-independent to get the same result whatever the plateform the instance is
running on.
Closes #7561
2015-07-14 11:40:16 +02:00
Christophe Simonis 9654b54d3c [MERGE] forward port of branch saas-3 up to b15461b 2015-07-10 16:46:40 +02:00
Christophe Simonis b15461baba [MERGE] forward port of branch 7.0 up to 1d01872 2015-07-10 16:30:48 +02:00
Temur Vibliani 0eeab361d9 [FIX] tools: Added Georgian Language to the installable languages 2015-07-08 11:51:35 +02:00
Christophe Simonis 00afd776fd [MERGE] forward port of branch saas-3 up to dbe60c7 2015-07-07 15:42:58 +02:00
Christophe Simonis dbe60c7bce [MERGE] forward port of branch 7.0 up to 3add4f6 2015-07-07 15:40:31 +02:00
Martin Trigaux 3add4f665c [FIX] tools: accept multilines on_change
Allow to write on_change on several lines (accepted by view parser but was not
by yaml parser, making false positive at 595216b)
2015-07-07 15:36:15 +02:00