Commit Graph
47 Commits
Author SHA1 Message Date
Sébastien Theys 80d363cd31 [FIX] tools: expand user and vars for data_dir 2018-10-10 14:03:59 +02:00
zeroheure cda1bec3e0 [DOC] cmdline: proper default for limit-memory
The default values for --limit-memory-(soft|hard) had been changed in
Odoo v8.0, but this change wasn't reflected in the cmdline --help.

Closes #22315
2018-09-19 14:47:13 +02:00
Xavier ALT c5e1bffa3d [FIX] tools: formatLang should use cached lang 2018-08-13 11:18:00 +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
Nicolas Lempereur d595e3a258 [FIX] tools: mail transcoding css space consistent
The transcoding of a mail (transforming CSS into inline styles on the
element nodes of the mail) used the form:

 property:value;

So when a mail is saved, it would be eg. with `style="property:value;"`
and when it is being edited "property:value" is removed if available via
CSS stylesheet given the structure.

But the sanitize_style (introduced in bfe7aafa7) adds an espace before
the value (which is more pretty but was probably not choosen in
transcoding to decrease size of mail):

 property: value;

so the inline style would not be removed when editing possibly causing
conflict with the editor.

With this commit, the sanitize_style doesn't add a space. It could have
been changed in transcoding but the code is already rather slow and we
don't want to use a regex replace or two string replace instead of the
current one string replace.

opw-1841107
2018-05-08 16:46:23 +02:00
Christophe Matthieu b8006bfb1c [FIX] mail tools: html_sanitize must keep useful styles from mass mailing
Issue: The clean removes too many tags so emails sent do not resemble the
preview.

opw-1841138
opw-1841105
2018-05-07 15:34:40 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
Martin Trigaux 4fc0947850 [FIX] tools: do not escape \t
msgid ""
"You cannot set a negative product quantity in an inventory line:\n"
"\t%s - qty: %s"

Was creating a ir.translation record with a src as

You cannot set a negative product quantity in an inventory line:
t%s - qty: %s

('t' instead of \t)

Closes #23541
Fixes #23521
2018-03-08 13:47:12 +01:00
Christophe Simonis a6855b31c9 [MERGE] forward port branch 9.0 up to d4ec6b75ac 2018-03-01 13:25:10 +01:00
Nicolas Martinelli a9beee42d6 [FIX] tools: lang in formatLang
- Install French language
- Set language of Customer A to French
- Create an invoice due in the past
- Open the Customer Statements

The customer statement of A is translated in French, but the amounts are
formatted in the company's user language (English by default).

We add the possiblity to take into account the lang in the context when
calling `formatLang`.
2017-11-15 12:57:19 +01:00
Christophe Simonis cbca27d005 [MERGE] forward port branch 9.0 up to d5c0cae60b 2017-10-17 11:42:05 +02:00
Christophe Simonis 7d7e94c6ef [MERGE] forward port branch 9.0 up to 46e3e739c5 2017-09-11 11:37:46 +02:00
Adrien Peiffer (ACSONE) 0fff391c38 [FIX] tools: empty name
Check if name isn't empty before executing regex. xlsxwriter can handle
an empty name.

opw-769163
Closes #18877
2017-08-31 13:47:41 +02:00
Fabien Meghazi 2c0f6f39d7 [IMP] http: improve dumpstacks and remaining requests handling during tests (#18640)
This patch modifies Root#dispatch() in order to keep the httprequest url
in the current thread's attribute and use if for dumpstacks and the
phantomjs tests remaining requests handling.

Also added a counter in order to avoid looping forever when trying to join unclosed http requests
in phantomjs test suite after a phantomjs failure + added a log.warning in such a case so it's easier to troubleshoot runbot's ir.logging.
2017-08-03 10:50:18 +02:00
Christophe Simonis aef7748845 [MERGE] forward port branch saas-11 up to 96fa86779b 2017-07-07 14:07:47 +02:00
Christophe Monniez c1e154bee1 [FIX] tools: ensure xlsx worksheet names are valid
When xlsx is used, the worksheet name may be longer than 31 chars and
raise an exception.

This fix will troncate the name up to 31 chars and will remove invalid
chars.

Similar patch was already done at 0122c05eff for xlwt

xlsxwriter 0.9.8 has added a parameter worksheet_class=None so adding **kw to be
compatible with installs with the latest version (requirements.txt asks for
version 0.9.3)

Closes #18077
opw-751157
2017-07-07 09:44:09 +02:00
Olivier Dony 76cd8d2558 [FIX] tools: verify path before opening 2017-06-02 22:13:36 +02:00
Olivier Dony 5a15d97387 [FIX] tools.cache: fix stats dump with gevent
Gevent processes have pseudo-thread objects
that do no always have a `dbname`attribute.
This could crash the process upon receiving
a USR1 signal.
2017-05-05 17:02:45 +02:00
Olivier Dony 8fbbe04a50 [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 17:02:45 +02:00
Nicolas Martinelli 514bdcb0f1 [FIX] tools: unnecessary error logging
The limit of 64 characters on the XMLID has been removed a long time
ago. This error is therefore not necessary anymore.
2017-05-04 16:48:31 +02:00
Olivier Dony 3ace806d39 [FIX] config: correctly bootstrap data_dir
Complements the patch in 8235f03f56
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:57:40 +01:00
Olivier Dony 8235f03f56 [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:56:05 +01:00
Christophe Simonis 6804085b8c [MERGE] forward port branch saas-11 up to b9374d5c21 2017-01-23 13:56:18 +01:00
Nicolas Lempereur b51d21c5b8 [FIX] tools: nbsp+sanitize = write
lxml.html.clean module we are using to sanitize html takes either a
tree/element or string, and return us an element of the same type.

We are passing it an unicode string, and it gives us back an unicode
string and if it is possible convert entities to utf-8.

This lead to an issue in html inline fields containing an ` `
entity, the entity was converted by the sanitizer to its unicode
character (U+00A0).

Then, when the field value is loaded to be displayed, the internal
value contains U+00A0 characters, but when it is inserted in the page
the browser converts them to ` `. Hence in this instance, the
internal value is never equal to the displayed value and a write is
always triggered even without editing.

This commit simple modify the sanitizer so value saved in database
contain ` `.

closes #14569
opw-689274
2016-12-06 18:54:46 +01:00
Christophe Simonis 5dc1c57601 [MERGE] forward port branch saas-11 up to 7842498 2016-12-01 16:59:33 +01:00
Christophe Simonis 7d4ac39c4c [MERGE] forward port branch saas-12 up to d853d3c 2016-11-24 18:35:42 +01:00
Christophe Simonis 97debd09c0 [MERGE] forward port branch saas-12 up to 57774ef 2016-10-28 17:05:21 +02:00
Christophe Simonis 3bb022d57c [MERGE] forward port branch saas-12 up to 6f8e40c 2016-10-27 18:17:59 +02:00
Simon Lejeune e018fd8b2b [REF] config: 'ODOO_RC' environment variable
Look for an environment variable named 'ODOO_RC' to locate an rc file,
similar to the 'OPENERP_SERVER' one.
2016-10-14 18:02:30 +02:00
Christophe Simonis 0acd63d073 [MERGE] forward port branch saas-12 up to 27dc061 2016-10-12 17:03:55 +02:00
Christophe Simonis f3532a6da6 [MERGE] forward port branch saas-12 up to 54ebe31 2016-10-11 19:07:42 +02:00
Christophe Simonis 341bea8f88 [MERGE] forward port branch saas-12 up to 43cb4ac 2016-10-10 13:00:05 +02:00
=?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= 389c2ba97b [REF] packaging: make odoo a namespaced package
by auto-extending addons path with odoo.addons.__path__.

This patch also introduce
  * an explicit declaration of odoo.addons as a namespace package
    This is necessary because the standard way of declaring namespace
    packages in setup.py does not work as long as odoo/__init__.py
    contains code.
  * a more reliable way to find odoo root path.
2016-09-30 12:05:49 +02:00
Simon Lejeune 630b4b1d55 [REF] cli: renamed .rc configuration file
A fallback for .openerp_serverrc has been implemented. If both
are present, Odoo will crash and report.
2016-09-30 12:05:49 +02:00
Simon Lejeune c59eb4ffc1 [REF] packaging: renamed configuration files
no fallbacks were implemented to `openerp-server.conf`.
2016-09-30 12:05:49 +02:00
Simon Lejeune 2d5fc151a2 [REF] cli: rename odoo.py to setup_dev.py
and move it under the setup package. Since the rename of the
openerp directory into odoo, having a script named "odoo.py"
conflicts with a package named "odoo".
2016-09-30 12:05:49 +02:00
Christophe Simonis a7ba6cde9c [MERGE] forward port branch saas-12 up to 7134aff 2016-09-28 16:28:31 +02:00
Fabien Meghazi 4e546cdb0d [ADD] shell: add support for more REPLs in shell mode 2016-09-19 16:35:10 +02:00
Raphael Collet fa082019a0 [IMP] models: change API of _group_by_full
The dictionary `_group_by_full` is replaced by a field parameter `group_expand`
that is assigned to the method name.  The API of the method has been simplified
as well:

    @api.multi
    def _read_group_stage_ids(self, domain, read_group_order=None, access_rights_uid=None):
        # the stages are given by self.ids (wrong model);
        # read_group_order is the order given to read_group() on self;
        # return stages.name_get(), {stage.id: stage.fold)

    _group_by_full = {'stage_id': _read_group_stage_ids}

is now written:

    stage_id = fields.Many2one(..., group_expand='_read_group_stage_ids')

    @api.model
    def _read_group_stage_ids(self, stages, domain, order):
        # stages is a recordset;
        # order is the order to use on stages' model;
        # return a recordset which is a superset of stages
2016-09-16 17:35:24 +02:00
Christophe Simonis f4fc3985b6 [MERGE] forward port branch saas-12 up to 10cde43 2016-09-16 11:03:50 +02:00
Raphael Collet cdd03c3afe [FIX] in all python code, rename openerp to odoo 2016-09-07 14:45:08 +02:00
Raphael Collet 9374892bb9 [IMP] tools: make OrderedSet implement the full set API 2016-09-06 12:23:06 +02:00
Olivier Dony 6ea36beec5 [FIX] models: preserve order when merging recordsets
RecordSets were not preserving order when combined
with AND/OR set operators. Order was lost as well
through mapped().

This caused various recurring "heisenbugs" during
tests executions on runbot, specifically comming
in the test of stock_landed_costs.

Using OrderedSets instead of basic Sets to resolve
these operation avoids the indetermination.

This required an implementation of __or__ / __and__
for OrderedSet.
2016-09-05 12:17:04 +02:00
Olivier Dony 4339196e52 [IMP] support v10 manifest file naming convention
- As of v10, manifest files should be named `__manifest__.py`
- For backwards-compatibility, __openerp__.py manifest files
  will still be supported for the time being
- Limited refactoring, to add support for the 2 different
  naming conventions
- All textual references to __openerp_.py updated in
  documentation and examples
2016-09-05 11:57:50 +02:00
Christophe Simonis 1a77d9d02a [MERGE] forward port branch saas-12 up to 476cb5a0 2016-09-03 23:57:57 +02:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00