Commit Graph
99 Commits
Author SHA1 Message Date
std-odoo 1c7c837a10 [FIX] mass_mailing: improve opened traces tracking
Purpose of this commit is to improve tracking of opened traces. Notably
a token is added to ensure we do not mess with traces and have unique
tracking URLs.

MIGRATION REMARK

Emails sent before the migration will not be marked as opened anymore after
migration. We recommend to avoid sending statistically important mass mailings
about one week before migrating database. Indeed statistics show that most of
open emails happen within the first week after being sent.

Task 2223146

closes odoo/odoo#49139

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-18 08:30:59 +00:00
Jeremy KerstenandRomain Derie 9247c5e8fd [IMP] tools: avoid useless query on res.users
Without this commit, if `lang_code` or `env.context.get('lang')` was set, we
would still access `env.user.company_id.partner_id.lang` to fill the loop array
even if we break and don't need that value.

Switching from loop to if conditions prevents that.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Xavier Morel 1ecb0641ef [FIX] core: calling read_group / name_search over xmlrpc
Also non-browser jsonrpc (as it goes through a similar process): for
internal performance reasons, name_search and read_group have been
converted to a *lazy* name_get, so the "display name" is not
unnecessarily computed.

However this is an issue for the RPC endpoints (/xmlrpc and /jsonrpc)
as they have no support for `lazy` and thus tend to blow up and / or
do the wrong thing when trying to output a lazy:

* xmlrpc has no way to handle lazy at all and straight blows up
* jsonrpc falls back to `json_default` so they try to stringify the
  lazy, which might have worked except

*Problematically* both endpoints delegate the actual work to
`dispatch_rpc` which handles dispatching between various services and
ultimately creates a *new* cursor before calling model
methods (`object` service and `execute`/`execute_kw`).

This means by the time the result is serialized to be output, the
lazy's cursor has long been closed, and thus any access to an
unevaluated `lazy` errors out when trying to fetch the underlying
item.

This also means we can't just add a hook to serialize the lazy
in the xmlrpc marshaller, though we do have to do that. We *also* (for
both xmlrpc and jsonrpc) have to force evluation of lazy values before
our cursor is closed, meaning it has to be done right after the method
is invoked, iterating the entire response.

Related to task 2170343

closes odoo/odoo#49286

X-original-commit: e2b5a359c1d5eccbe725c1c3169b4130d7bca49b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-09 09:06:34 +00:00
Xavier Morel fe376d50d0 [FIX] core, base: leftover deprecation warnings
* from collections import <ABC> is deprecated, unclear why the
  deprecation warning didn't appear before (possibly only appears in
  3.7/3.8?) either way `collections.abc` should be 3.3+ so switch
  everything to it.
* add some more ignores on third-party packages deprecation
  warnings (meh)
* while at it, mitigate generation of non-breaking space on some
  versions of Babel (in the french locale used by our tests anyway)

closes odoo/odoo#47581

Related: odoo/enterprise#9214
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-03-19 09:32:21 +00:00
Romain Derie 96d3fa4e01 [IMP] base, website: add ir.ui.view action to compare arch (wizard)
This commit adds the possibility to compare a view arch to another one.
The result will be shown in a diff viewer (github like).

This is following what was done at #32009

task-2190072

closes odoo/odoo#44646

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-17 15:58:45 +00:00
Raphael Collet 058cf208a8 [ADD] sql_db: pre/post-commit/rollback hooks 2020-02-05 13:50:23 +00:00
Christophe Monniez 29f02a37f0 [FIX] requirements: update library versions to match Debian Buster
Some library versions are outdated since the release of Debian Buster.

With this commit the required libraries versions will match as close as
possible the versions available in the current Debian stable release
(Buster).

Also, the requirements were tested against a Windows Python 3.7 to
ensure that a "pip install -r" can be used without the need of a CPP
compiler.

As Babel format_time now returns 'HNE' (Heure Normale de l'EST) for Fr
locale instead of the zone offset, the test is adapted.

Finally the babel.dates is explicitely imported, otherwise the proper
import of this submodule is relying on a side effect.

closes odoo/odoo#43106

X-original-commit: 32e455bf72980e6330871aa9cd99c26c6e1225d7
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-01-10 09:55:58 +00:00
fw-bot 493f26bef9 [FIX] base: value_to_html doens't keep the minus sign for times between 0 and 1
- Install timesheets and studio.
- In timesheets add a time of -0.5 (minus half an hour).
- Enter studio
- Switch to the Reports tab, and click Timesheet Entries.

Before this commit:

The time is displayed as 00:30.

After this commit:

The time is displayed as -00:30.

closes odoo/odoo#38542

Opw: 2036188
X-original-commit: b12374a266d4b5f2783d84e3a65b1c273e343a81
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-11 19:06:56 +00:00
wan 63de98b9b4 [FIX] *: remove en_US as fallback for lang code
en_US may not be activated as it is possible to create a database in
another language using the database manager.

When trying to install a chart of account, the tax return entry tried
to format a date at the installation of the module, with no lang in
the context. The fallback was made on en_US but an error is raised if
that language is not activated.

As it is a very common scenario to retrieve a language from the
context, add a generic tool method to do it.

Replace and closes odoo/odoo#37629

closes odoo/odoo#37568

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-01 10:05:17 +00:00
Aurélien Warnon 095e373501 [IMP] tools: add support for 'add_direction' parameter on '_format_time_ago'
This commit adds support for the parameter 'add_direction' on the '_format_time_ago' method
from tools.
This will allow formatting to '25 minutes' instead of '25 minutes ago'.

Preparation commit for the social 'feedback' task.

Task#2075858
2019-09-25 11:17:26 +00:00
Christophe Simonis d67b2483e5 [MERGE] forward port branch saas-12.4 up to 9ed4872ea0
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 17:45:37 +00:00
Christophe Simonis ac4fc6e7c7 [MERGE] forward port branch saas-12.3 up to bd3e510edb
closes odoo/odoo#37314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 09:44:56 +00:00
Denis Vermylen bd3e510edb [IMP] odoo: dump stacktrace of timed out threaded workers
So the logs contain some indication as to what was exceeding the limits.

closes odoo/odoo#37303

X-original-commit: 0a266f444a0abda026d09ad88024dca1c50c92b9
Signed-off-by: Denis Vermylen <Icallhimtest@users.noreply.github.com>
2019-09-23 14:16:04 +00:00
Julien Castiaux 7c47eb1854 [IMP] module.py: deprecate openerp
[PEP-594] is deprecating the `imp` module, that module is used in
`module.py` in order to dynamically import addons using any of the
`odoo.addons` or `openerp.addons` import anchor.

We are deprecating `openerp` module/addons imports in v13 in order to
remove the support in v14 and greatly simplify how modules/addons are
loaded. If you are still using the old `import openerp` or `import
openerp.addons`, `import odoo` and `import odoo.addons` are drop-in
replacements.

The `odoo.modules.module.ad_paths` addon paths list has been deprecated
too. The list is now accessible on `odoo.addons.__path__` where they
are now directly loaded [2].

See also:

[PEP-594]: https://python.org/dev/peps/pep-0594/
[2]: https://packaging.python.org/guides/packaging-namespace-packages/

closes odoo/odoo#36597

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-16 09:31:38 +00:00
jem-odoo 1b24f60a5c [FIX] tools: format_datetime with inactive lang
When selecting the lang browse record, it can be empty when language is not
activated. As we don't need that lang to be active to translate the
format datetime (lang code is enough for Bable lib), we simply
need to fallback to prevent error.
2019-09-05 20:11:18 +00:00
william-andre d201a39357 [IMP] account: rework the reconciliation widget
Task 36284
Change the visual aspect of the reconciliation widget:
* Use a tab system to change modes
* Matching for receivable/payable (and liability)
* Matching for types not above
* Create a new line
* Batch Payment
* Sale Order
* Add a keyboard navigation
* Improve the search bar and use a real search view to do so
* Remove the constraint that prevent to select a line already selected
on another statement. Instead remove it when a reconciliation is
validated
* The lines already proposed are proposed last on other statement
lines
* Put the lines with exact amount matching first in the propositions
* Improve when Rainbowman shows
* Change the order of the propositions: older show first
* Remove the title on top of the view (and the ability to edit it)
* Fix some breadcrumb issues
* Also add lines from receivable/payable without partners in the manual
reconciliation widget.
* Propose things to do if there are no lines found in the manual
reconconciliation

closes odoo/odoo#32631

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-27 11:26:50 +00:00
David Beguin c5500e685a [FIX] tools : use babel to format timedelta
Babel is already taking the language into account while
formating a time delta into a readable string like '2 minutes ago'.

_format_time_ago was put in translate.py file to be able to use
the _ translate class. But it can be placed in misc like other
format function already using babel.

This fix the PR #34624
and is linked to Task ID : 2028059

Task ID: 2055847
Closes PR #35806

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-20 08:02:46 +00:00
Raphael Collet 4cd093a001 [IMP] fields: extend selection with a given order
When extended with the selection_add parameter, a singleton (value,)
where `value` appears in the overriden selection, can be used.
The new values are inserted in an order that is consistent with the
overridden selection and this list.

selection = [('a', 'A'), ('b', 'B')]
selection_add = [('c', 'C'), ('b',)]
> result = [('a', 'A'), ('c', 'C'), ('b', 'B')]
2019-08-21 13:47:17 +00:00
David Beguin 6bec0e4d29 [IMP] website : add website visitors activity tracking
This commit adds the website_visitor model that will be used
to track website visitor activity (page viewed, number of visits and
more general info about the visitor (country, lang, etc..)

This model will, in later commit, be used to send chat requests
and push notification from the operators (or backend users)
directly to the visitor.

- A website_visitor is created once the visitor is requesting
a website.page that is tracked.
- A website_visitor is considered as connected if his last tracked
website_page request is within the last 5 minutes.
- The number of visits for a website_visitor is incremented
if his last tracked website_page request was at least 8 hours ago.
- A website_visitor is only handled by the system. Users cannot
create, edit or delete a website_visitor.
- A unique website_visitor is created per website.
That means that the same real person can triggers multiple visitor
creation if visits multiple websites.
This is because, for livechat purpose on later commit, for example,
the chat request can be created on the correct livecaht channel
(linked to the correct website)
- The visitor is recognized via his cookie (visitor_id). So if the visitor
flush his cookies, a new visitor will be created the next time he will
request a tracked website_page.
- Link user's res.partner to website.visitor.
    If a website_visitor log in
    (a visitor that has visitor_id in his cookie),
    the website_visitor is linked to the res.partner.
    The website visitor name is than adapted to match the name of
    the first res.partner linked to the visitor.
    A visitor can have multiple partners as the same session
    can be used by multiple person (one PC for a team for example).

To keep a detailed history of the visitor page views,
we add a website.visitor.page model that makes the link
between visitor and website.page but that keeps the visit date.
So that we can see if a visitor went mulitple times
on the same page and when. It's usefull to see his last page views.

Task ID : 2028059
PR #34624
2019-08-19 06:33:37 +00:00
Toufik Ben Jaa e974e1aec8 [FIX] tools: always retrieve a langage on formatLang
- Since commit https://github.com/odoo/odoo/commit/f5cd483216af01001f44a41f7d48f042b9f56ff9
the method `_lang_get` doesn't fallback on a language if the asked language
isn't found.

This causes issues with `formatLang` that uses the language on the
context, which is the language set on the client browser (in most cases).

Meaning, if 'en_US' is the only installed language and a customer
has set his browser to `fr_FR`, when calling `formatLang` this will
crash since no language has been found and `format` on `res.lang`
requires a singleton.

closes odoo/odoo#35633

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-08-12 12:51:29 +00:00
Christophe Simonis 039e6bae99 [MERGE] forward port branch 12.0 up to 9c742d0c65 2019-07-05 11:13:53 +02:00
Romain Derie 6ebcb1db80 [IMP] tool, website, website_sale: move test utils functions
We have multiple ways of simulating a frontend context while running python
tests (mainly during TransactionCase):
  - `MockObject` class from 8557bcfa30
  - `simulate_frontend_context` method from a5a5a57e48
  - `DotDict` from f8efc9a957

This commit moves `MockObject` to misc to be reusable and adapt it to be
accessible by dot notation with `DotDict`.

Part of #34396
2019-06-26 17:08:09 +00:00
Jeremy Kersten 7a3046a38f [IMP] tools: add DotDict helper
This function allow a quck dot.notation access to dictionary attributes

We need to make it re-usable for a future enterprise commit
2019-06-05 05:56:33 +00:00
jem-odoo 01c279ced1 [IMP] tools: introduces format_time
In some module, we gonna need to display time part in name_get. So,
it is interesting to have a helper doing that for us. Time part label
depends on the language, format, and timezone.

This commit introduces this tool, based on `babel` lib like the
other helpers. Tests are provided.

Task-2024216
2019-07-04 08:16:08 +00:00
Martin Trigaux 93b370c1f1 [REN] formatLang: remove ununsed special case
The formatLang method used to accept a value that has a _field parameter
This was introduced in 2010, at 6b19c64976 and is no longer used
Removed it to make the decimal_precision migration easier
2019-07-03 11:15:48 +00:00
jem-odoo 2cbbc88dab [IMP] tools: introduces format_duration
As some formatting tools already exists, it is time for float_time
conversion to have its own. Purpose is to extract formatting logic
from the float_time qweb widget to tools, in order to reuse it
in mail.template (jinja).
We named it 'format_duration', to follow babel convention. This
can bring confusion with the duration qweb widget, but this widget
should be called 'timedelta', as it is more generic than this one.

Task-2025396

closes odoo/odoo#34417

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-28 06:51:17 +00:00
Thibault Delavallée ef7871826e [REF] mail: template: move formatting to tools
This commit moves formatting helpers method used in mail.template to tools. The goal
is to reuse them anywhere in odoo, and not only in mail templates. Thoses method are
used to format date, datetime, amount, ... according to user localization (currency,
language, pattern, ...).

This commit also improve the formatting methods of 'date' and 'datetime': we are now
taking the 'lang_code' into account. Indeed, as the implementation uses `babel` lib,
it is easy and usefull to add the language option, to display the given dates into a
particular language. This parameter is optional to keep compatiblity with existing
code.

Task-2025396

Code Courtesy of @tde-banana-odoo
2019-06-28 06:51:16 +00:00
Raphael Collet d0bb596f1d [IMP] fields: x2many fields of new records are new records
The value of an x2many field on a new record are new records, possibly
related to a real record, called its "origin".
2019-05-23 05:47:11 +00:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
Florent de Labarre 32eee7b6ec [IMP] tools: add Tb
Tera byte is now common.

closes odoo/odoo#33151

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 16:41:01 +00:00
Adrian Torres 758382b3a7 [REM] pycompat: remove python 2 shims and helpers
Odoo no longer supports python 2, thus some of these helpers can and
have been replaced by python 3 built-ins, therefore there is no need for
them to stay defined.

The removed helpers are:
    * izip, imap and ifilter
    * unichr, text_type
    * implements_to_string, implements_iterator
    * string_types, integer_types
    * to_native

The python 2 shims have also been removed, and only the python 3 helpers
have been kept, because they can still be usable (i.e. accepting
both bytes and str for functions that can only accept one of the two)

[REM] pyjsparser: remove PY3 shims

They're no longer necessary as Odoo doesn't officially support python 2
anymore.

closes odoo/odoo#28519
2018-11-29 09:28:17 +00:00
Adrian Torres 52f5528cfb [REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for
python 2 <-> python 3 interoperability for python 3 builtins, as python
2 is no longer officially supported by Odoo.

This includes:
    * calls to imap/izip/ifilter replaced by map/zip/filter
    * uses of text_type replaced by str
    * uses of unichr replaced by chr
    * calls to implements_to_string, implements_iterator removed
    * string_types and integer_types replaced by str, int respectively
    * calls to to_native replaced by calls to to_text

This is done in preparation to the removal of these deprecated helpers
in the following commit.
2018-11-29 09:28:17 +00: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
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
Xavier ALT c5e1bffa3d [FIX] tools: formatLang should use cached lang 2018-08-13 11:18:00 +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 4e76173a43 [MERGE] forward port branch 11.0 up to 219d2296d6 2018-07-23 16:03:25 +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
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 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
Raphael Collet f50c6b1f6c [FIX] tools: align API of groupby on the one of itertools.groupby
The function `stripped_sys_argv` was broken because of `itertools.groupby`
being hidden by the local `groupby`.  Aligning APIs makes the local one a valid
substitution for `itertools.groupby`.
2018-01-25 11:28:13 +01:00
Raphael Collet 6f30f0af9c [FIX] models: behavior with multiple inverse/compute mixed on same fields 2018-01-23 16:41:45 +01:00
Raphael Collet f1d60d2e52 [IMP] api: make the implementation of field protection more robust 2018-01-23 16:41:45 +01:00
Thibault Delavallée cdfe479e2e [MOV] mail: reorder a bit mail thread methods by category
As this class has grown a lot some methods have been put a bit anywhere
in the file. To prepare future improvements it is easier to regroup
them a bit.

remove_accent from mail_alias is also moved to tools in order to separate
tools from business or class specific code.
2018-01-11 11:52:37 +01:00