Commit Graph
1196 Commits
Author SHA1 Message Date
Bruno PLANCHER f5e803c025 [FIX] tools: strip i18n-overwrite from gevent parameters
When gevent is enabled, some arguments are stripped to avodi being retriggered
in the other workers (e.g. update of a module).
The `--i18n-overwrite` was not stripped and the other worker raised an error has
the `overwrite_existing_translations` argument requires the `update` argument
(which is stripped in the `stripped_sys_argv` method.

Fixes #12566
Closes #12986
2016-08-03 16:33:27 +02:00
Martin Trigaux 04b081ab37 [FIX] tools: do not display False as the currency
The field symbol is not required on a res.currency (it should and will be
changed in master). In case it is not set, do not display the currency in the
rapport.

Fixes #11346
2016-08-03 14:23:11 +02:00
Guewen Baconnier 6cc7c03212 [FIX] tools: use without_demo specified in configuration file
When using the -i command line option without the --without-demo=all command
line option, demo data was installed even if the configuration file has
a line without_demo = all

This change is safe as just above, opt.without_demo is copied into
self.options['without_demo'] so we are sure to consider the 2 options.

Closes #12730
Fixes #9293
2016-07-27 17:39:09 +02:00
Jairo Llopis 0529a7f9ba [FIX] tools: 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 #12757
2016-07-13 09:43:38 +02:00
Jeremy Kersten 39a7ce44b0 [FIX] tools: don't save dev_mode in config file.
When user reset master password from web database manager, the
config file is saved.

If server was started in dev_mode the param dev_mode was saved
in openerp_serverrc silently. (in 9 or always in trunk)

Remind: --dev_mode should be never used on a production server.
2016-06-17 17:19:00 +02:00
Damien Bouvy 9c007ac375 [IMP] db_manager: better uuid management
* Always change the uuid of a duplicate database by default
* Clearer message when restoring a backup
2016-06-16 17:29:41 +02:00
Christophe Matthieu 3d9ccef81d [FIX] translate: doctype is removed from the backend web template
issue: The rendering is altered because the browser doesn't know how to parse the html and css content
2016-06-07 14:16:12 +02:00
Christophe Matthieu a4c1e10ae6 [FIX] translate: do not translate <!DOCTYPE>
Avoid the DOCTYPE tranlation. If this tag is changed, the html rendering is altered. The other effet is that the web_editor wrap the content with <span> to translate, but some explorer eject tags (doctype, head content, script, style, meta) et insert this tags in the body.
NB: DOCTYPE is not a node but a text.
2016-06-06 11:18:41 +02:00
Martin Trigaux a93b6e8de0 Revert "[FIX] translate: don't translate DOCTYPE tag"
This reverts commit 44e8b92beb.

The condition is wrong as a view starting with DOCTYPE as top element will be
excluded, including its child (the whole page them).

Re-add the translatable title that was excluded by the condition.
2016-05-26 14:08:35 +02:00
Christophe Matthieu 44e8b92beb [FIX] translate: don't translate DOCTYPE tag 2016-05-26 07:50:48 +02:00
Christophe Simonis f1659a0dc9 [MERGE] forward port of branch saas-6 up to f6eda2c 2016-05-13 12:59:04 +02:00
Christophe Simonis f6eda2c350 [MERGE] forward port of branch 8.0 up to 5e18f5a 2016-05-13 12:54:34 +02:00
Christophe Simonis 5e18f5a080 [FIX] tools: correct Burmese locale 2016-05-13 12:53:17 +02:00
Christophe Simonis 7e999ece01 [MERGE] forward port of branch saas-6 up to 19a77d9 2016-05-12 18:20:08 +02:00
Christophe Simonis 2f374c4cba [MERGE] forward port of branch 8.0 up to 3a32021 2016-05-12 12:38:02 +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
Martin Trigaux 59982a04a4 [FIX] tools: keep comment in CSV export
The comments field was ignored (because reasons) when exporting terms in CSV.
This was an issue when using the wizard 'Synchronize Terms' as it first export
the terms of every module in CSV.

opw-673853
2016-05-10 12:46:20 +02:00
Christophe Simonis 396facfaf0 [MERGE] forward port of branch 8.0 up to 8651d08 2016-05-02 11:04:21 +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
Raphael Collet 7a483a85d4 [FIX] *: do not use computed fields for resizing images
Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.

The issue comes from the storage of the images.  When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set.  As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation!  As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.

The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.

opw 666330
Closes #11516
2016-04-02 00:47:57 +02:00
Xavier Morel 078da0badd [IMP] move guess_mimetype to tools and improve it
* move guess_mimetype from ir_attachment to a misc submodule so it can
  be used outside of attachments (in base_import in this case)
* fix the broken detection of zip and OpenDocument files (would all be
  detected as msword files)
* correctly implement detection of OOXML files (including returning the
  right MIME type)
* attempt to correctly detect OLECF Excel files (.xls)
* add PPT detection (untested)
* remove duplicate patterns in GIF detection
2016-02-17 15:45:11 +01:00
Martin Trigaux 669b6f7b3d [FIX] tools: less strict evaluation of translations
Do not parse the translation of an attribute value.  The content of a
translatable node attribute (such as 'string') should not be tested for
XML/HTML validity: the value can contain special chars such as `&` in its
source and should not be escaped when evaluated.

This fixes escaped page title in the partner form
`Sales & Purchases` => `Ventes &amp; Achats`
2016-02-10 16:10:18 +01:00
Thibault Delavallée 8aff53733b [FIX] tools: mail: sanitizer email escape
The sanitizer escapes email addresses contained in its source html to
avoid having it being discarded. Indeed the lxml cleaner considers them
as invalid tags and remove them.

However this escaping does not take into account email-like patterns
contained in cite attribute present on blockquote, del, ins or q.

This could lead to blockquote tags being escaped and therefore wrongly
displayed. This is now fixed.
2016-02-05 11:51:18 +01:00
Olivier Dony 93e8bf8ccf [MERGE] Forward-port saas-6 up to 1f022a0b4a 2016-02-03 16:55:41 +01:00
Olivier Dony 1f022a0b4a [MERGE] Forward-port 8.0 up to rev. 67a63e2cc9 2016-02-03 16:53:30 +01: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 709323f071 [MERGE] Forward-port saas-6 up to 6562309927 2016-02-03 00:46:18 +01:00
Olivier Dony 6562309927 [MERGE] Forward-port 8.0 up to e8d06f7b20 2016-02-03 00:44:04 +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
Christophe Simonis fbd5fab238 [MERGE] forward port of branch saas-6 up to 9ca7ad8 2016-02-02 13:18:33 +01:00
Christophe Simonis 9ca7ad87b2 [MERGE] forward port of branch 8.0 up to 3ac46ee 2016-02-02 12:25:06 +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
Christophe Matthieu d1abc952cc [FIX] tools: XMLTranslator doen't use self.parser arguments to create new instance of XMLTranslator
issue: When a translation contain valid hmtl but invalid xml the content is escape (translate.py: line 218).
2016-01-28 14:57:21 +01:00
Raphael Collet 6872aae8ef [FIX] tools: do not crash on wrong translations in view
During the construction a xml/html_translate content, in case of a wrongly
translated part (e.g. not correctly escaped char or bad xml tag), escape the
translation.

The verification is done during the rendering on the view which is not the most
optimal solution but has the advantage of working on system with some broken
translations and does not requires to reload the translations.

In master version, the verification could be done when loading the .po files.
2016-01-25 15:10:16 +05:30
Martin Trigaux bb56e484b7 [FIX] all: construction of translations lookup
When evaluated, the translation function never finds a match if a variable is
integrated into the untranslated text.

SHAME! 🔔 🙋
2016-01-13 14:46:30 +01:00
Thibault Delavallée 929e060c07 [FIX][IMP] base: partner image
Do not compute the partner default image when being in testing or install mode.
For example when importing a huge list of contacts there is no need to compute
a default image for every contact.

Moreover the random colorize is more limited. There is no need to explore the
whole space of rgb. It is now limited by steps in the rgb random, leading to
less different images being possible. There are currently 512 possible
combinaisons.
2016-01-11 17:47:44 +01:00
Jeremy Kersten 774879a69c [ADD] tools: add escape_psql function
By default, Odoo support _ and % in domain to search like in pgsql.
But if you want to search something starting by _ or containing %
the developper need to escape these character.
2016-01-08 19:14:31 +01:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Martin Trigaux 955ed51687 [MERGE] Forwardport of branch 8.0 up to 6efc3712 2015-12-30 11:48:14 +01:00
Goffin Simon f7dab86a06 [FIX] tools: colon in a URL
When writing an URL in the chatter with a colon inside, the function
"html_keep_url" must detect all the URL.

opw:660116
2015-12-22 10:34:18 +01:00
Denis Ledoux aef8a4d618 [MERGE] forward port of branch 8.0 up to f9f7669 2015-12-21 18:24:22 +01:00
Raphael Collet 36ee1ad813 [FIX] yaml_import: add field_parent in context for evaluating onchange on one2many lines 2015-12-18 16:51:52 +01:00
Raphael Collet f4a6f1bfde [FIX] yaml_import: use form views instead of tree views for cleaning up 2many field values 2015-12-18 16:51:52 +01:00
Raphael Collet 0b6058c585 [IMP] yaml_import: evaluate onchange on defaults first 2015-12-18 16:51:52 +01:00
Raphael Collet b96759ca07 [FIX] yaml_import: make post_process filter out readonly fields recursively 2015-12-18 16:51:51 +01:00
Raphael Collet d412203f4a [FIX] yaml_import: make process_vals sanitize field values recursively 2015-12-18 16:51:51 +01:00
Raphael Collet 3cd85bdeef [IMP] yaml_import: introduce and clean up helper functions 2015-12-18 16:51:51 +01:00