Commit Graph
5381 Commits
Author SHA1 Message Date
Cedric Prieels (cpr) c5048ebc6a [IMP] test_main_flows: improve test for project,timesheet
This commit improves the test to handle the changes made in the
project, sale_timesheet modules.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:14 +02:00
Thanh Dodeur ac99b09cdc [IMP] mail*: add audio and video conference with webRTC
*test_discuss_full,test_lint

This commit adds the audio and video conference feature to mail channels
and integrate it with the groupDM/guest features.

Adds new mp3 and ogg files (from task-2554674) for sound effects.

- Adds three new tables:
    * `mail.channel.rtc.session` to manage the peerToPeer interactions
      during rtc calls.
    * `mail.ice.server` to provide ICE servers necessary to establish
      peerToPeer connections with webRtc.
    * `res.users.settings.volumes` to hold the partner-to-partner volume
      settings, each partner can create one new setting per other
      partner to configure the volume coming from those partners during
      calls.

- changes res.config.settings:
    * Adds new fields for the Twilio credentials to use their STUN/TURN
      service.

- changes res.user.settings:
    * Adds 4 fields for the push to talk and voice activation.

- changes mail.channel:
    * Adds a new field `rtc_session_ids` that represents the active
      participants in a rtc call on that channel.

- changes mail.channel.partner:
    * Adds a new field `rtc_inviting_session_id` that represents the
      rtcSession of the user that is inviting that channelPartner to a
      call.

task-2366708

closes odoo/odoo#66611

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-04 06:23:56 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Raphael Collet 765ec7837c [REF] core: add methods flush() and clear() on cursor
This deprecates the ugly and inconvenient functions flush_env(),
clear_env(), and avoids explicit calls to precommit.run().

Part-of: odoo/odoo#75598
2021-09-03 15:45:46 +00:00
Stanislas Sobieski 1b82054554 [ADD] ir_cron: allow env variable to force cron_trigger db notification
closes odoo/odoo#75846

Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
2021-09-03 14:30:29 +00:00
Sébastien Geelen (sge) 607c5ea4e2 [FIX] web_editor: make editor smaller in contacts
Make the default height of the editor quite smaller in res.partner view.
To avoid "breaking" the design and prevent scrollbars

task-2586137

Part-of: odoo/odoo#75863
2021-09-03 08:11:56 +00:00
Benoit Socias c6ba756e4b [IMP] core, website: use fuzzy matching in web-based search
Before this commit searched terms were the ones entered by the end-user.

After this commit if the searched term is not found then the search is
performed on a resembling term.
The similarity is obtained from a Levenshtein distance combined with
ratios of common and different letters.
By default the dictionary against which the search term is matched is
based on the content of the search fields containing a word that starts
with the first letter of the search term.
If the `pg_trgm` Postgresql extension is installed the dictionary is
built from matches using the `<%%` operator (similar to the
`word_similarity` function).
Several approaches were benchmarked during development, those results
are available through the task record.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benjamin Vray ec005bae0e [IMP] website, tools: allow to translate hidden inputs
As the descriptions of the donation snippet will be in hidden inputs,
we added the possibility to translate these inputs in translate mode.

PR-63133

task-2398403

Part-of: odoo/odoo#63133
2021-09-03 02:03:14 +00:00
wan 8e120ba28a [IMP] base: filter ir.actions depending on debug mode
Actions were not taking care of filtering out debug actions.

part of task-2604155

Part-of: odoo/odoo#75819
2021-09-02 14:15:25 +00:00
Younn Olivier 06bded68b0 [FIX] tools: add JFIF format signature to guess_mimetype
Some JPEG images in JFIF format were not uploaded as their binary
signature were not recognized.

Part of https://github.com/odoo/odoo/pull/71143
task-2502208

Part-of: odoo/odoo#71143
2021-09-02 14:14:52 +00:00
Nikunj LadavaandMohammed Shekha 662ecf4e20 [IMP] base_import: improve import wizard preview
PURPOSE

Improve import wizard as followup of recent improvements.

SPECIFICATIONS

Preview lines

  - make the preview lines more visible
    - set font-weight: 500 on o_import_header_name
    - remove the text-muted class from the data preview line

  - allow the user to preview the first 5 non-empty values
    - when hovering on the data preview span, display a tooltip with the first
    5 non-empty values of the file column (with 'Preview' as the tooltip title)

  - In the 'when a value cannot be matched' dropdown:
    add a new 'skip record' option for the following field types: boolean,
    many2one, many2many, selection
    add a new 'set empty' for the following field types: many2one, many2many,
    selection hide this option if the field is required

When a value cannot be matched:
  the 'skip record' option will make sure that lines with an unmatched value
  will not be imported (i.e. skipped at import)
  the 'set empty' option will set the field value to False when the value
  cannot be matched

  - Restore colored background on alert boxes by removing some css rules

Task-2504343

closes odoo/odoo#73713

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-09-02 12:57:13 +00:00
Ivan Yelizariev f9f5f889e4 [FIX] fields: allow to define several m2m with same relation but domain
Partial of #67648

Part-of: odoo/odoo#72559
2021-09-02 12:57:08 +00:00
Wolfgang Taferner 018d4856db [FIX] models: log field names in api.onchange warning
Without this, the warning isn't very actionable.

closes odoo/odoo#75858

X-original-commit: afe7c9895914125fb31dbfde15903fa41e000948
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
2021-09-02 04:41:50 +00:00
Xavier-Do babf021812 [FIX] profiling: fix speedscope with empty ctx
Since de077243 the iter(False) will occur when trying to render a
speedscope output with `use_context=False` since the context given in
parameter of `stack_to_ids` won't be an iterable.

This simple fix avoid this by always giving an empty iterable
in this case.

closes odoo/odoo#75851

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-09-02 04:41:46 +00:00
std-odoo cc012a0864 [IMP] mail, various: add email templates management levels
Purpose
=======

Purpose of this commit is to add a new group for the mail template designer.
Goal is to make roles clearer: managers edit templates, users use them. This
commit allow some designers / managers to make email template and to let
others users use those email templates.

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

When this feature is enabled in the Settings page, a new group is required to
modify email templates in a composer like wizard or to make dynamic content.
This allows to separate managers editing / composing templates from standard
users that use them.

If the current does not have this group, the email body will be in readonly
mode if he selected an email template. That way we force him to use the email
template that the manager made.

Technical
=========

New Group
---------

Only users in this group will be able to create / write email template or
to write Jinja code in the mail composer (including other fields like subject
in mailing).

By default, all internal users have this group. Mass mailing users also have
this group as writing mailings is about the same management level as writing
templates.

Mail Composer Mixin
-------------------

In comment mode, the template is rendered and then saved on the body field
so non-"Mail Template Editor" users can load email templates.

But in mass mode, the body of the template is saved and then rendered and
many things change the body (HTML sanitizer, web editor move inline CSS
properties, add / remove spaces...). So in this case, we can not know if
the user changed the body or not. That is why we put the body field in
readonly mode so, it is not modified by the web editor.

Jinja code detection
--------------------

To detect dynamic Jinja content, we compile the template, and we browse the
AST. If we do not have a single "Template Data" node, we assume that the
template is dynamic.

When we detect the template as static, we do not render it. That way we
avoid unnecessary rendering.

Code cleaning
-------------

Move Jinja import into tools so that it is outside of mail framework code.

Task-2187263

closes odoo/odoo#75840

Related: odoo/enterprise#20547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-02 03:42:54 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
std-odoo 322ed33d42 [IMP] mail_group: improve the UI and misc improvements
Purpose
=======
This commit improves the UI of the mail group module (backend and portal
view), fix some bugs and clean the code.

Bug 1
=====
If a user click 2 times on a confirmation link, an error is raised.

Bug 2
=====
A bug about the website snippets has been fixed;
- Add the snippet to a group in which you are member
- Change the group of the snippet to a group in which you are not member
- The snippet still show "Unsubscribe"

Bug 3
=====
In the portal view, when messages are filtered by month, messages which
are created in the last day of the month appear also in the next month.

Specification
=============
UI
--
Show the Allow / Ban buttons whatever is the state of the message, so
the user can ban / whitelist a message even if there's no pending email.

When we receive an email, remove the "Mailing List" footer. This was a
big issue because when some users reply many times, the footer was
duplicated on each answer.

Improve the form view of the mail group:
- On non-moderated group, show all messages instead of only pending
  message
- Show the guidelines stuff on non-moderated groups

Improve the portal view
- show the attachments under every message (not only on opened message)
- improve the template to confirm the subscription of the user
- improve the portal view for mobile device
- do not show rejected messages, even for admin
- do not show the button "X replies" when the mode is not thread

Technical
---------
Split the route "/groups/subscription" into "/group/subscribe" and
"/group/unsubscribe"

Correctly quote the parent email for the emails sent by web version of
Outlook (with the HTML id "divRplyFwdMsg").

ACLs
----
Now only administrators or responsible / moderators can write / unlink
the group.

Fix an ACL issue on the group member where the responsible of a
non-moderated group could not access the members of the group.

Members with same email
-----------------------

Improve the behavior when multiple members have the same email address
(this situation is possible because there's no unique constraint on the
email field of the <res.partner> model.) We now return the most
appropriate member for the given email address and partner.

When unsubscribing by clicking on the confirmation link that we received
by email, remove all members with the same email address.

Links
=====
Task-2599676
See odoo/odoo/pull/73640

closes odoo/odoo#73640

Related: odoo/upgrade#2774
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-01 19:07:48 +00:00
William Henrotin d9f45ba694 [IMP] product,stock{_picking_batch}: product labels revamp
This commit removes the pdf and zpl reports for product templates and
variants. Instead, labels are printed via a new wizard allowing to
specify the label quantity, format and optional text.

There are a bunch of usual retail label sizes in pdf or zpl code

Task : 2501730

closes odoo/odoo#69690

Related: odoo/enterprise#20246
Related: odoo/upgrade#2542
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-01 15:01:48 +00:00
Samuel Degueldre e060539e77 [FIX] base: avoid crashing when removing empty list from bundle
Previously, having a remove directive in a bundle that didn't match any
file of that bundle's type would raise an error, saying that the path
we're attempting to remove could not be located in the current bundle.

This basically breaks the remove directive inside of xml/js-css hybrid
bundles, because getting the assets path in xml-mode will cause all
remove directives that only target css/js files to fail and vice versa.

This commit fixes that by only raising an error when there were files
that match the extensions currently enabled, and those files were not
found in the bundle.

closes odoo/odoo#75790

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-09-01 08:26:06 +00:00
Romain Derie 23c88405a9 [FIX] base: restore delivery and shipping image on contact in kanban
Since c53724ebc3, the contact image in contact kanban view for a shipping
or delivery contact type would be the regular placeholder instead of the truck
or money image.

Now, by using the new avatar system, we restore that behavior.

+ we also use that new avatar system to cleanup some code in the kanban in the
  form view (`child_ids` field in `Contacts & Addresses` tab). That part was
   working fine but wasn't using the new system and needed extra code.

closes odoo/odoo#75709

X-original-commit: a97cbdd033391af75628bed50accfef11c73687c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-31 08:47:14 +00:00
David Beguin 29db699e9b [IMP] auth_top, *: revamp Two-factor authentication flow
Purpose
=======

Review the UX of the 2-factor authentication flow in order to make it more clear
and easy to use.

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

This commit applies multiple rewording of instructions, button, etc. Tests have
been adapted accordingly.

It also adds an 'invite to use two-factor authentication' flow that will
send an email to the selected used to redirect them their account security
settings.
- If portal is not installed yet, the user is redirected to his account security
settings in backend.
- If portal is installed, the user is redirected to /my/profile if them are
portal user. Otherwise, the redirection is still done at backend side.

As the backend view of auth_totp wizard is used at frontend side, copyclipboard
widget has to be rebuilt at frontend side (click event, style etc..).

As API key section is now displayed only on debug mode, test urls have been
adapted accordingly.

Task-2487630

Part-of: odoo/odoo#71142
2021-08-30 21:05:12 +00:00
Xavier-Do de077243ef [IMP] profiling: enable nested Execution context
The initial behaviour of ExecutionContext was to
- add the context for the current level of the stack on enter
- remove the context at this same level on exit.

When two ExecutionContext are nested at the same stack level:
- the first one adds it's context;
- the second one overrides the current context;
- the second one removes it at the end;
- the first one fails to remove the context at the same level a second time.

    def call():
        with ExecutionContext(foo=1):
            with ExecutionContext(bar=2):
                execute()

In this case we could imagine to combine both Execution managers in one:

    def call():
        with ExecutionContext(foo=1, bar=2)
            execute()

But the semantics is different: ExecutionContext should add one level to
the stack, instead of two.  In the first example above, we expect two
additionnal levels:

    call
    foo=1
    bar=2
    execute

A simple solution would be to transform the value of the context at some
level to a list of dict, but this would make the copy more difficult.
The decision was taken to change the context storage strategy, going
from a dict where the keys are the level to a tuple of tuples where the
first element is the level.

    {3: {foo: 1}, 4: {bar: 2}} =>  ((3, {foo: 1}), (4, {bar: 2}))

The first benefit is to allow multiple contexts at the same level.  The
second one is that we don't need to copy the data structure, since
tuples are immutables and the dicts are coming from kwargs.  This means
that saving the context is faster, and the tuple is shared between
multiple samples.  This is interesting if we assume that we do more
samples than exec_context mutations.

closes odoo/odoo#75687

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-08-30 13:28:05 +00:00
Qiuyu (QHO) e8922db3da [IMP] mail: add default avatar for channels
- Channels
    * "hash tag" avatar with different backgroud colors
    * only private channels have lock thread icon
- DM groups
    * "users" avatar with different background colors
    * no thread icon

task-2584994

closes odoo/odoo#75653

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-27 20:53:44 +00:00
William Braeckman 91735098d3 [IMP] Base: resolve name when grouping by many2many
Grouping by many2many has been added with PR odoo/odoo#68958 (commit f4f570c3d6b403512d8523c74acd34d485f46af1)

However the display names are not resolved resulting in the grouping
displaying the actual id of the records.

This also breaks some features such as `read_groups` which expect the
group by data to contain a tuple (id, x) instead of just the id, this
commit adds name resolving on many2many group bys.

Task ID: 2398734

Part-of: odoo/odoo#74985
2021-08-26 16:24:59 +00:00
Romain Derie 5afd3b996b [REM] base: remove dead code
This code was no more called, as there is the same-ish condition a few lines
above:
```
if (tools.config['test_enable'] or tools.config['test_file']) ...:
```

Moreover, that code was wrong and was crashing if you remove the first if
condition to test that code, as the method is expected to return a tuple.
It would just raise a traceback
```
too many values to unpack (expected 2)
```

Part of #75377

Related: odoo/enterprise#20449
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-26 10:21:29 +00:00
Romain Derie 88b19cfa92 [FIX] base, mail: _render_qweb_pdf should return a bytes-like object
`result` might be a Markup object (eg during tests) or a bytes-like object.

Step to reproduce: click on "Send by Mail" on a SO -> Traceback

Step to reproduce (2):
- Install website_sale
- Add something to the cart
- Go through checkout and click on Pay Now
- Crash, 500 error page, as this step is trying to generate the SO PDF to send
  by mail to the customer, which tries to encode a bytes-like object.

```
AttributeError: 'bytes' object has no attribute 'encode'
```

But if you do that flow during a test, eg
```
./odoo-bin -d mydb --test-tags=.test_02_admin_checkout
```
You have a Markup object, thus you had to encode it.

Now, even during test, we return a bytes-like object.

Related to #68299

Community: https://github.com/odoo/odoo/pull/75377
Enterprise: https://github.com/odoo/enterprise/pull/20449
Part-of: odoo/odoo#75377
2021-08-26 10:21:28 +00:00
Jeremy Kersten e9a33a436f [ADD] (website_sale_)delivery_mondialrelay: allow to use MondialRelay
This commit let you choose a Point Relais® as your shipping address.
It instantiates the Widget only.
It will not handle the print label.

Part-of: odoo/odoo#75281
2021-08-26 10:21:16 +00:00
Xavier-Do bd851a24ca [FIX] base: add missing nodeattr in ormcache keys
No real bug was found regarding this issue but it looks
like `nodeAttrs and nodeAttrs.get("media")` was missing from
`ormcache_context` since it is used to generate the output.

closes odoo/odoo#75248

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-08-26 10:21:11 +00:00
Xavier-Do fdaee845d5 [FIX] base: remove options parameters
Regarding previous commit, the option parameter can be removed
from _get_asset_content api, followed by a nice snowball effect.

Part-of: odoo/odoo#75248
2021-08-26 10:21:10 +00:00
Xavier-Do 2921f60055 [IMP] base: remove dead code
options are not used anymore since 8cc066173d

This was discovered by @d-fence

Part-of: odoo/odoo#75248
2021-08-26 10:21:10 +00:00
Rémy Voet (ryv) 0e3dcf091c [IMP] base: add warning if Chrome not installed
For test tours.
2021-08-24 14:13:33 +00:00
Xavier-Do 157651f7b0 [FIX] profiling: add profile entry manually before calling libsass
This commit proposes a mechanism to manually add a frame before a
blocking c-call and triggers it before calling libsaas.compile.

closes odoo/odoo#75519

X-original-commit: f836ff3a67d446cd8b3ab2cf573fab649153e6da
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-08-24 12:31:44 +00:00
Xavier-Do f4d0c72816 [FIX] profiling: manage long calls with the GIL
Sometimes the profiler provides confusing information.  This happens
when calling a C library without releasing the GIL (Python's global
interpreter lock).  The time spent in the call will be attributed by the
profiler to the former stack trace, because the collector cannot run
during the call.

This commit adds information on the frame when a given stack frame has
lasted for too long.

X-original-commit: 5e193c5dbcdfbdbab38309ed292131ae1f5d3026
2021-08-24 12:31:43 +00:00
Florent THOMAS 56ca5e9297 [FIX] Marshall frozendict in XMLRPC controller
PR #42723 changed the public method context_get on res.users return a
frozendict instead of a classic CPython dict.

Since the default XMLRPC Marshaller does not know how to serialize a
frozendict, this would result in errors when calling the method directly
via the XMLRPC layer.

This commit solves this issue by defining a marshalling procedure for
frozendict objects in our custom OdooMarshaller class, this simply
converts the frozendict into a dict and uses the default dict-to-xml
dump procedure (dump_struct).

Fixes #75412

closes odoo/odoo#75478

X-original-commit: e80a299ed910cacac4aa4e64164909af36ce62ad
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-08-24 06:32:51 +00:00
Adrian TorresandRaphael Collet d543f53c33 [FIX] base: avoid recursion depth errors during uninstall
For some reason _logger.info with exc_info=True inside a recursive
function generates RecursionErrors, presumably because the logger uses
recursion itself to generate the stack trace that is logged.

A simple solution would be to remove exc_info=True, but I've decided to
move the log out of the delete function and simply call it once per
uninstall process with all undeletable IDs, so it's kind of a fix +
optimization.

closes odoo/odoo#75445

X-original-commit: 3a04de569bca10a1d1a01f719635de6842e747b2
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-08-23 10:51:57 +00:00
Alvaro Fuentes d766744b1c [FIX] base: fix ir_attachment read_group
When called with a `srt` as readgroup parameter we get a traceback.
Example:
`read_group([('partner_id', 'in', self.ids)], 'partner_id', 'partner_id')`
TB:
```
 Traceback (most recent call last):
   File "/home/odoo/src/odoo/14.0/odoo/tools/safe_eval.py", line 330, in safe_eval
    return unsafe_eval(c, globals_dict, locals_dict)
   File "", line 2, in <module>
   File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_attachment.py", line 420, in read_group
    if any('(' in field for field in fields + groupby):
 TypeError: can only concatenate list (not "str") to list
 ```

 Observed on the upgrade request 22627.

closes odoo/odoo#75416

X-original-commit: 8e7990dd5c069f7b0dba9f3d27f620f0fcad5441
Signed-off-by: Christophe Simonis <chs@odoo.com>
2021-08-20 18:52:19 +00:00
Pierre Masereel a46c9b0f21 [IMP] point_of_sale,pos_sale: Sale Order integration
Since now, there was no possibilities to pay a Sale Order in a point of
sale without re-encoding every lines of the sale order in a pos order.

So we've now added the possibility to choose a sale order from the point
of sale, and apply a down payment or settle the selected order. You
still get the possibility to invoice it, and the stock is correctly
managed.

The SO is then updated accordingly to what have been done throught the
POS.

closes odoo/odoo#74096

Task-id: 2500902
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-23 12:26:24 +00:00
dht-odoo a02a258451 [IMP] contact: improve action helper messages
This commit improves action helper message for different
contact menus for better onboarding.

Menus

1) Contact Tags(action -> action_partner_category_form)
2) Contact Titles(action -> action_partner_title_contact)
3) Contact Industries(action -> res_partner_industry_action)
4) Countries(action -> action_country)
5) Fed. States(action -> action_country_state)
6) Country Groups(action -> action_country_group)
7) Banks(action -> action_res_bank_form)
8) Bank Accounts(action -> action_res_partner_bank_account_form)

Task-2584073
PR odoo/odoo#74082
2021-08-20 13:10:55 +00:00
Jérémy Hennecart b785cdc211 [MOV] appointment: rename module to match enterprise part
Rename website_calendar module by appointment in order to match
the changes on the enterprise part.

We now no longer use the website module to manage the basics of
online appointments. The portal module is now used in its place.

For additional info, check the enterprise PR.

task-2427015

closes odoo/odoo#72241

Related: odoo/upgrade#2492
Related: odoo/enterprise#18426
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-20 06:50:33 +00:00
Julien Castiaux df885bb4fa [FIX] base: drop milliseconds in default trigger
closes odoo/odoo#75325

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-08-19 13:48:19 +00:00
Thibault Delavallée 461a1ef460 [IMP] mail: add tests for email finding tools
Purpose is to better understand the use of email_re regex (find emails in a
text) and email_split_tuples (find name and email in a string used in email
headers or as email_from / email_to / email_cc).

Task ID-2377974
Community PR odoo/odoo#61467
2021-08-18 13:33:28 +00:00
Thibault Delavallée 82de620424 [REM] tools: remove deprecated `email_send` tool
This tool function is deprecated. As explained in docstring: "since OpenERP 6.1
please use ir.mail_server.send_email()". Seems we are allowed to finally remove
it.

Task ID-2377974
Community PR odoo/odoo#61467
2021-08-18 13:33:17 +00:00
dht-odoo c1e0acf4c6 [FIX] base: fix create contact view
Before commit[1] there was only one field image_1920 in group with 'colspan=1'.
In commit[1] a new invisible field avatar_128 is added in this group. But due
to this an empty 'tr' element is added in view and it breaks the view.

With this commit we move avatar_128 field outside of the group and placed it
with other invisible fields, so it doesn't break view. And also adding comment
field in new group because it is html field now so it displays nicely.

Followup of odoo/odoo@cb4f597410 and odoo/enterprise@971f3ed9ae

commit[1]: c53724ebc3

LINKS

Task Id-2558824
PR odoo/odoo#74795
PR odoo/enterprise#2011
2021-08-18 08:24:57 +00:00
Ivan Yelizariev 99787182e4 [FIX] base: skip unneeded update_list call
`update_list` is an expensive operation and could be avoided when no modules are
updated. Particually, it speeds up initial theme installation on website, which
has following code:

```
    themes.filtered(lambda m: m.state == 'installed').button_upgrade()
```

Benchmark for Odoo 15: `/website/configurator_apply` spends 1.3 sec for unneeded
`update_list` call.

closes odoo/odoo#75140

X-original-commit: 82ba4994e54fc46cc55a463629727e840349bb6e
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-08-16 11:01:44 +00:00
Aaron Bohy 436c5023d7 [IMP] odoo: models: add field name in field descr
The fields dict maps field names to their description. Before this
commit, the field name wasn't specified in the description, meaning
that we could never manipulate the field description without its
key, which would often be convenient.

closes odoo/odoo#75121

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-08-16 09:02:47 +00:00
Julien Banken b6974528f9 [FIX] survey: add support for 'disabled' attribute on buttons (in views)
In the xml file of the list view, it is possible to define a button that
will be placed in a new column. When the user clicks on a button from a
list view, the script will execute the action linked to the corresponding
button. Unfortunately, all the buttons of the list views are not necessary
linked to an action: This is for example the case for the trophy icon of
the survey module. An exception can hence be thrown if the user clicks on
such button.

To solve the issue, we will add the 'disabled' property support for the
buttons and we will add that property to the buttons that do not have
an action. With this property, the script will bind no listener to the
button and it will hence not call the listener causing the error.

task-2612033

closes odoo/odoo#75096

X-original-commit: c698d589e7dfa6fe3df8b4014fe30627693e9043
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-13 15:34:46 +00:00
Habib (ayh) 44029495bc [IMP] base, account, *: simplify multi currency setup
Automatically activate `group_multi_currency` if there is more than one active currency,
deactivate it if there is only one active currency

retain sale/pos feature of activating group_product_pricelist
adapt tests accordingly

Task 2610735

closes odoo/odoo#74396

Related: odoo/enterprise#20106
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-08-13 14:50:44 +00:00
Habib (ayh) 4f19f29a09 [IMP] base: use helper methods for implied groups
In this PR, we add a helper method to add/remove implied groups - update the base to use these instead

Task 2610735
2021-08-13 14:50:44 +00:00
std-odoo 1b9dd118cb [IMP] base: do no spoof the mail from headers when sending emails
PURPOSE
=======
We want to increase the score of the emails sent by Odoo and we want to
avoid them to be marked as spam by the mail clients (gmail, outook...).

SPECIFICATIONS
===============
From filter
-----------
Add a new field on the "ir.mail_server" which is "from_filter". This
field defines the email address for which the outgoing email server can
be used.

The "from_filter" can either define an email address or a domain name.

Use the system parameter "mail.default.from" which allow us to define
a default email address which is used to encapsulate the emails
(default: notifications@<catch.all.domain>).

Mail server priorities
----------------------
When sending an email, we read the FROM header and,
- We first look for a mail server which match the entire mail FROM
  in that case, we do not change the email header (not needed)
- If not found, we search a mail server which matches the domain name of
  the mail from (do not need to change the headers in that case)
- If not found, find the mail server linked to the "notifications"
  email (defined in the system parameter). Then change the FROM header
  to the notification email, and put the old one in the name part of
  this header.
  E.g.
      Initial mail from: "Admin" < admin@example.com >
      Final mail from:   "Admin (admin@odoo.com)" < notifications@odoo.com >
- If no notification email is configured or if no mail server are
  found for the notification email, fallback to the old system and
  spoof the FROM header. In that case we do not have the choice if we
  want to send the email, he will probably be marked as spam.

Sending method priority
-----------------------
In the mail server models, we defined some priorities,
1. Forced SMTP session
2. Forced mail server
3. Try to find the best mail server (see "Mail server priorities")
4. If not found, read the odoo-bin arguments

Bounce
------
As there's no standard for bounce address, we put it in the envelope
(smtp_from). But in some case, it might be considered as spoofing. So,
we use the bounce address ONLY if the mail server is configured for the
entire domain name.

One behavior which might be broken is the following; we send an email as
"std@gmail.com" and the bounce address is on the domain "odoo.com".
Before we received the bounce notifications but we were spoofing the
local part and the domain.

Now
- if a mail server is configured for GMAIL, we do not use the bounce
  address (and we might not receive the bounce notification)
- if no mail server is configured for GMAIL, but one is configured for
  "odoo.com"
    - the FROM header will be "notifications@odoo.com"
    - the FROM envelope will be the bounce address
=> In this situation we are spoofing only the local part of the email
   but it's allowed as the mail server is configured for the entire
   domain name

LINKS
=====

Task-2367946
odoo/odoo#61853
odoo/upgrade#1903
2021-08-13 12:27:04 +00:00
std-odoo fced25d086 [IMP] mail: split the code of "send_email" to prepare the next commit
Purpose
=======
Split the code of "send_email" in "ir.mail_server" so the changes will
be easier to review.

Task-2367946
odoo/odoo#61853
odoo/upgrade#1903
2021-08-13 12:27:01 +00:00