Commit Graph
1257 Commits
Author SHA1 Message Date
Julien Castiaux 760ab74f83 [FIX] *: replace openerp addons import by odoo
Importing addons using the `openerp` anchor is depreciated by #36597
2019-09-16 09:31:38 +00:00
Thibault Delavallée 93c6f77799 [FIX] mail: remove channel and partner default context keys when creating followers
Purpose of this commit is to avoid conflicts when creating new followers
with existing context keys. Indeed some actions may propagate a default
partner id or channel id that is not wanted. Example if when inviting someone
on a slide.channel in eLearning, a default_channel_id is set in context
that clashes with follower creation, thinking it is a mail.channel.

Task 2067872 (eLearning internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
Sébastien Theys c8f2924c66 [IMP] mail: use _message_log_batch in create
For 1000 records, these specific lines take:

- 2.1s before the commit
- 1.2s after the commit

Almost 2 times faster.

PR: #36654
Part of task-2070602
2019-09-12 08:45:51 +00:00
Sébastien Theys 665c1035fc [IMP] mail: call _add_default_followers only once in create
There was no reason to call the method many times in the loop as its result
does not depend on `vals_list`.

PR: #36654
Part of task-2070602
2019-09-12 08:45:50 +00:00
wan ef94a64754 [FIX] mail: bad indentation
The indentation leaded to
UnboundLocalError: local variable 'attachement_values_list' referenced before assignment
2019-09-06 11:50:23 +00:00
Martin Trigaux 27a59776ca [FIX] mail,website_twitter: typos, wording
Courtesy of translator team
2019-09-10 08:58:33 +00:00
Alexandre Kühn 66a0836974 [FIX] mail: odoobot onboarding canned_response_ids
Before this commit, when user follows odoobot chat onboarding and
sends a canned response at the canned response step, odoobot did
not validate the message with the canned response.

This is caused by RPC `message_post` that filters out values that
are not message fields, such as `canned_response_ids`.

This commit fixes the issue by adding a non-stored field
`canned_response_ids` to `mail.message`. This requires the reverse
relation too, `message_ids` in `mail.shortcodes` (= the model for
canned responses).

Task-Id 2058455

closes odoo/odoo#36411

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-04 13:03:20 +00:00
Thibault Delavallée 3d034dafc6 [FIX] test_mail: fix some ordering issues in tests
In resend wizard tests

In some cases tuple comparison of states seems to fail. Indeed order seems
to change in some cases depending on installation order. With this commit
we correctly check partner / notification status one by one, avoiding
to rely on order / set length that is not guaranteed.

In mail gateway tests

Add a specific order on name to be clearer about what we mean when fetching
users as a fallback, until better heuristic. Using name is sufficient as
we have no need to rely on complex partner display_name.

Task 2060220 (testing SMS integration)
2019-09-04 08:34:24 +00:00
Raphael Collet ea70cefce4 [FIX] mail: special case in mail_activity.res_name 2019-09-03 12:02:45 +00:00
Shreya Modi af80c68ae5 [IMP] mail: improve create_uid heuristics in mail gateway
PURPOSE

Currently mailgateway runner user is used to create most documents through
incoming emails. Purpose of this commit is to try to link document creation
and update to users, using the email to make the matching.

SPECIFICATIONS

New sudo implementation allow to bypass access rights while keeping effective
user as creator. Use this mechanism to create documents still using the
mailgateway runner user while linking creator to matching user.

Heuristic to use to match email_from and users

* if route is linked to an alias: check its owner record and check in its
followers;
* find users having this emails;
* if route is linked to an alias: use alias_user_id field;
* fallback on mailgateway user;

Other side effect is that creator and author of incoming email linked to the
new record will now better match the document creator when linked to an
existing user.

LINKS

Task 1919267
PR #30597

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-21 13:28:03 +00:00
Thibault Delavallée 109f390756 [IMP] mail: remove unnecessary decorators
Purpose of this commit is to lessen complexity of stack chain in mail main
methods. Removing decorators is a good start for this.

LINKS

Task 1919267
PR #30597
2019-08-21 13:28:03 +00:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
Christophe Simonis f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Christophe Simonis aac8e0c960 [MERGE] forward port branch saas-11.3 up to 121034f79a 2019-08-19 16:38:30 +02:00
Christophe Simonis 121034f79a [MERGE] forward port branch 11.0 up to 1e4de19cd4 2019-08-19 14:43:31 +02:00
Christophe Simonis 1e4de19cd4 [MERGE] forward port branch saas-15 up to c43de33643 2019-08-19 13:54:40 +02:00
Christophe Simonis c43de33643 [MERGE] forward port branch saas-14 up to fa26279014 2019-08-19 12:51:26 +02:00
Christophe Simonis b6deb72747 [MERGE] forward port branch 10.0 up to 2fc46a064d 2019-08-19 10:24:42 +02:00
Abridbus 2fc46a064d [FIX] mail: removing whitespace on message_id from incoming mail
Because of a whitespace character present at the beginning of the message_id of some mails,
they were fetched twice.

From the SQL side, we see that Outlook is formatting the header following the RFC822
by allowing the header to look like:

Header:<CRLF>
<whitespace><hash_of_msg_id>

From RFC822:
"Each header field can be viewed as a single, logical line of ASCII characters.
For convenience, the field-body portion of this conceptual entity can be split
into a multiple-line representation" (abr.)

It was also possible to find out by checking the logs.
One or two whitespace(s) can be seen before the hash of the msg_id.

The following commit is making sure we use and save the message_id without the whitespace
by stripping them off on the coming mail.

OPW-2006806

Applying CHS solution to avoid crash on empty header.

closes odoo/odoo#35682

Signed-off-by: bve-odoo <Abridbus@users.noreply.github.com>
2019-08-14 07:47:04 +00:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Christophe Simonis 9e74730a26 [FIX] mail: use defined variable
Oversight of previous forward-port.
2019-08-06 16:13:06 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Hardik Prajapati f24d23299b [FIX] mail: fix model typo in message_notify
Since #32404, the fallback case where we have no recipients and no parent_id
on message notify has a typo on mail_message. A user will receive a traceback
when using compose message wizard on a record not inheriting from mail_thread if
he forgot to add recipients.

If the typo should be fixed, notifying the user that no recipients were found and thus,
message_notify won't do anything could be interresting. We can raise a UserError
to give a more explicit failure reason.

We would like to avoid to raise this error on a low level like in message_notify
to avoid to break mail_gateway mechanism, but raising it from mail.compose.message
send_mail shouldn't have any side effect.

We can simply check the output of message_notify to know if something was done
to avoid to duplicate logic used to define recipients.

task-2046180

closes odoo/odoo#35378

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-08-05 13:24:48 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
David Beguin 78e6ce3c3f [IMP] website_livechat : allow to send chat request to a website_visitor
This commit allows a livechat operator to send a chat request to a
connected and available website_visitor.

A visitor is considered as connected if his last tracked website.page request
was within the last 5 minutes.
A visitor is available if he doesn't have an active livechat conversation
(mail_channel with type = livechat).
  - If another operator sent him a chat request
  - Or if the visitor asked himself to speak with an operator
    (via the normal and existing flow)

A livechat conversation is active while the visitor haven't left the conversation.
An operator cannot leave a livechat conversation, only the visitor can.

The flow to send a chat request:
  - On the visitor view (tree or form), operator click on 'send chat request'
    (button or livechat icon)
  - A empty conversation with the visitor pops up at operator side.
  - While the operator didn't send a message, the visitor won't see the conversation.
  - The operator can type a message to the user
  - If the operator close the chat without sending any messages,
    the chat request AND the mail_channel are both deleted.
    In this case, the visitor is then available to send him a new chat request.
  - If the operator send a message, at the visitor's next action
    (page navigation on pages that allows livechat, based on livechat rules),
    the conversation will pop up at visitor side, using the livechat button widget.
    The visitor won't be able to request a livechat conversation with an operator until
    he leaves the chat requested by the operator.
  - Once the visitor leaves (with or without rating) the conversation :
        - the operator is notified that the visitor has left the conversation
        - the chat request is deleted to keep the chat request table clean and minimal
        - the livechat conversation if set to inactive.
  - The visitor is now available again to send him a chat request.

This feature uses the already existing livechat_session cookie mechanism,
so no further code modification was needed to make this work.
It's directly integrated is existing livechat flow.

The chat_request model is only useful to quickly check if a visitor has a chat request
and to send the livechat conversation info to the visitor via the livechat_session cookie.

This commit also add a website_visitor banner info on discuss view :

To be able to quickly see all the relevant information of a website visitor
while talking with in discuss view, a fixed banner have been added.
Only the discuss view will benefit from this because detached chatter window
is to small to display such banner.

Task ID: 34624
PR #2028059
2019-08-19 06:33:37 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Martin Trigaux 496d2c30ad [FIX] account,iap,sale,mail,portal: translate error messages
The error were untranslatables

Courtesy of Moises Lopez

closes odoo/odoo#35573

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-08 13:56:25 +00:00
Tatiana Deribina e08f706b11 [FIX] mail: translate message of copied object
When duplicating a record, the language is set to None in the context
when copying a record

new = self.with_context(lang=None).create(vals)
self.with_context(from_copy_translation=True).copy_translations(new, excluded=default or ())

In mail.thread, the usecase of no language in the context was considered

if 'lang' not in self._context:
track_threads = threads.with_context(lang=self.env.user.lang)

but not the case of a language explicitly set to None

This means that, when duplicating a record, the tracked fields mesages
were untranslated.

Fixes odoo/odoo#35213
Closes odoo/odoo#35331

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 12:48:22 +00:00
Thibault Delavallée fad9a64181 [FIX] mail: fix typo in variable name
Shame TDE, shame !

closes odoo/odoo#35693

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-13 12:57:41 +00:00
Sébastien Theys 3620cb68a0 [FIX] mail, portal, account: clean up portal attachment
Follow up of 61de1c263a

- Remove the dangerous **kw from the route in favor of specifying useful args.

- Use the existing method to link attachments to message instead of duplicating
the logic in an incomplete manner.

- Fix an issue where the actual email would not be sent if the message was empty
but an attachment was defined.

- Ensure the send attempt is done immediately instead of after the cr commit.
The goal is to show potential error messages correctly to the user with the
crash manager instead of a generic error page.

This also increases the send timeout and prevents the error in the first
place in most situations.

closes odoo/odoo#35263

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-12 16:27:00 +00:00
Thibault Delavallée 9bd9cbf532 [IMP] mail: allow message creation in batch
PURPOSE

Allow quick message creation by allowing create multi on mail.message.
Also introduce a new helper tool method to log in batch on records.

SPECIFICATIONS

Purpose of this commit is to add a way to log notes in batch on a document.
Those notes are logged without any notification mechanism, allowing to
attach a note in as few queries as possible.

This is implemented by

  * allowing create multi on mail.message. Nothing changes in its behavior
    except that it is not working on a list of dictionaries;
  * adding a ``_message_log_batch`` tool method allowing to post a batch
    of notes on records;
  * adding a tool method to correctly find author / email_from, to be used
    in various message_post / log / notify methods in order to have the
    same behavior in all those methods;

Logging in batch will soon be used in SMS when attaching a note to sent
SMS without having extra notifications. This will be used notably when
performing mass SMS without using the standard notification mechanism.

LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)
2019-08-12 12:00:22 +00:00
Kevin Baptiste 0f15adb304 [IMP] hr: improve employee profile
closes odoo/odoo#34931

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-12 11:26:09 +00:00
David Beguin 92fe83ecf8 [IMP] mail, mass_mailing : reset bounce on mail reception
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

The number of message bounce is incremented each time the email bounce
on a specific email address. To have a correct information, we should
reset to zero this counter if we receive a mail from this address.
Indeed, if we receive an email from an email address, this email is
active and the message bounce number (if > 0) is not relevant anymore.

Only models inheriting form blacklist are impacted by this improvement
in order to limit a bit side effect.

Also, add a check in autoblacklist rule. No need to check the stats
if message_bounce is < 5.

This commit introduces

  * ``_routing_reset_bounce`` routing method managing the bounce reset;
  * ``_message_reset_bounce`` model method that resets bounce counter
    in blacklist enabled models;

LINKS

Related to task ID : 1893155
Linked to PR #33340
2019-08-09 14:30:55 +00:00
David Beguin f4524f03c3 [REF] mail: move and improve bounce management in mail gateway
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

Purpose
  * move bounce information detection in message parsing. It allows to have
    this information available in various steps of routing instead of having
    to manually re-compute them;
  * handle bounce in specific methods allowing easy override;
  * improve bounce management, notably when detecting a bounce not linked
    to the bounce alias configuration;
  * better integration with blacklist mechanism;

Specifications
  * compute bounce information in ``_message_parse_extract_bounce``.It parses
    bounce information and returns a dictionary allowing to update parsed email
    values;
  * remove override in mass_mailign that basically does what mail already
    does;
  * manage bounce in ``_routing_handle_bounce``;
  * when detecting a bounce, correctly call the bounce management method on
    all models inheriting from blacklist;
  * correctly update bounce counter;
  * bounced mailing traces and automatic blacklist in mass mailing should
    be done in ``_routing_handle_bounce``;
  * add some tests;

LINKS

Related to task 1893155
Linked to PR #33340
2019-08-09 14:30:55 +00:00
Thibault Delavallée 7b79045fab [REF] mail: perform some code cleaning in mail gateway about parsing email values
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

Parsing email values: make message_parse effectively prepare all required
values for later processing

  * update message_parse to add some more data directly in parsed dictionary
    and avoid having to parse value again in later processing and computation.

    * notably recipients computation is now done directly in parsing. It
      includes email check and reconstruction using tools methods. That way
      routing just has to handle those values and not compute part of them;
    * from and cc are correctly managed with parsed and cleaned (sanitized)
      versions in dictionary;
    * remove all code decoding message header and replace them by fetching
      the parsed value instead;

  * filter parsed values before calling message_post to ensure right values
    are given to it instead of having to manage them in message_post. Indeed
    caller has to give the right input;
  * make parsing sub-methods (extract payload, post process payload) have
    a dictionary as input and output to always manage a dictionary of values
    through the parsing methods and update their namespace;

Routing: remove deprecated code parts

  * remove use of email_references regex. Indeed emails are routed using their
    messageId and not the regex anymore since several versions [1];
  * clean some unnecessary variables;
  * simplify variable type input, like message_parse accepts only valid
    email.message instances and to avoid several decode / encode. Tests are
    updated accordingly;

Update docstrings of those methods.

LINKS

Related to task 1893155
Linked to PR #33340

[1] See df037e2959 and 0028c42136
2019-08-09 14:30:55 +00:00
Thibault Delavallée 442e535fdd [REF] mail: simplify and rename message_route_verify
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

Purpose: clean mail gateway code by cleaning message_route_verify

``message_route_verify`` is therefore renamed to ``_routing_check_route`` as
there are already some methods prefixed by routing, related to email routing.
This method is also made private as it has no real use for external world.

Parameters of this method are also cleaned. Various cleanings and code
improvements made some parameters not necessary anymore :

 * create_fallback: was always True;
 * update_author: was always True;
 * drop alias: no real use as aliases are used to compute the route and its
   access, dropping it at that point has no effect on code;
 * assert_model: renamed to raise_exception to be more coherent with the
   same kind of parameter used in Odoo;

LINKS

Related to task 1893155
Linked to PR #33340
2019-08-09 14:30:55 +00:00
Thibault Delavallée e132c40f66 [REF] mail: remove private discussion support in mail gateway
PURPOSE

Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.

SPECIFICATIONS

Private discussion support in mail gateway means having incoming messages
not linked to a document. It means having a void model and res_id on related
messages.

Old private conversations in Odoo were implemented using messages not linked
to any document [1]. It was possible to send an email to some people through
the UX and they were able to answer it. Messages were not attached to any
document and model. There were some limitations to this feature, notably it was
limited to replies (no beginning of private discussion through mail gateway).
One way of doing it was through the use of res.users aliases [2]. There was
also a vaguely twitter-lite use of chatter on HR employee profiles linked
to users aliases, then removed with an explicit support of private
discussions [3].

It is not supported anymore since discussion between users is now done using
chat. Aliases on users have since been removed [4]. Contacting partners or
customers can be done on business documents or on channels. Simple email
discussion is not supported in Odoo as it is not the purpose of mailgateway.

This commit removes code related to private discussion in mail gateway and
some specific support in message_post method.

LINKS

Related to task 1893155
Linked to PR #33340

[1] History is a bit messy, see notably fd90140d7b and commits around
[2] User alias addition 052f2ace57
[3] End of employee twitter-like and posting on users = private discussion 89896f32bb
[4] User alias removal 029d1baf35
2019-08-09 14:30:55 +00:00
Mitali Patel a54457e04d [IMP] mail: better exception activity handling in kanban and tree
The purpose of this task is to add a visual indicator on kanban and list
views when there is an exception activity on a record. To do so, two
fields have been added on the activity mixin that determine if the record
has an exception activity and its corresponding icon.

When there's an exception activity, the next activity icon is different
in the kanban and in the list view, the icon is displayed at the end of
the column with no label.

Prefetching all activity_type_ids in compute will allow to lessen
queries (3 query for this compute) and cache may benefit to other
mail.activity.mixin computed field, like activity_state in kanban view

Task 1889379
2019-08-07 15:41:05 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00
Christophe Simonis 886eca0131 [IMP] *: remove usage of oldname attribute
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.

Moreover, this feature was misused. It was:
 - left on fields during multiple versions.
 - used on reports (SQL views). This would be ok if the feature was
   complete, but, as is, it was useless.
 - kept unchanged after a second renaming of the field (which can happen
   versions later the first rename).
 - used, even when the meaning of the field changed. i.e. the field
   `archived` has been renamed to the classic `active`, but the value
   in the database should be switched.
2019-08-05 09:36:41 +00:00
Xavier-DoandThibault Delavallée 4f44ad4fe4 [IMP] mail: gc more notification.
This gc option should delete more notifications: we only keep notification
not send, and set inbox notification as sent.

closes odoo/odoo#30067

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>


Co-authored-by: Thibault Delavallée <tde@odoo.com>
2019-08-05 16:13:54 +00:00
Xavier-Do a55c78836f [REF] mail: remove notified_partner_ids from mark_all_as_read
mark_all_as_read is using notified_partner_ids to filter
the messages to use. But anyway, the notification will
be filtered on partner right after that.

Since if we have a domain, the message set will be quite small,
(scope of a thread) we search all those messages.

If not, we actually avoid to search on message and go right
to the notifications.

Reading the message_ids will garantee to have the minimal
set of message that where actually passed from unread to read.
Since data should not be in cache at this time and mark_all_as_read
is usually called alone, we prefer to use cache and perform a read
immediatly.

Task-ID 402597
2019-08-05 15:04:28 +00:00
Xavier-Do 42b3a56a43 [REF] mail: remove notified_partner_ids from _message_read_dict_postprocess
notified_partner_ids, (previously notified_partner_ids) is used to
populate a list of partner to prefetch + return a list of partner_ids.

1. the list of partner_ids is doesn't look to be used, and thus
can be removed. Was introduced in 1d4dbc3440

2. Prefetched list of partners is used to generate customer_email_data.
Since this list is limited to partner email notifications , we can use
a custom search instead.

The proposed implementation is far from perfect but proposes the minimal
changes to remove notified_partner_ids, without (hopefully) negatively
impacting performances.

Task-ID 402597
2019-08-05 15:04:28 +00:00
Xavier-Do bb37ab2119 [REF] mail, test_mail, *: rename needaction_partner_ids to notified_partner_ids
,*:crm, website_blog

The mail.message needaction_partner_ids meaning changed over time,
and doesn't actually reflect the list of partner in needaction.
More than that the message_format needaction_partner_ids used by js
began to diverged from mail.message field since 19fb650863

To avoid any confusion, renaming it to notified_partner_ids will help
to avoid confusion between python and js meaning, and reflect the actual
content of this field : a list of partner that where notified once on
this message. This field is mainly usefull for testing.

Task-ID 402597
2019-08-05 11:50:20 +00:00
Nikunj Ladava 0c37b9fb39 [IMP] mail, test_mail: new 'History' mailbox in Discuss
This commit adds a new mailbox in the Discuss app called 'History'.
Messages that have been marked as read are moved to 'History'.

Notifications are required to link history messages to users. So
notifications are now deleted after they are more tha 6 months old.
This means History mailbox keeps less than 6 months old messages.

Note that this feature only works when user notifications are handled
in Odoo. This can be set in the user preferences, under the
"Notification Management" section.

Task-ID 402597
2019-08-05 11:50:19 +00:00
Romain Derie cfeb8a5185 [FIX] mail: remove useless hasattr on get_base_url
This check was introduced with d82b897ea1 in 12.0 where `get_base_url` was
not yet a model method.

Since f727cd2645, in saas-12.5, that method is now on model, making the
`hasattr` check useless.

closes odoo/odoo#35057

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 10:48:53 +00:00
Sébastien Theys f0ffbea173 [IMP] *: remove unnecessary image sizes
The big images are probably never going to be used for the following models:

- pos category
- fleet brand
- livechat channel
- mail channel
- payment acquirer

And if big images are needed some day the model should use image.mixin instead.

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00