Since 3a145216a6a6fb259c5afef6175669c8a65ba39f, partner_info value
was changed but not it's usage.
This commit also simplify the code for better understanding.
closesodoo/odoo#99422
Task-id: 2954397
X-original-commit: a667179e43ab00a8384b75923769782f1836c24b
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
MailActivity model has an ``_action_done`` method that is quite heavily
used and overridden. It notably posts messages, create next activities but
also has some specific behavior depending on category.
Purpose of this commit is to improve code of this method to avoid useless
queries, improve performance, and rethink the computation with batch in
mind.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
Purpose is to have one file / model, easier when searching for inherited parts
of the code and see at a glance various usage of those models.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.
This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.
Available events are:
- connect : fired upon a successful connection.
- disconnect : fired upon reception of the websocket close event.
The close code and reason are given to the listeners callback.
- reconnect : fired upon a successful re-connection.
- reconnecting : triggered when the worker starts to try reconnecting.
- notification : fired upon the reception of notifications.
Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.
Part-of: odoo/odoo#75510
In this commit:
+ Add validation for OnChange definitions 💪
+ Fix the errors found thanks to the new validation 🤩
+ Get rid of the `OnChange` class (useless boilerplate code) 😤
* = calendar
closesodoo/odoo#98549
Related: odoo/enterprise#30631
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
website_livechat
Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.
task-2957295
closesodoo/odoo#98404
Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.
Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat
closesodoo/odoo#98283
Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = calendar, hr, im_livechat, rating, snailmail, website_livechat
This simplifies definition and overrides and opens up new identification
opportunities.
Part of task-2741982
closesodoo/odoo#98166
Related: odoo/enterprise#30470
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
*: mail, web.
The pyEnv used during tests is based on the mock server to provide
server like api. This issue is that when creating multiple environments
during tests, a new mock server is created each time. This is not realistic
since in a real world scenario, multiple tabs would share a single server.
In order to make pyEnv work with multiple tabs tests (e.g. multiple env tests),
let's create a single mock server shared between js environment during a test.
task-2053917
Part-of: odoo/odoo#97975
When an online appointment (having no location set in it's appointment type) is
booked, we need automatically generate the `videocall_location` so that in the
confirmation email received by customers already has a link to join. For
building this URL, we need to use 'DISCUSS_ROUTE' when appointment is being
created (see the linked ENT PR).
For making 'DISCUSS_ROUTE' easily accessible, instead of keeping it as a global
variable, we now make it a class property of the model `calendar.event`.
taskID-2821957
closesodoo/odoo#92628
Related: odoo/enterprise#27136
Related: odoo/upgrade#3558
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit done below changes:
- Change the "Meeting URL" label to "How to Join".
- Change the "https://meet.jit.si/odoo-xyz" label to
"www.mycompany.com/calendar/join_videocall/xyz".
- Adds the label "Join with Odoo Discuss" if the `base_url` is found
in `videocall_lcation`, otherwise "Join At" instead of simply showing
the meeting URL in calendar event related mail templates and moves the
meeting URL to the bottom of this label.
- To avoid a tiny calendar badge, add style `min-width: 130px;` to the
calendar badge.
taskID-2821957
Part-of: odoo/odoo#92628
In order to prepare the ground/reduce the noise in the PR
introducing the websockets in Odoo, the mocks of the longpolling
route in tests is replaced by calls to sendone/sendmany.
This will allow to keep the same code while changing the underlying
technology.
task-2053917
closesodoo/odoo#97771
Related: odoo/enterprise#30244
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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
closesodoo/odoo#97279
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
*: im_livechat, snailmail_account, survey, web_editor.
The callback registered by the bus service method onNotification was
not the same unregistered by offNotification. Since those method were
superfluous, they have been removed in favor of (add/remove)EventListener.
closesodoo/odoo#96684
Related: odoo/enterprise#29819
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, im_livechat, survey.
Following @ged-odoo review, the multi tab service has been improved:
- multi_tab_service.js has been moved to the correct location.
- _callLocalStorage method has been removed and replaced by
getItemFromLocalStorage/setItemToLocalStorage.
- underscore.js calls have been removed.
- multi_tab_service is now using function closure style instead of class.
- multi_tab service is now using its own bus instance.
- service name is now in snake case as per convention.
- tests have been added.
- multi tab service now handles setting/removing/getting values
shared between all the tabs.
closesodoo/odoo#96386
Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: calendar, survey.
In order to ease the PR introducing websockets in Odoo, introduce
the multi service. Indeed, the cross tab bus won't be necessary
anymore but there will still be a need to elect a main tab: some actions
should only be triggered once. To achieve this, the code electing the main
tab has been split with the one handling the longpolling. The crosstab
bus now relies on the multi tab service to known whether or not the
current tab is the main tab.
task-2053917
closesodoo/odoo#96174
Related: odoo/enterprise#29573
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, note, test_mail.
In order to ease testing and to prepare for the ActivityMenu widget to be
converted into a component, let's add the sytray menu item into the registry
systematically when using the start helper.
closesodoo/odoo#96094
Related: odoo/enterprise#29529
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
on/off are deprecated in favor of addEventListener/removeEventListener.
Calls to the bus service have been updated to reflect those changes.
task-2053917
closesodoo/odoo#96017
Related: odoo/enterprise#29501
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to follow:
- Set your timezone to New York
In linux for example with: `timedatectl set-timezone America/New_York`
- Verify that the user timezone is also set to NY
- Create a reccurent event the 6 july 2022 (a wednesday)
- In options, check the recurrent box
- Set repeat to once every week
- Thursday is the only day checked
-> It should be Wednesday
Cause of the issue:
When `_compute_recurrence` is called, `event.recurrence_id` has not
yet been set
-> `event.recurrence_id.event_tz` is False
=> Copy the defaults before computing the start date and check the
timezone of the event itself
opw-2886253
closesodoo/odoo#96049
X-original-commit: 7186dbad38ef1f05919c398f3c0c5f5d8f8b2219
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
The code handling user presence and the one handling bus notifications
are mixed up. In order to ease the PR introducing the websocket in Odoo
and to clear this mess, the presence service has been introduced.
task-2053917
closesodoo/odoo#95981
Related: odoo/enterprise#29524
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, iap_mail.
Now that the bus service is a wowl service, we don't need to wait for
the webclient to be ready before using it. Indeed, the services now
have the bus service as a dependency which means it will always be ready
in time. This also showed that the rpc service was missing as a bus service
dependency. It has been added.
Some part of the code were also checking if the bus service was in
`env.services`. Those calls have been removed as well since we now
have the guarantee that it is.
closesodoo/odoo#96002
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: bus, calendar, iap_mail, im_livechat, project, web.
In order to ease the PR introducing the websockets in Odoo, the bus service
has to be updated to be a wowl service. This PR takes care of it.
task-2053917
closesodoo/odoo#95824
Related: odoo/enterprise#29361
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With recent commit[1], we now use the wowlEnv instead of the legacy one,
and use the service provided by env to call the rpc.
This was adapted in the activity model, but not on the patched method
under calendar.
This commit fixes the issues to adpat the change, and so the 'Reschedule'
button for the meeting activity now opens the calendar view as expected.
Apart from that, this commit also tries to align this button with other
activity buttons, for better UI.
commit[1] - https://github.com/odoo/odoo/commit/3573a7fef497d
taskID-2899402
closesodoo/odoo#95747
X-original-commit: b7efe2a80f9da175114cf1138565580981690001
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
As several customers complained about lot of bugs in microsoft_calendar in 14.0,
It has been decided to backport bug fixes of the model layer from master to 14.0,
without the need of an upgrade script (no new field, ...).
In master, we use 2 ids (organizer event id + universal id) instead of only one,
to handle Odoo <-> Outlook sync correctly when several attendees sync their Outlook
calendar with their Odoo calendar. For that, we have added a new field.
To report this bug fix in 14.0, the existing field which stores the organizer event id,
is now a string storing both ids separated by a ':' as follow: 'organizer_event_id:universal_id'.
2 new compute fields have been added to be able to use these 2 ids more easily.
(all commits from the original PR have been squashed to ease forward-port)
closesodoo/odoo#95736
X-original-commit: 5e83318a7240585371efd31e407829793f3e732f
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to follow:
- Go to a crm.lead
- Schedule an activity
- Click on edit
- Click on mark as done in the popup
- Move the lead to a new stage
-> A missing record error is displayed for the activity
Cause of the issue:
Once the activity has been mark as done (deleted),
The crm.lead record is not updated. The old activity is then
passed to the server where an error is thrown
Solution:
Update the main view after editing an activity
opw-2878984
closesodoo/odoo#95748
X-original-commit: 0a740e819b7f2aa7feb527bb3223b272e4c9f967
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
In module mail, invalidating 'message_ids' on a mail thread also
invalidates its inverse field 'res_id' on messages. If you haven't
flushed it before, your cache will be inconsistent, as shown by the test
/mail:TestMailgateway.test_message_process_bounce_records_channel.
In module purchase_stock, add depends on report.stock.quantity. This
ensures that when the model is queried after changes in other models,
the data on which the SQL view depends is flushed to the database before
querying that model's table.
closesodoo/odoo#66938
Related: odoo/enterprise#16722
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Since the access_token is used in the videocall_location route, it makes sense
to create an index on this column to allow faster lookup. This commit adds the
index to this field since it's creation in 15.3.
closesodoo/odoo#94714
X-original-commit: 3b753dc2f5fcac03f719cd16e9c0216bae83e9b7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
SPECIFICATION
Various change for the partner view:
- Moved the activity widget to the bottom right of the kanban
- Moved the informations badge to the bottom right next to the
activity widget and made them clickable
- Change the address options order and add a small help below
- Change the 'Remove' button function from delete to remove from
the company and add a delete button to the right end.
- Correct some typo
- Add an 'Archived' ribbon to the kanban card
- Change various small things
LINKS
Task-2821356
closesodoo/odoo#89249
Related: odoo/enterprise#26442
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit: if a user is the attendee of an event containing
a private contact, the user couldn't sync with google calendar. Because
of the "res.partner.rule.private.employee" record rule restriction.
Steps to reproduce the issue:
1. Create users A and B
2. Enable "Access to Private Addresses" for user A and disable it for B
3. Login with user A
4. Integrate with Google Calendar in setting
5. Create a contact with private address (type = 'private')
6. Sync with Google Calendar in the calendar module
7. Create an event with user B and the private contact as attendees
8. Reset account of google calendar from user A setting
9. Login with user B
10. Try to sync with Google Calendar
=> You will receive an access error
The solution is not to allow any user to add private contacts as an
attendee. Also, create a new contact with the same email if it wants to
match existing private contact with a google event attendee.
opw-2850552
closesodoo/odoo#92624
X-original-commit: 96ee1ef45954bd27632da9c2cef3cf9ba44caca0
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
*: calendar, note, test_mail.
This PR prepares the ground for the one introducing the new environment in the discuss app.
Indeed, the start helper won't be able to handle widget anymore. To solve this issues,
we're now adding the activityMenu widget to the systrayMenu.Items array, this will be
mapped by the createWebClient helper to component and added to the new systray item
registry.
task-2582313
closesodoo/odoo#91953
Related: odoo/enterprise#27614
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
We can use ._search() to make sure that permissions and ir.rules are applied. By making use of psql subqueries, we remove the need of costly python filtering afterwards, thus increasing performance.
Created test_meeting_count() to check that that the computing of meeting_count is done correctly.
closesodoo/odoo#91325
X-original-commit: 2df40ab03d29045546fbf7f19203e66796d52dc0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Now that pyEnv is available, using it in the mock_server lighten the syntax.
task-2582313
closesodoo/odoo#90783
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With commit that replaced most of the text fields to HTML fields (see
commit[1]), the `description_to_html_lines` method was removed from
`calendar.event` model and linked templates. But another commit[2]
merged afterwards introduced a mail template that used this method,
due to which the rendering used to crashed.
This commit adapts the template and thus fixes the crash while
rendering the template.
commit[1] - https://github.com/odoo/odoo/commit/cb4f597410bcb08208ee277144d755bef8b6d688
commit[2] - https://github.com/odoo/odoo/commit/40fd44f618cb54d8c75b8c090cc36655316aa825
task-2821957
closesodoo/odoo#91280
X-original-commit: 71b9e36f5c5e36f13f26bf74038ddb736d5e25de
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: calendar, hr, note, test_mail.
Since community#86338, widget destruction is registered in the start method. Thus,
explicit calls to widget.destroy during tests are useless. This PR prepares the ground
for the one introducing the new environment in the discuss app. Indeed, the former PR
will use createWebClient instead of createView/Widget constructor thus, we won't be able
to call destroy on the returned value anymore. In order to reduce the noise in the main PR,
all the calls to widget.destroy have been removed.
task-2582313
closesodoo/odoo#91082
Related: odoo/enterprise#27192
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
To reproduce
============
- configure a default note on the "Meeting" type activity in html in the settings of crm
- create a meeting type activity from an opportunity: the activity created in the chat of this
opportunity is well formatted in html (the layout is preserved: bold line break, highlighting...)
- create the meeting corresponds to the activity in the calendar: the html format in the note is not kept
Purpose
=======
when creating the meeting we convert the html to plain text
Specification
=============
to solve the issue we removed the conversion to plain text.
opw-2825252
closesodoo/odoo#91079
X-original-commit: 7d19020b7ff15b8b9e14f38c96312e1c2d1cecb4
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
Before this commit, the qunit test with activities in
calendar was relying on the current date to assert code
that show "today" activities.
This was working most of the time, but could fail at some
time of the day, like at midnight.
This commit fixes the issue by ensuring the test executes at
a specific date time, all the time.
closesodoo/odoo#90875
X-original-commit: 77fc727c05b0c9639581a3bc6ec6164d219988bf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, in the qunit tests, the mocked method
of `_systray_get_calendar_event_domain` was taking the current
datetime as date.
This was a problem because all date and datetime comparisons are
done in datetime, and date must start at the ealiest datetime of
the date.
X-original-commit: 6d529008a6854636c78151d19f744417044ef2e7
Part-of: odoo/odoo#90875
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, ...
closesodoo/odoo#90209
Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
When a an activity was already created, it is no longer to schedule it
when we change the type to a call or a meeting.
Step to reproduce the issue:
1. Create any activity (without scheduling it) on for example a Quotation
2. Edit this activity and change its type to meeting/call
There are no longer a Open Calendar Button, thus we can't schedule it.
Solution: The issue is simply that the Open Calendar button is only displayed
when the activity is not yet created (and if we have the appropriate category).
Instead of this condition, we should display this button if there are no event
already created.
opw-2824396
closesodoo/odoo#90028
X-original-commit: 1a66a3c4478c5b98951b658b6efbbd0b0d82166d
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
*: calendar, hr, im_livechat, mail, mail_bot, snailmail, website_slides.
This PR prepares the ground for the one introducing the new env in discuss.
The signature of the rpc function has changed a lot from the one in the old env.
In order to ease the transition and reduce the noise, the discuss models now
rely on the messaging's rpc function.
task-2582313
closesodoo/odoo#89858
Related: odoo/enterprise#26676
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Because private fields would automatically add a bunch of fields to
the user's request (in order to do their own post-treatment), unlike
normal behavior `read([])` would be completed to `read(['privacy',
'user_id'])` and would fail to trigger the "select all the fields"
behavior of `BaseModel.read`.
Move the privacy management to a `_read` override instead. Also update
the code to be more linear and straightforward, without a bunch of
intermediate helper function.
This is also a small performance optimisation, although apparently
much more minor for 14 (best case of about 5%) than on 15.0 (where it
seemed to reach 30). The gain is mostly for private events being read
for non-participants: because the non-public fields get neutered
before computation (rather than after), fields are computed on a
neutered basis and thus largely do nothing. This is especially salient
with computations relying on relations (in this case
`attendee_status`), as from an empty starting point they essentially
do not do anything.
This leads to the effort (and cost) of private events being read by
non-participants to be about the same as the cost of public events,
whereas before the change there is a visible overhead. The signal is
quite noisy though.
NOTE: backported the addition of `privacy` to the public fields from
2f4a91c0ce as that is better
behavior and makes the tests more logical (and easier to forward
port probably)
OPW-2831113
closesodoo/odoo#89936
X-original-commit: b0c6f2969596fb715e0a6c62865b5c7dbc0bcc78
Related: odoo/enterprise#26699
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
*: calendar, hr_holidays, im_livechat, note, website_livechat.
This PR helps reducing the noise in the discuss new env PR. Indeed,
the new mockServer has the same method except that they are not prefixed
by any underscore. All calls have been changed, and the corresponding
methods created. They will be deleted later.
task-2582313
closesodoo/odoo#89659
Related: odoo/enterprise#26603
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>