Commit Graph
54 Commits
Author SHA1 Message Date
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
std-odoo 24cf7bdc35 [FIX] mail_plugin: use the user language in context
Bug
===
When searching for projects from the Outlook / Gmail addins, the names
were not translated into the user's language.

Task-3486324

closes odoo/odoo#136645

X-original-commit: 7ebe04189c84381e133ad3d0d6f8b97832b28a14
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-28 01:51:23 +00:00
std-odoo 925daad7f3 [IMP] mail_plugin: do not allow portal user to use the addin
Purpose
=======
Show an error during the login process if a portal
user tries to use the Outlook / Gmail addin.

Task-3344536

closes odoo/odoo#134450

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-13 08:20:33 +00:00
std-odoo 3ec29a8e42 [FIX] mail_plugin: fix access error when enriching some partners
Bug
===
When we enrich a partner we don't have access to, it will try to read
it, but because of the ACL if will crash. To fix that issue, we don't
return the partner if we can't access it and we show an error message
in the UI instead of letting it crash.

Task-3344536

closes odoo/odoo#135025

X-original-commit: a3dcae1eebe7920ae788d5ff6d12c45e19a9628d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-11 15:22:15 +00:00
Thibault Delavallée 881c5ba5b4 [IMP] mail: simplify usage of '_parse_partner_name'
As it already normalizes returned emails some manual calls to 'email_normalize'
are not necessary. Some variable names are updated to be clearer about the
email being normalized.

Parsing contact name and email is also moved into a tool function to avoid
using a partner environment just for a tool parsing method.

Task-2612945 (Mail: Defensive email formatting)

X-original-commit: odoo/odoo@f7add44c28
Part-of: odoo/odoo#134934
2023-09-11 15:22:09 +00:00
std-odoo b3d2004bfc [FIX] mail_plugin: emails are escaped when we log them on the records
Bug
===
Since 69f911d994 , the body needs to be a
Markup object if we don't want to escape it. So, when we log an email
from the mail plugin, because we just log the string, it gets escaped.

Task-3387100

closes odoo/odoo#128984

X-original-commit: ef068b3b0d7df9f2e064889c62623b34f31e156b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-19 19:37:55 +02:00
Martin Trigaux c68fa610d4 [FIX] *: correctly search record without user
If a user is not present in the request, he is in no group at all and
can not access any model, including the one available for public
users.
Avoid ambiguity by using sudo or add a user specifically.

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Jairo Llopis aaf7eb1660 [FIX] mail_client_extension/mail_plugin: let users allow mail plugin to work
This commit fixes a regression introduced in https://github.com/odoo/odoo/pull/104323.

That fix was preventing the default behavior of the 1st `.oe_login_form button[type=submit]` found.

It turns out that, for allowing the mail plugin to work, you actually need to have the default behavior of that element working normally.

Without this patch, the `&do=1` query is never added to the POST parameters. Thus, the user is unable to authorize their mail plugin.

@moduon MT-2552 MT-2553 OPW-3230686

closes odoo/odoo#115733

X-original-commit: d350b084317057d62a018a86f57a0a26b454100f
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-20 07:58:46 +01:00
Thibault Delavallée 4775bd93a2 [REF] mail: cleanup post with {view, template} wrappers
RATIONALE

Purpose of this commit is to cleanup main post helpers and have a more easy
and understandable way of calling them.

SUMMARY

We now have two main API methods, based on business flow: either posting
on documents, either sending a mass mailing. Indeed those two flows are
different

  * post: create message, then launch notification process by taking into
    account subtype, followers, ...
  * mail: create mails in batch with recipients being based on template or
    given partners. No notifications is involved, only maybe traces if a
    mass mailing is linked

Delegate QWeb rendering to the render mixin (i.e. _render_template_qweb_view)
in order to have a single point to forge evaluation context and re-use
existing rendering code.

SPECIFICATIONS

Main API helpers are now

  * ``message_post_with_source``: (batch) post on records, using an ir.ui.view
    (given a record or its xml id) or a mail.template record (given a record or
    its xml id). When using a template, a composer is called to post on each
    record (as batch post is not yet supported). When using a view, a direct
    call to message_post using the rendered bodies is done, one record at a
    time.
  * ``message_mail_with_source``: send a mass mailing on records, acting like
    invoking the mail composer in mass mode. Same arguments are valid, either
    a reference to a view, either a reference to a mail template.

Other helpers are

  * ``_message_log_with_view``: (batch) log on records, using an ir.ui.view
    to render the body using QWeb (no notification process);
  * ``_message_log(_batch)``: (batch) log on records (no notification process);
  * ``message_notify``: notify partners on records (creating notifications
    specifically for some people while message itself is not displayed in
    chatter);

Code migration

  * ``message_post_with_template`` in "mass mode": use ``message_mail_with_source``
    and set the template record as source;
  * ``message_post_with_template`` in "comment" mode: use ``message_post_with_source``
    and set the template record as source;
  * ``message_post_with_view``: its main usage was to post on a document, in which
    case it generally can be replaced by ``message_mail_with_source`` using
    the view reference as source;

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:34 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
std-odoo 6e7960314b [FIX] mail_plugin: do not enrich blacklisted domains
Bug
===
Currently, we try to enrich the domains even if they are in the
`_MAIL_DOMAIN_BLACKLIST`. IAP always return a "missing data" error
because it can't enrich "gmail.com", etc except for "odoo.com". In that
case the enrichment is successful, but because the domain is
blacklisted, we use the entire email to find the company (and so it
will create a company for each odoo.com email addresses).

The test that was removed was wrong. It works because we mocked the
enrichment response, but in practice it will always return a missing
data error.

Task-3050230

closes odoo/odoo#107235

X-original-commit: 37503108cd878412474b5486877a861dad2efc1d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 09:25:56 +01:00
Martin Trigaux 5150d003fd [I18N] *: export 16.0 source terms
closes odoo/odoo#101053

X-original-commit: 7d4c9d9736cc2ff0ee91dc17ea0f952c9a3dc65a
Related: odoo/enterprise#31752
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-24 15:00:56 +02:00
ef00294e71 [IMP] core: store translated fields as JSONB columns
Translated fields no longer use the model ir.translation.  Instead they store
all their values as JSON, and store them into JSONB columns in the model's
table.  The field's column value is either NULL or a JSON dict mapping language
codes to text (the field's value in the corresponding language), and must
contain an entry for key 'en_US' (as it is used as a fallback for all other
languages).  Empty text is allowed in translation values, but not NULL.

Here are examples for a field with translate=True:

    NULL
    {"en_US": "Foo"}
    {"en_US": "Foo", "fr_FR": "Bar", "nl_NL": "Baz"}
    {"en_US": "Foo", "fr_FR": "", "nl_NL": "Baz"}

Like before, writing False to the field makes it NULL, i.e., False in all
languages.  However, writing "" to the field makes its value empty in the
current language, but does not discard the values in the other languages.

Here are examples for a field with translate=xml_translate:

    NULL
    {"en_US": "<div>Foo<p>Bar</p></div>", "fr_FR": "<div>Fou<p>Barre</p></div>"}

Change for callable(translate) fields: one can now write any value in any
language on such a field.  The new value will be adapted in all languages, based
on the mapping of terms between languages in the old values.  Basically the
structure of the value must remain the same in all languages, like before.

Reading a translated field is now both simpler and faster than the former
implementation.  We fetch the value of the field in the current language by
coalescing its value with the 'en_US' value of the field:

    SELECT id, COALESCE(name->>'fr_FR', name->>'en_US') AS name ...

The raw cache of the field contains either None or a dict which is conceptually
a subset of the JSON value in database (except for missing languages).  For the
sake of simplicity, most cache operations deal with the dict and return the text
value in the current language.

Trigram indexes have been adapted to the new storing strategy, and should enable
to search in any language.  Before this change, only the source value of the
field ('en_US') could be indexed.

Computed stored translated fields are not supported by the framework, because of
the complexity of the computation itself: the field would need to be computed in
all active languages.  We chose to not provide any hook to compute a field in
all languages at once, and the framework always invokes a compute method once to
recompute it.

Code translations are no longer stored into the database.  They become static,
and are extracted from the PO files when needed.  The worker simply uses a cache
with extracted code translations for performance.  This is reasonable, since
fr_FR code translations for all modules takes around 2MB of memory, and the
cache can be shared among all registries in the worker.  Changing code
translations requires to update the corresponding PO file and reloading the
worker(s).

Performance summary:
 (+) reading 'model' translated fields is faster
 (+) reading 'model_terms' translated fields is much faster (no need to inject
     translations into the source value)
 (+) searching translated fields with operator 'ilike' is much faster when the
     field is indexed with 'trigram'
 (+) updating translated fields requires less ORM flushing
 (-) importing translations from PO files is 2x slower

Some extra fixes:
 - make field 'name' of ir.actions.actions translated; because of the PG
   inheritance, this is necessary to make the column definition consistent in
   all models that inherit from ir.actions.actions.
 - add some backend API for the web/website client for editing translations
 - move methods get_field_string() to model ir.model.fields
 - move _load_module_terms to model ir.module.module
 - adapt tests in test_impex, test_new_api
 - because env.lang is injected into SQL queries, its returned value is
   now guaranteed to correspond to a valid active language or None
 - remove wizard to insert missing translations (no longer makes sense)

task-id: 2081307

Co-authored-by: Fabien Pinckaers <fp@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2022-09-15 22:37:50 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
std-odoo cf91caa284 [FIX] mail_plugin: always ensure that the returned partner has a name
Task-2826471

closes odoo/odoo#93058

X-original-commit: da26bb66f7c8c65beb7d326a6aaf565da8713a0d
Related: odoo/enterprise#28118
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 12:27:08 +02:00
std-odoo 81d7b17c5c [IMP] mail_plugin: hide the create button if we do not have access right
Purpose
=======
Hide the "Create Partner" button if we do not have the "create" access
right.

Do not offer to create a project if the current user can't.

Do not try to enrich if we can't create a partner.

The write access on the partner is checked on the record itself because
of access rules.

Task-2826471

X-original-commit: b678a9bc1298e9a1973074740a8c8a1d471b6848
Part-of: odoo/odoo#93058
2022-06-08 12:27:08 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00
Fabio Barbero fc79bd1e0e [IMP] sm modules: "neutralise" genders
Purpose
=======
Change all masculine nouns in Odoo's code to neutral nouns (when
possible), making sure that demo data is correctly handled. This is
particularly important since our code is open source, and nowadays lots
of machine learning models are trained on open source repositories.

With this small change we contribute to training more "fair" models, and
teaching models that "employee" or "user" != "he".

This also affects some text visible by the user, hence making it more
inclusive for Odoo users.

Task-2853046

closes odoo/odoo#91292

Related: odoo/enterprise#27302
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-16 10:09:32 +02:00
Victor Feyens 42bad1a6d2 [IMP] *: remove useless keys from manifests
Remove most values uselessly specified because giving the same value as 
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)

* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default

This will reduce noise/inconsistencies between manifests specifications, 
simplify analysis of manifests content, ...

closes odoo/odoo#90209

Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-03 13:31:16 +02:00
std-odoo c967cda61f [IMP] mail_plugin: when searching a non-full email no result are returned
Task-2601837

X-original-commit: 2c2e927ad3c07a9a8acdda06ff379dfc7ce07722
Part-of: odoo/odoo#89848
2022-04-27 15:31:48 +02:00
std-odoo af82dc2a9a [IMP] mail_plugin: never let the company section empty
Purpose
=======
When you do not have IAP credit, if the partner and the company
do not exist in the Odoo database, you have an empty section.

Now, a message tell you that you need to save the partner to
generate the company (so the section is not empty anymore).

Add the translation for this text.

Task-2601837

X-original-commit: 2951b41ba639fbe6e1bec9ef53ca300369ad5a74
Part-of: odoo/odoo#89848
2022-04-27 15:31:48 +02:00
std-odoo 742e9a24d1 [FIX] mail_plugin: fix error in the console when logged with the addin
Bug
===
When we log in with the addin, it will fetch the route `/mail_plugin/auth/access_token`
to know if the module is installed. Because we give no `auth_code` an
error is displayed in the console.

Task-2601837

X-original-commit: 26944c09de32512a8072e00ac73a90c633eecb6c
Part-of: odoo/odoo#89848
2022-04-27 15:31:48 +02:00
std-odoo a69366ef03 [FIX] mail_plugin: fix traceback when the partner has been removed
Bug
===
1. Open an email in Outlook, and create the contact
2. Go to Odoo and remove the partner
3. Without refreshing the browser tab, click on the "reload" icon of
   the addin. A traceback will be raised on the Odoo side

Task-2601837

X-original-commit: bb2e5ce9cf149a5cfd68cf908184c823f882d97d
Part-of: odoo/odoo#89848
2022-04-27 15:31:48 +02:00
std-odoo 9323cee2f2 [IMP] mail_plugin: improve error message when the email is not valid
Purpose
=======
Improve the error message when the email
of the contact / company is not valid.

Task-2601837

closes odoo/odoo#86080

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-27 11:06:14 +02:00
std-odoo 598fe1c45b [FIX] mail_plugin: allow to re-use the mock method
Purpose
=======
Allow to re-use the method `mock_auth_method` used to mock the Outlook
authentication, to be able to write tests in other sub-modules.

Task-2782150

X-original-commit: 6932f05bfc4b2beabaf7c6390f1d241fff73bd38
Part-of: odoo/odoo#89260
2022-04-21 13:55:08 +02:00
Joonas Hartonen 150f64af56 [FIX]mail_plugin: write method return added
* res.partner write method was missing return. This caused errors with XML RPC writes.

closes odoo/odoo#86396

X-original-commit: 0a6bcb709116be8c8149047a5a0c6fdf939eccc4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-14 18:16:16 +00:00
Julien Castiaux c0647b5c52 [REF] core: HTTPocalypse (14) changes all addons
This commit is the 14th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.

* `request.uid = x` => `request.update_env(user=x)`.
* `request.context = x` => `request.update_env(context=x)`.
* `request.context = dict(request.context, x=y)`
   => `request.update_context(x=y)`.
* `request.cr = None` => `request.cr.close()`.
* `http.mono_db()` => `request.db`.
* `http.dispatch_rpc()` => `service.dispatch_rpc()`.
* `@service.model.check` => `service.model.retrying()`.
* `request.endpoint`
   => `env['ir.http']._match(request.httprequest.path)[0].endpoint`.
* `request.routing_iteration `=> `removed`.
* `request.jsonrequest` => `request.dispatcher.jsonrequest`.

Note that `request.params` is now set much later in the process. If you
are in a situation where you values from the query string or the
http body you can use `request.get_http_params()`.

Note that using the new `request.future_response`, it is possible to
add headers and cookies on the response object before the response
object is initialized. Please note that headers/cookies saved on
the future response will NOT be injected in case of error.

PR: odoo#78857
Task: 2571224
2022-02-24 13:30:51 +00:00
Yannick TivisseandVictor Feyens 18952cdc76 [IMP] *: Convert single create method into multi
Taskid: 2703085
Part-of: odoo/odoo#80824
Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-12-14 19:13:18 +00:00
Julien Castiaux 8b6f438b7b [FIX] *mail_plugin: unused i18n path in manifest
*: mail_plugin, crm_mail_plugin, project_mail_plugin

The code that is discovering translatable strings is defined in
[translate.py]. It does lookup in all python files and in all javascript
files defined under 'static/src/'.

The top-level `web.assets_backend` directive in the manifest is useless
and have been removed.

[translate.py]: https://github.com/odoo/odoo/blob/8b468e1f7a3dfeb2bcfa83bff55c4b5adf6b2212/odoo/tools/translate.py#L1138-L1147

Part-of: odoo/odoo#79977
2021-12-14 12:39:54 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
std-odoo 8739c81867 [FIX] mail_plugin: fix missing translations
Purpose
=======
Fix missing translations on the Outlook / Gmail plugin and add them in
the mail plugin module.

Task-2612788

closes odoo/odoo#75599

X-original-commit: 47c9be8970011863e8e7b474665c823e751df085
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-30 10:58:57 +00:00
std-odoo 61d9cb8098 [IMP] mail_plugin: add translations for 404 error management
Purpose
=======

Currently the application will display a 404 error message, if the mail
plugin module is not installed or if the user made an error in the URL
of his Odoo database, which is confusing for end users.

So, we show an error message during the authentication process if the
database is not reachable and we should add the translations related to
those changes.

Task-2577531
See odoo/mail-client-extensions/pull/17

closes odoo/odoo#75637

X-original-commit: 3c00fddb99091b96259eed1e45ef9de53c53f795
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-26 12:46:55 +00:00
std-odoo 9d13bb4534 [FIX] mail_plugin: fix missing translations
Purpose
=======
Fix missing translations on the Outlook plugin and add them in the
mail plugin module.

Task-2612788

closes odoo/odoo#74399

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-29 12:27:45 +00:00
Stephane Debauche 347111c7b8 [FIX] mail_plugin: improve error management when enriching companies
Purpose
=======

If the partner was removed after the user open the email on the Gmail
side, return a clean error message instead of raising a traceback.

Add translations for the new strings in the plugin.

Links
=====

Task-2567566
Followup of odoo/odoo#73653
See odoo/mail-client-extensions#15

closes odoo/odoo#75076

X-original-commit: e782c85b95aed30dd38bd30c29e57a9acc540a49
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-13 13:38:42 +00:00
std-odoo 540f7b8cab [IMP] mail_plugin: shorten the error messages
Purpose
=======
Shorten the error message to make them appear on a single line.

Task-2518668
See odoo/mail-client-extensions/pull/12

closes odoo/odoo#71542

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-27 06:57:28 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
std-odoo 43052586cb [FIX] mail_plugin: fix a translation when the enrichment fail
Bug
===
One error message is not translated.

Task-2518668

closes odoo/odoo#73856

X-original-commit: cfeff76797f2f6bd390e41974f2f8255df81a738
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-16 11:30:03 +00:00
std-odoo 7d476512b8 [FIX] mail_plugin: fix an error during the authentication
Bug
===
Since 478068c829 we wanted to use the
Odoo redirection function everywhere.

But this function work only if we redirect the user to the same site.

The mail plugin need to redirect outside of Odoo and so we can not use
this function.

closes odoo/odoo#73698

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-14 11:54:40 +00:00
nounoubensebia ba048b0317 [IMP] mail_plugin: add enrich strings to translate
Enrich capability has been improved in 14.3 . This commit adds strings to
translate for plugins in 14.4 + .

Task-2563180
Odoo PR: odoo/odoo#71947
Outlook code: odoo/mail-client-extensions@d122177927

closes odoo/odoo#73687

X-original-commit: a9cc87a57b80b4f962b11de8e3e0b41248384273
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-14 10:35:30 +00:00
nounoubensebia 017ecb37f2 [IMP] mail_plugin: enable enrichment and update of an existing company
Add an enrich and update endpoint allowing the user to update an existing
company if the company has no insights, as this can bring valuable information
for the user especially if the company has no infos.

Task-2563180

closes odoo/odoo#73658

X-original-commit: 72c35667d3e6f99cb4cfdbd1c93b877cc9fef750
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-13 16:42:10 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
std-odoo 00f2840f0c [IMP] mail_plugin: add the translation for the attachment related message
Purpose
=======
In 14.3 we added the possibility to upload attachments when logging
an email. In the commit, we add the translation for the corresponding
error message.

Task 2545048
See odoo/odoo/pull/71543
See odoo/mail-client-extensions/pull/11

closes odoo/odoo#72530

X-original-commit: ba747ed81631cca549a380446cd8f05e711bdf76
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-22 12:00:24 +00:00
nounoubensebia aa02285b0a [FIX] [crm_]mail_plugin: fix multi_company access error
This commit fixes the multi_company access error when the user is attempting to
see a record belonging to another company then the one he is logged in to from
the plugins, upon login, it returns all the company ids related to the user so
that the plugin redirects the user to the record with all companies ticked.

Task-2541205

closes odoo/odoo#72529

Plugin-pr: https://github.com/odoo/mail-client-extensions/pull/10
X-original-commit: 92972fa16920e070e533040439243a0257357aad
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-22 11:52:30 +00:00
std-odoo a755ed2475 [IMP] mail_plugin: allow to upload attachments when logging an email
Purpose
=======
Allow to upload the attachments of the email when logging it on the
partner / lead / ticket.

Technical
=========
The attachments posted on this new endpoint are base 64 encoded and
added in the JSON data in a list (name, encoded content).

Links
=====
Task 2545048
See odoo/mail-client-extensions/pull/11

closes odoo/odoo#72515

X-original-commit: 71626ad727fd573fd98e595e0ae964ce0559e547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-22 09:30:28 +00:00
std-odoo d27fb9c952 [IMP] (crm_)mail_plugin: support translations for the Gmail addon
Purpose
=======
This commit allow the users to translate their Gmail Addon.

The language of the addon will be the language the user set on his
preference, on his Odoo database.

The translations will be downloaded from Odoo and stored in the cache,
so translator can use the existing system to translate the addon.

Task 2502261
See odoo/mail-client-extensions/pull/8
See odoo/odoo/pull/69288
See odoo/enterprise/pull/17711

closes odoo/odoo#69288

Related: odoo/enterprise#17711
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-31 07:26:31 +00:00
nounoubensebia 24d5c789f1 [IMP] mail_plugin, crm_mail_plugin: add translation support for email plugins
In mail_plugin module, add a method which returns translatable modules,
this method will be overridden in the other modules to add their module names.

Translations are prepared via the _prepare_translations method which uses
the get_translations_for_webclient method, this way we can easily fetch
translations without having to write python code.

We also add xml files in "static/", these files contain terms to be translated,
for each plugin we create a separate xml file so that we can easily update each
plugin separately.

This implementation will allow having translations handled by Odoo, which has
several advantages:
- existing system, nothing to develop
- it will use transifex and the terms will be translated by the community
- forces that mail_client implementations to have the same logic (consistency)
- compared to other solutions which rely on python code to return translations,
  this solution is more robust as it avoids having to type the string to
  translate twice

Task-2480075

closes odoo/odoo#69118

Ent-pr: https://github.com/odoo/enterprise/pull/17626
Plugin-pr: https://github.com/odoo/mail-client-extensions/pull/6
Related: odoo/enterprise#17626
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-26 12:51:57 +00:00