Commit Graph
1675 Commits
Author SHA1 Message Date
Florian Damhaut 386e54c9e2 [FIX] calendar: Error stop displaying private name
Step to reproduce:
- Two internal users, A and B
- As A, create a calendar event and set its privacy to private
- As B, display everybody's calendar
- Double click on the private event created by A
- Click on save

Current Behaviour:
- True name is shown as part of the error

Behaviour After PR:
- For private event not related to the users, 'Busy' or it's translation is shown to the user

opw-2723904

closes odoo/odoo#82485

X-original-commit: 704a47a520c789906b7e98ef48e5cb4f6592a13a
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-01-11 08:36:45 +00:00
Rémy Baranx (bar) 828e6468fe [FIX] calendar: use given attendee states at event creation
When an event is created from an external calendar account such as
Google or Outlook, attendee info such as email and state may be given,
and should be taken into account.

For example, if the current user who is syncing his calendar is not
the organizer of the event, his attendee state should be set to
'needsAction' and not automatically set to 'accepted'.

opw-2489815

closes odoo/odoo#81636

X-original-commit: eb1adbd6af4b01a8b3b5b16dbf2d6c32eec852e6
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-23 08:44:38 +00:00
Rémy Baranx (bar) 8153d0b12f [IMP] calendar: inform user about event attendees with invalid email addresses
If some attendees of an event have an empty or invalid email address,
the organizer of this event should be informed that these attendees
won't receive any email notifications.

opw-2667016

closes odoo/odoo#79368

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-22 15:45:46 +00:00
Didier (did)andSébastien Theys 84adbcaffa [IMP] mail: move the activity handler inside a model view
part of task-2579306

closes odoo/odoo#79538

Related: odoo/enterprise#22506
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2021-12-20 16:52:47 +00:00
Louis Wicket (wil) c873ea643a [IMP] mail, calendar, website_slides: rename activity model
Rename javascript model 'mail.activity' to 'Activity' in order to
distinguish javascript model from python model.

Part of task-2701674.

closes odoo/odoo#80555

Related: odoo/enterprise#22593
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 00:10:23 +00:00
Chong Wang (cwg) db5b055138 [FIX] calendar: fix recurrence name
change the wrong recurrence name like
"Every 1 Months on the -1 Last for 3 events"
to
"Every 1 Months on the Last Thursday for 3 events"

before this task,
If you create a recurrence event and invite another partner in calendar with
* Repeat Every: xxx "Months"
* Day of Month: Day of month: Last Thurday
The recurrence name in the email would be like
"Every 1 Months on the -1 Last for 3 events"

closes odoo/odoo#78809

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-01 09:30:02 +00:00
Louis Wicket (wil) 2cb3f774a1 [IMP] mail,*: change model declaration syntax
* = calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot, sms,
     snailmail, website_livechat

This commit will change the declaration of the models with the aim of
getting closer to a plain JSON-object. It allows us to eliminate a wide
portion of boilerplate code, making the declaration shorter, more
declarative, and less redundant, but mainly, it prepares the ground for
further changes.

Task-2695223

closes odoo/odoo#79259

Related: odoo/enterprise#22042
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-23 17:53:46 +00:00
Thibault Delavallée 0afbba8b5b [FIX] calendar: fix recipient of "event update" template
This template runs on calendar event records. It can therefore not really
use 'email' as field to compute a To. Let us void this field as it is used
mainly for a backend action that sets recipients.

Task-2657930 (Email templates fixup)

closes odoo/odoo#79895

X-original-commit: 5b3ad80f427fc2ac0e91622a94f0f63b3d2bf721
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-17 08:26:25 +00:00
std-odooandnounoubensebia cd8e0e9f46 [IMP] base, *: hide non-relevant fields for portal users
Purpose
=======
Hide non-relevant fields for a portal user. E.G. we want to hide the
notification type,  the menu customization... Because those fields
make no sense for a portal user.

Force the non-internal user to receive notifications by emails since
they can not open Discuss.

Task-2508521

Part-of: odoo/odoo#77766
Co-authored-by: nounoubensebia <neb@odoo.com>
2021-11-09 14:45:49 +00:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Audric Onockx (auon) e3405031ba [FIX] calendar : Fixed meeting accept page shoxs invalid logo
Reproduce :
- Login to the latest runbot 14.0 (BASE, not the main!) with the admin user
- Install the apps "contacts" and "calendar".
- Go to contacts and create a new contact with an email
- Make a new company "Company B" and make sure that this is set as default company for the administrator user.
- Set two different logo's on these companies so you can differentiate them.
- Create a new meeting invitation and add the contact you created in step 2 to it.
- Use the "Send mail" option on the meeting invite to make sure it gets sent. Then check in mailhog (it only comes in here after executing the queue cron for mails).
- Now copy the link behind the "accept" button and copy it in an incognito.

Result :
  The logo shown on the calendar invitation page is wrong as it uses the company logo from the company with ID 1 (first created company) while your logo in the email is the right one from your default company.

Solution :
  The logo shown on the calendar invitation page is the one from the default company of the organizer if any, otherwise the one from the default company of the creator.

opw-2579398

closes odoo/odoo#77907

X-original-commit: ffcaca15bd166d0dfe883a79e41a474b4a521d5a
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-10-06 12:39:47 +00:00
Martin Trigaux e132c36ee6 [I18N] *: export 15.0 source terms
closes odoo/odoo#77898

X-original-commit: ad5afb1d18661784bfcf51bca66e576de1f6c49b
Related: odoo/enterprise#21478
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-10-05 16:54:21 +00:00
Arnaud Joset de183583b2 [FIX] calendar,google_calendar: send correct datetime for events in recurrences.
google_calendar: before this commit, the timezone of recurring events was not properly tested.
when an recurrence was created in Odoo, the start and stop datetime were incorrectly set before https://github.com/odoo/odoo/pull/76546/commits/182f0cab58dd4e8a8ce1a3af5eaf8c3d8bea51e6. This commit test this behavior.

calendar: add recurrence information in mail invitation
https://github.com/odoo/odoo/commit/bc9bc2686ca142a7348dc48e0b7f8e74fdd42e10  removed the recurrent template variable that is used to add recurrence information in the mail invitation.

FW port of https://github.com/odoo/odoo/pull/76546

closes odoo/odoo#77559

X-original-commit: e1d1e9ee20e6de4c9b9873e533ff9c89d7b392ef
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-10-01 10:09:47 +00:00
Julien Banken 10ce6a806f [IMP] calendar: removes the group-by availability preset filter
It turns out that the group-by 'availability' filter of the
'calendar.event' model is not really meaningful. We will hence remove it
to simplify the interface. Note that the users will still be able to group
the records by 'availability' by defining a custom group.

task-2646322

closes odoo/odoo#76901

Related: odoo/enterprise#21038
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-09-30 07:50:55 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Audric Onockx (auon) 700a50223e [FIX] calendar : Server error when mark a scheduled activity as done
Reproduce :

CRM.
Go to a task and schedule next activity.
Then mark this activity as done.
Write a feedback.
Result :

Server error traceback
Solution :

The written feedback is given as a kwarg to translate.
opw-2641747

closes odoo/odoo#76985

X-original-commit: 222bda82e034869590530fc634428dca596be198
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
2021-09-23 08:36:57 +00:00
Arnaud Joset dd6cc7445e [FIX] calendar: display start and end of events without datetimerange widget
Before this commit, the datetime range widget was used to set these values in for calendar form view.
Unfortunately, some glitches appeared in mobile view. This commit, revert this change because fixing the mobile view for this specific case was not trivial.
Datetime range widget works in mobile for regular form view (not launched from the calendar view).

closes odoo/odoo#76086

Taskid: 2635704
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-22 12:22:35 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Thibault DelavalléeandVictor Feyens d875bcd79d [IMP] gamification, google_drive, project: limit usage of search on ir.model
Purpose of this commit is to globally improve code performance by limiting
search impact by using cache when accessing ir.model.

Note that tests are left untouched as they are generally done using admin
(or at least data preparation is done as admin). Diff is kept small currently.

Task-2638444
PR odoo/odoo#76005

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
2021-09-08 07:56:03 +00:00
qmo-odooandAurélien Warnon d3fdbe2973 [IMP] calendar,crm: improve mail.activities meetings management
Before this commit, editing a mail.activity with the "meeting" category would
open a modal form for the mail.activity, which did not make much sense.

When editing a mail.activity that is linked to a calendar.event, you will now
jump on the calendar view to edit the related event, which is much more
convenient.

In addition, when scheduling such an activity, the "Edit" button in the chatter
is renamed to "Reschedule", to show the user that he will land on the calendar
view.

Furthermore, trying to delete an activity that is linked to a meeting will now
prompt a confirmation dialog warning the user that the meeting will be deleted
as well.

Finally, we moved the 'phonecall' activity category from the 'voip' module
(enterprise) to the base 'mail' module.
Scheduling a phonecall activity will let the user choose if he wants to:
- Simply save the activity, which will schedule a regular mail.activity
- Open the calendar to create a related calendar.event
  Used typically when you want your colleagues to see that you are busy in your
  calendar during this call.

Task-2486126
ENT PR odoo/enterprise#20431
UPG PR odoo/upgrade#2775

closes odoo/odoo#75530

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2021-09-02 15:36:28 +00:00
Jérémy Hennecart 630a1ab27e [IMP] calendar: add alias to js calendar view
Add alias calendar controller, model and renderer to access them
in the appointment app.

task-2287846
COM PR: odoo/odoo#69484
ENT PR: odoo/enterprise#17792
UPG PR: odoo/upgrade#2401
2021-09-02 00:43:09 +00:00
Arnaud Joset 1f5c0fdc25 [FIX] google_calendar,microsoft_calendar: hide sync buttons on non calendae views
Before this commit, the sync buttons refactored in https://github.com/odoo/odoo/pull/68700 would appears in all calendar views (sale,time-off,...).
This commit only displays them in the calendar event view.

closes odoo/odoo#75702

Taskid: 2633415
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 10:01:10 +00:00
Arnaud Joset b19dc63468 [IMP] calendar,google_calendar,microsoft_calendar: allow to create events with non-default attendee state
Before this commit, it was not possible to create events with defined attendee state. The default value was always set.
This was a limitation when the events were part of a recurrence and all events attendee needed to be created with a known state.

To reproduce, one would create a recurrent event, sync it with Google and in Google, 'decline' this event and the following.
The attendee state was not properly set.

closes odoo/odoo#68700

Taskid: 2484335
Related: odoo/upgrade#2537
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 10:21:02 +00:00
Arnaud Joset 40fd44f618 [IMP] calendar,google_calendar,microsoft_calendar: Improve UI
Before this commit, the calendar UX was not good enough. The look and feel was not modern.
This commit improves a lot of small details, remove unneeded or not mature features (like the videocall location url).

Counted recurrence now brings a better experience. When weekly or montly recurrences are created, occurences in the past are dismissed but before this commit their number was not adapted.
User would end up with less occurences than the provided number without explanations.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:02 +00:00
Arnaud Joset 415d49f3f1 [FIX] calendar: allow to copy event without messing with attendees
Before this commit, when an event was duplicated, the attendee records were shared between copies. Accepting an event in one event would set the same answer on the other.
After this commit, the attendee records are recreated based on the partner and attendee status are reset.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:01 +00:00
Arnaud Joset 966d0fae41 [IMP] calendar,google_calendar,microsoft_calendar: change sync button and attendee status
UI changes:
 * Improve the sync buttons. Before this commit, the buttons would be defined in JS and take more place.
 * Improve the FieldMany2ManyTagsAvatar widget.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:01 +00:00
Arnaud Joset 57dbfff2db [IMP] web: improve calendar view
Before this commit, the calendar filter was a little bit limited: you could add filters to only display events related to these filtered records or display all events.
If you wanted to select all active filters, we had to check all these individual filter.
This commit introduce the possibility to select all existing filter at once or to unselect them. It is quite convenient when a lot of filter are displayed but unchecked.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Arnaud Joset bb9f21d945 [IMP] calendar,google_calendar,google_calendar: allow modifying all event in recurrence
Before this commit, it was not possible to reapply all events in recurrence, delete all events of a recurrence or archive them.
This commit remove that limitation by reapplying the recurrence and remove all the existing events. When the events are synched, the action_mass_archive is used and it must ensure that only a request for the recurrency should be sent.
Individual request for each event are not sent.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Arnaud Joset 3466ccfe01 [IMP] calendar: allow to display all fields of private events for attendees
Before this commit, attendees were not able to see private event information.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Arnaud Joset 9f53946ccf [IMP] calendar: prevent usererror when grouping by private fields.
Before this commit, read_group with private fields would automatically raise an user error, preventing the action.
This commit filter out the private records that the user should not access and display the public ones according to the current user.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:59 +00:00
Arnaud Joset 24a36c6c8f [IMP] calendar: rename calendar.contacts model
Before this commit, the 'magic' model calendar.contacts name was misleading. This model is only used to save calendar view preferences in the calendar app.
As the calendar events are already mentionning attendees, partners, users, the 'contact' name for a technical field was confusing.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:59 +00:00
Arnaud Joset 8cb96696b8 [MOV] calendar: rename calendar_contact to calendar_filter
Before this commit, the model calendar.contacts was only used for UI purpose and could easily be confused with calendar.attendee or partner_ids.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:58 +00:00
Zelong Lin 51ff8b09db [REF] *: convert JS files to ES6 modules
* = hr, hr_holidays, sms, snailmail, website_livechat, account_invoice_extract,
approvals, documents, mail_enterprise, calendar, crm, mrp, note, website_slides,
crm_enterprise, sign, social, voip

task-2510656

closes odoo/odoo#72712

Related: odoo/enterprise#19241
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 14:31:55 +00:00
Thibault Francois 6ec80fe459 [FIX] calendar: expected singleton error with _find_attendee
Issue
-----

Opening the calendar view may lead to an expected singleton error
because _find_attendee my return a recordset with a len > 1

Solution
--------
Return the first element of the filtered list to match the behavior
described in the doc string

closes odoo/odoo#75277

X-original-commit: b3a17e8c233f0b31c61609fefbc24241c3d12ae4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-08-24 06:49:03 +00:00
Martin Trigaux d9e3aab69b [FIX] mail: convert res_model_id to selection
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.

Before this commit, a project user could not access the Activity Type
menu.

Convert it to a selection field with the selection values being
computed in sudo.

closes odoo/odoo#74981

Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-23 06:56:00 +00:00
Adrien Widart 75584fb881 [FIX] crm: invite partners on quick creation of meeting
When creating a meeting from a partner/lead, the invitations won't be
created/sent

To reproduce the error:
1. Open a lead
2. Click on Meeting
3. Create a meeting
    - On meeting creation, directly click on "Create", not "Edit"

Error: No invitation has been sent. When editing the created event,
there isn't any invitation on Invitations tab. Same error will happen
when opening the form of a customer instead of a lead (step 1)

For an attendee to be created, the partners associated with the meeting
must be explicitly listed in the creation values:
https://github.com/odoo/odoo/blob/3e20e68f0790a0b0f3b5c4d43f59f235b7d20fef/addons/calendar/models/calendar_event.py#L710-L713
However, in the above use case, the partners identifiers are given
through the context. This explains why the attendees are not created.

OPW-2531496

closes odoo/odoo#75353

X-original-commit: a8b4f8f6c009d8abd7210973005fd755ac3bc573
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-08-20 07:48:33 +00:00
dht-odoo c23a95a9ec [FIX] calendar: fix description integration in mail templates
Followup of odoo/odoo@cb4f597410 and odoo/enterprise@971f3ed9ae

This commit will improve mail template design by adjusting description section
of template.

LINKS

Task Id-2558824
PR odoo/odoo#74795
PR odoo/enterprise#2011
2021-08-18 08:26:14 +00:00
Hubert (huvw) 6b9592d43a [FIX] calendar, mail: Use user supplied date format in the activity overview
Ticket: 2578903

In the overview menu, the time of a calendar event was not formatted according to the user preferences. This PR fixes that.

closes odoo/odoo#75039

X-original-commit: 0f9746adab26a792fba5d9cfe8e30ea90d7c2a67
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
2021-08-12 14:21:53 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Martin Trigaux 5dc4cff60a [IMP] base: remove read access to ir.model*
Model, fields and selections are no longer readable
Removes metadata access
2021-08-10 13:49:04 +02:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
stefanorigano (SRI) f7efa256fb [FIX] web, calendar: many2many avatar-tags field alignment
Prior to this commit the avatar status element was touching the badge
border.

task-2579123
2021-07-23 06:54:18 +00:00
stefanorigano (SRI) 803c945084 [FIX] web, calendar: fields vertical misalignment
task-2579123
2021-07-23 06:54:18 +00:00
Xavier Morel e1fdc523c6 [FIX] mail: remove non-owl t-raw
The Activity widget is apparently completely unused now that owl, so remove it, and its template
2021-07-20 05:41:35 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

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

We removed redirect_with_hash that was only for retro compatibility

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

Default code for redirect is 303 now instead of 302.

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

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

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

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

Migrate your code:

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

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Lucas Perais (lpe) 694e3f5904 [REF] web: services register their own component
Some services are coupled with a Component. Usually the service
handles the state of the system, and the Component displays or uses it.

To enable the communication between the service and the component
while making it private, the services should add themselves their
Component in the relevant registry, with the proper means of communication
passed in props.

This mechanism relies on c1d49d494e0ae3a94b3943186eb6d1ebd7b98a6e
2021-06-18 21:31:33 +02:00
stefanorigano (SRI) e111cfd35e [IMP] web, *: wcag compliant contextual colors
Overall colors review to achieve WACG standard compliance.
https://www.w3.org/WAI/standards-guidelines/wcag/

Current contextual colors work fine when used for backgrounds but fail
WACG tests when are used for text.
Unfortunately Bootstrap use the same palette in both scenarios without
providing effective control over text colors.

The 'text-emphasis-variant' mixin, indeed, allows to darken a color by a
certain amount, but since the amount is not customizable per-color the
final result is always either too dark or too light for colors that are
not used as a reference.

This commit will define a specif SCSS map called `$o-theme-text-colors`
that mirrors the default '$theme-colors' structure and contain
fine-tuned values to be used specifically for text.

In order to keep the same classes names, we customize the default
'text-emphasis-variant' mixin, instructing it to first look for our
fine-tuned colors and eventually fallback to default.

This commit will also adapt all the modules that use to hardcode text
colors in SCSS rather than using default utility classes. We handle this
using different approaches:

- Use utility classes whenever is possible (eg. 'text-info')
- If apply the class directly is not possible, '@extend' it in SCSS
- If '@extend' is not ideal because of code complexity (eg. ':hover'
  interactions), use the new 'o-text-color([color name])' scss function.
2021-06-18 21:31:32 +02:00
Michael Mattiello (mcm) 41e5435d97 [REF] web, *: refactor notification service
* bus, calendar

This commit changes the notification API and adapts codes that use it
Notification API before:
    - create(...): number
    - close(id: number, wait?: number)

Notification API now:
    - add(...): RemoveCallback

closes odoo-dev/odoo#908

Related: odoo-dev/enterprise#158
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:30 +02:00
Aaron Bohy a5091fee99 [REF] *: rework webclient test helpers
This commit splits the 'getActionManagerTestConfig' helper into 2:
'setupWebClientServiceRegistry' and 'getActionManagerServerData'.

The first one is now automatically called by the 'createWebClient'
helper, as it properly setups the service registry with all services
required by the WebClient component.

The second one generates a few data (menus, actions, views...) that
can be used in tests. That helper is mainly useful for action tests
(formerly ActionManager tests) in web. With this refactoring, they
are no longer generated for each test in the whole codebase that
spawns a webclient, as before this commit.

closes odoo-dev/odoo#906

Related: odoo-dev/enterprise#161
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:30 +02:00