Commit Graph
8071 Commits
Author SHA1 Message Date
Aaron Bohy af85bb5e13 [IMP] web,*: do not deploy services in tests
*mail,point_of_sale,web_editor,website

In the tests, required services are deployed for each test
independently. There is no need to have, in additon, all services
deployed globally. Worse, it could conflict and lead to unexpected
results.

This commit ensures services are no longer deployed globally in
tests. It turns the module 'web.env' into a declarative module with
no side-effect, by moving the service deployment to main.js, which
isn't added to the tests page.

Task 2287397

closes odoo/odoo#53817

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-13 12:55:07 +00:00
Didier (did) 4c4f11580f [FIX] mail: assign correct subtype to "general" demo messages
Some demo messages have a grey background because they have the subtype_id set to
NULL.
The subtype should be `mail.mt_comment`, like other messages inside the general channel.

task-2278438

closes odoo/odoo#54261

X-original-commit: 9be1079cc62699d119b9c2acc6282bd72f71f9af
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-09 10:02:42 +00:00
Simon Genin (ges) 8d02a85c1d [IMP] project: fix mail alias
Update mail alias layout, makes email address
clickable (mailto) and fix a couple of typos.

Task ID 2287394

closes odoo/odoo#53960

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-03 08:53:36 +00:00
Xavier Dubuc 1ade38923c [FIX] mail: bring back extended composer for mailing channel
task-2171877
task-2282377
task-2282382

closes odoo/odoo#54249

X-original-commit: acf8eb3e2e49c1ade638ff1f2fed4969f9944053
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-08 18:04:28 +00:00
Xavier Dubuc f2d1cf9559 [FIX] mail: fix chatter topbar style
- Follow button is now correctly aligned in document app chatter overlay
- Topbar does not move up anymore on select Send Message or Log note

task-2287136

closes odoo/odoo#54247

X-original-commit: 6f05705158a7a197945e6720f5ac231ce6932686
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-08 16:42:25 +00:00
Xavier Dubuc 7091ad53e9 [FIX] mail: save scroll position of chat window when folded
- Remove no more used ThreadViewer prop : messageListInitialScrollTop
- Remove no more used ChatWindow prop : threadInitialScrollTop
- Rename ThreadViewer field threadCacheInitialPosition to
  threadCacheInitialScrollPosition
- Use the scroll position to set message list scroll on mounted
- Fix old test which was not simulating correctly home menu show
- Add tests to check that scroll position is correctly saved even if
  ChatWindow is folded
- Fix traceback when showing/hiding home menu with a folded chat window

task-2285691

closes odoo/odoo#54198

X-original-commit: 31123a94c156424b3962fe4aebc3cc60a7a89223
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-07 15:57:46 +00:00
Xavier Dubuc 36b1adb413 [FIX] mail: make composer use same subtype as message replied to
Before this commit, when clicking on reply in inbox would send a message
whatever the subtype of message the reply is linked to.
This commit makes sure that if the message which we want to reply to
is a note (resp. comment), then the reply will be a note (resp. comment)

task-2282363

closes odoo/odoo#54158

X-original-commit: 27956951eebc7c068a7d57e8bd21c29522f3ff9e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-06 16:56:51 +00:00
Xavier Dubuc cdcb4638d9 [FIX] mail: do not let chatter to be rendered if form view is in dialog
task-2280151

closes odoo/odoo#54157

X-original-commit: 83f2a0605ad80cb8b544651b47b7d27e11b332cb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-06 16:26:38 +00:00
Xavier Dubuc 5afc70faef [FIX] mail: fix open thread in discuss
See also odoo/enterprise#11684
task-2282273

closes odoo/odoo#54141

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-06 14:23:17 +00:00
Victor Feyens ad6b5e35f2 [IMP] *: do not translate logs
The logs should all be in the same language, s.t. one does not need to 
understand multiple languages when browsing/reading the server logs.

closes odoo/odoo#53984

Related: odoo/enterprise#11615
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-02 15:12:56 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
Xavier Dubuc a6e7833a7d [FIX] mail: fix activity directly mark as done display
task-2280174

closes odoo/odoo#53863

X-original-commit: 2638d32db686ef1906c2b2b45d3e9276fe831e52
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-30 11:09:35 +00:00
qho 1424a3839a [IMP] hr_timesheet: Improve the usability of timesheet portal
1. Generic timesheets improvements

    - Portal /my/timesheets
    - Add a group bys task, date, employee
    - Add search in project, name, employee, task
        * The task column should not be visible if none of the timesheets have the Task field set
    - If a group by task, date, employee or project is applied, the corresponding column should not be visible

2. Timesheets from sub-tasks on parent tasks

    - Portal /my/tasks
    - Display the 'Total Hours' spent on a task at the end of the list of timesheets
    - Below the list of timesheets for the task, display another table detailing the respective timesheets (and total hours) of each sub-task linked to this task (= 1 table/list per sub-task)
        * Title should be: 'Timesheets for sub-task: xyz'
        * only visible if there are sub-tasks linked to this task
        * only visible if total hours > 0

3. Timesheets on Invoices

    - Portal /my/invoices
    - Add Project + task fields
        * Task field only visible if set on one of the timesheet entries
        * Project field only visible if there are at least 2 different projects in these timesheet entries

4. Correct visibility for the portal users
    - Portal users is allowed to see timesheets if the users are added in allowed portal users list in the project
    - When a portal user is added as the message follower of the project, the user is added to allowed portal users as well
    - When a portal user is removed from allowed portal users, the user is also removed from message followers

closes odoo/odoo#47248

Taskid: 2201908
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-29 11:56:36 +00:00
Sébastien Theys 1c058b72d8 [FIX] mail: fix (inbox reply) composer event handlers (and discard)
task-2092950

closes odoo/odoo#53731

X-original-commit: c29f5776594c4d2278ce163a78d8eb917fb672c0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-26 11:21:35 +00:00
Sébastien Theys dc011d1246 [IMP] mail: MockServer: add get_mention_suggestions on res.partner
Pr: #53449
X-original-commit: 4f21a77703985d085037dc3d0e472970573810ec
2020-06-26 11:21:35 +00:00
Xavier Dubuc e01ad94c4b [FIX] mail: fix composer buttons style
- emoji button was shifting right on click
- log/send button color was not correct

task-2274349

closes odoo/odoo#53724

X-original-commit: 41a7bb6e9b0c674ca3db5638d17e85f1b3b33f79
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-26 10:02:16 +00:00
Xavier Dubuc 343c1c05d3 [FIX] mail: replace <br/> by space in thread preview
task-2284905

closes odoo/odoo#53718

X-original-commit: 80504fabd43832c5495ded3afc4b364c71d3df70
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-26 09:10:55 +00:00
Lucas Perais (lpe) 257371bab5 [FIX] mail: discuss: unpin channel fixes
FIX: use the correct API of mail.channel.py to unfollow a channel
i.e.: `execute_command_leave`

FIX: unpinning a channel has immediate effect on the interface
chatWindows are closed, and the inbox is displayed

FIX: unpinning a channel destroys corresponding chatWindows across tabs
It also unpins the channel in other tabs

FIX: python sends is_pinned as part of the channel_info
both at init messaging and in the main bus notification
That way, we can keep track of the synchronization of the pin status
between JS and python

task-2275000
task-2267941

closes odoo/odoo#53703

X-original-commit: d4fcc64acb2fc0c6fd9df505380f665abd8b39c4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-26 00:54:54 +00:00
Xavier Dubuc d1307afd7e [FIX] mail: add padding top & bottom to followers list
task-2280183

closes odoo/odoo#53656

X-original-commit: 6bc6575acf8730767f8430242d6ce26f602ac5c3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-06-25 11:48:12 +00:00
Xavier Dubuc e5de39d036 [FIX] mail: fix disappearing moderated messages
task-2277748
task-2277811

closes odoo/odoo#53652

X-original-commit: 5ef6aedb8271fa05f79fb6f93f679caa9cd418ff
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-25 11:13:09 +00:00
Lucas Perais (lpe) 281329361d [FIX] mail: prevent auto-scrolling of form view
Use case 1:
Arriving in a record
=> The form view is scrolled to the first chatter message

Use case 2:
switch record with the pager
=> The other record is also scrolled to the first message

After this commit, arriving on a record or switching record displays
the top of the form view

task-2238141
PR #53136

closes odoo/odoo#53644

X-original-commit: 42605baa5b8ddb94318f5a9d91a489c200469377
Related: odoo/enterprise#11429
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-25 10:36:28 +00:00
Xavier Dubuc 4c763e6bca [FIX] mail: clarify composer placeholder
Also moved isLog from composer component prop to composer model field.

task-2280159 & task-2250887

closes odoo/odoo#53645

X-original-commit: ba41b1de5edc2b3153a5b20a4f11778a3f724ade
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-25 10:37:11 +00:00
Sébastien Theys 446888cc0d [FIX] mail: prevent messaging menu mark as read from opening thread
task-2278759

closes odoo/odoo#53619

X-original-commit: 6af057b087bb66af70ed93d7f82521b56e3b1aa5
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-24 17:36:44 +00:00
Sébastien Theys 652d835f77 [FIX] mail: restore close of other menus on click of messaging menu
task-2278830

closes odoo/odoo#53566

X-original-commit: 0407151b34da16ca54066bb15e578dc1db85f365
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-06-24 10:22:58 +00:00
Xavier Dubuc ba744be937 [FIX] mail: fix folded new message chat window style
task-2272492

closes odoo/odoo#53565

X-original-commit: dcaa91ffb84a7d9ca433fff1913df47513bb365a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-24 10:22:35 +00:00
Alexandre Kühn 40793fde23 [FIX] mail: consistent relations between threads, caches and messages
task-2171881

closes odoo/odoo#53440

X-original-commit: 80d13bb828ee75a50d8cea29046a8eb49c71948a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-22 14:53:30 +00:00
Xavier Dubuc 7abea54433 [FIX] mail: fix attachment dialog
task-2279222

closes odoo/odoo#53437

X-original-commit: c61094bba21a4af567a68d3fb5d4a44352c667af
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-22 14:19:00 +00:00
Jérémy Hennecart 9389f7ce2e [IMP] *: enable sample data in several views
This commit sets attribute sample="1" in a bunch of list and
kanban views, to enable the new sample data feature when views are
empty.

Task 2232801

X-original-commit: 5471309b35619f307242c2704c7681ba63d2be42
2020-06-22 13:04:02 +00:00
Aaron Bohy 8abbc5a3b5 [REF] *: adapt code to web changes
Some changes in AbstractModel have been done to ease the
implementation of the sample data feature. This commit reverberates
those changes in other addons.

Part of task 2232801

X-original-commit: dd8069a3c80570e7fa03a80dbb100ab0a182692a
2020-06-22 13:04:02 +00:00
Xavier Morel 0d6bb14cfd [IMP] base, sms, mail: change calling conventions of server action runners
Taking a self and a separate action seems unnecessary given self *is
an action*.

Only do this change for the "new" naming scheme, so the old one keeps
working as-is.
2020-06-17 11:28:54 +00:00
Xavier Morel 5f310366a0 [IMP] base, sms, mail: make server action runners not public
There is no reason to call these directly, in fact it's not really
possible to do so as they expect an `action` object as first
parameter.

* warn against the presence of rpc-public runners
* move runner selection outside of ``run``
* improve doc a bit maybe
2020-06-17 11:19:27 +00:00
Xavier Morel 5a6d4c4932 [FIX] mail: when warning about password user, fetch partner as su
The superuser is already used to check whether modules are installed
with demo data and create the notification.

It was not used for accessing the admin partner though, so in the case
where a user is logging in with the password "admin" and with no
access to `partner_admin` it's going to blow up the login process
despite no reason to.

Admittedly this is somewhat difficult to achieve in "standard" odoo,
it was only discovered because 2FA (odoo/odoo#33928) can reach this
point without having a "proper" session set up as that set up is
delayed until after the MFA step has succeeded while
`_admin_password_warn` is part of the redirection flow from the
initial login (user/password input).

closes odoo/odoo#53244

X-original-commit: d18d226084a8b47f2858d8a271886115b29d7b2f
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-06-18 12:17:15 +00:00
Martin Trigaux 80e97e98ce [IMP] *: use named placeholders in translated message
When more than one parameter is present in a message, it helps the
translation to use named placeholder. This way, the order can be
changed. It also helps the comprehension of the message.
2020-06-18 13:03:34 +02:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
Sébastien Theys 47aea7ab16 [FIX] mail: add focus to composer when showing it from chatter
task-2224442

closes odoo/odoo#53096

X-original-commit: 7f571e490204d71882baf5a45b0b40cbada8d8da
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 17:08:03 +00:00
Sébastien Theys ac5138b19a [FIX] mail: restore style of messaging menu icon
- restore "solid" icon
- restore muted style when no notification
- opportunity is taken to fix off-pixel of activity menu

task-2278416

closes odoo/odoo#53094

X-original-commit: 1164b37c5fb33d124ede52356c613b7cd31ac8e1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 16:28:03 +00:00
Sébastien Theys 97794679c0 [FIX] mail: fix messaging menu top alignment with other systray menu
task-2276039

closes odoo/odoo#53089

X-original-commit: 35cf5d4a186c51b2d43ff9a63b833767a65059f6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 15:52:57 +00:00
Xavier Dubuc 4ca549253b [FIX] mail: mark message as seen only when thread composer is focused
task-2272510

closes odoo/odoo#53088

X-original-commit: edf356c2022b3039e53e82a092fc64533f59df27
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 15:52:34 +00:00
Xavier Dubuc d85ed51514 [IMP] mail: add docstring for unescaped fields
task-2269440

closes odoo/odoo#53051

X-original-commit: 683a524ac6fa74e786e13e6c1c0d6808b10b41ba
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 11:41:15 +00:00
Priyanka Kakadiya 77c231219e [IMP] mail: set default activity summary only if there is any
PURPOSE

Currently, there is an on-change to set an activity summary to the default
summary of an activity type. This can be useful if types are properly
configured. The problem is, the activity summary will be updated even if there
isn't any default summary on the type. Meaning that it simply removing a
relevant custom summary the user might have already entered.

SPECIFICATIONS

When triggering the on-change on activity_type_id, only update the activity
summary to the default summary if there is a default summary defined on the
activity type.

LINKS

Task-2254825
PR #51373

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-16 10:41:37 +00:00
Julien Castiaux 696a5ecfdd [FIX] mail: cannot route catchall bounced email
Configure a catchall address in Odoo, send an email to that very
address, it should bounce back to the user asking him not to send any
email to the catchall but the email is never sent.

Internally, Odoo reply to the user using the `To` header of the original
email as `From` of the bounced email. It should never use the catchall
address as it is not a valid email to send email from.

closes odoo/odoo#53036

Task: 2277661
X-original-commit: 86c8f0960f709692aa787ae62d446b4427a7c312
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-06-16 09:33:07 +00:00
3fea5b2136 [REF] mail, *: refactor messaging with OWL
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Co-authored-by: Julien Giannone <jgi@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
Co-authored-by: Xavier Dubuc <xdu@odoo.com>
2020-06-15 18:12:21 +00:00
Aymane (ayt) 8df6aec234 [IMP] mail, sms: support keydown based change event in char fields using an option
PURPOSE

Avoid flickering and incorrect display of warning box in SMS when updating
the number to contact.

SPECIFICATIONS

Currently when an user uses composer to send an SMS, number is validated
at onchange. It leads to two issues

  * jump of content as a warning box appears;
  * visual warning displayed after user may have clicked on "Send"
    button, leading to warning not being useful;

We choose to validate number in real time in order to give directly
a feedback to the user. It also lessens flickering on composer screen.
This is done by allowing to trigger the 'change' event on key down. This
requires a specific onchange_on_keydown option to be used on char field.

LINKS

Task ID 2229050
PR #51159

closes odoo/odoo#52962

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-06-15 13:26:13 +00:00
Thibault Delavallée 89c0062527 [MOV] mail: move message technical template into data and correctly name assets file
Task ID 2265592
PR #
2020-06-15 13:26:13 +00:00
Kevin Baptiste 6267d5978c [IMP] base: new widgets in partner list view
Use the new widgets in the list view of res_partner.

closes odoo/odoo#52897

Taskid: 2274257
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-12 09:09:55 +00:00
Aaron Bohy b4ba0fc340 [FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
2020-06-12 09:47:48 +00:00
Aaron Bohy 26fe23201b [IMP] web,*: properly define env in the frontend
*bus,mail

This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.

Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.

Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.
2020-06-12 08:04:14 +00:00
Julien Mougenot c4786fccfd [IMP] *: update notifications to optional title
closes odoo/odoo#52826

Related: odoo/enterprise#11084
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 09:01:50 +00:00
Jorge Pinna Puissant 07a3d7f31e [FIX] mail: pdfjs viewer download name
Before this commit, when downloading a pdf from the pdfjs viewer, the
name of the pdf was always 'document.pdf'.

Now, the correct name of the pdf is used when downloading the file.

opw-2269841

closes odoo/odoo#52878

X-original-commit: b9cd32a7f19b8f73385dea534ad3cc5b126bc6dd
Related: odoo/enterprise#11109
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-06-12 06:48:05 +00:00
jvm-odoo 7910723d36 [FIX] mail: fix can't add follower
Issue

	- Install Contacts
	- Technical / Email / Subtypes / Discussions
	- Uncheck Default
	- Go on any contact
	- Add an user as follower
	- Edit the follower, check any box
	- Save
	- Re-edit for checking

	Not saved

Cause

	In mail_followers.py _add_followers method

	We do:
	```py
	new_sids = set(channel_subtypes[channel_id]) - set(sids)
       	old_sids = set(sids) - set(channel_subtypes[channel_id])
	```

	If no box are checked, sids value will be [None] instead
	of [] (_get_subscription_data) so, new_sids and old_sids
	will have a value but old_sids should not, it override
	the change we made

	We have [None] value because in _get_subscription_data
	we use array_agg which returns a list or None if there
	are no input rows

Solution

	Compute old_sids if sids is not [None]

OPW-2271472

closes odoo/odoo#52869

X-original-commit: b1cdef0272a797fe2c1e5e0634ff400d17480d85
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-06-11 14:55:37 +00:00