Commit Graph
160824 Commits
Author SHA1 Message Date
Julien Mougenot caf40dfe2d [IMP] web: Improve date utils & localization consistency
This commit introduces various improvements to simplify, speed-up and/or
strengthen consistency in the date utility functions and localization
service.

It also takes care of removing luxon<->moment conversion helpers since
they are only used in the date picker, which has been rewritten.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:21 +02:00
Julien Mougenot 6a6a1efbe2 [IMP] web: Popover closes on escape
This commit adds a global listener from the popover controller to close
itself when "Escape" is pressed.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:21 +02:00
Julien Mougenot 7874bf3fc1 [IMP] web: Function fieldDependencies + utils doc
This commit does the following in the Web module utilities:

- makes the `fieldDependencies` property of the field objects
definitions a function instead of a list of strings: this makes it
possible for fields to extract their dependencies based on the fields
info from the arch;

- adds/improves types and documentation for some utility functions.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:21 +02:00
Julien Mougenot f853ca8eec [IMP] web: Ensure array utility function
This commit introduces the `ensureArray` function, ensuring that the
given argument is an array by wrapping it in one if it is not.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:21 +02:00
Julien Mougenot 437edce313 [IMP] web: Allow tab inside editable list cells
This commit makes it possible to use Tab to navigate between interactive
elements inside the cells of editable list views.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:20 +02:00
Roy Le 9962fdaa3c [CLA] Viindoo updates Odoo's CLA
closes odoo/odoo#120616

X-original-commit: 8aefb386da2a1b401518870702473ae7e1ba3770
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-05 12:44:07 +02:00
Chong Wang (cwg) 55c9ca692f [FIX] base: translate ir model fields
before this commit:
after #109858
The method `update_field_translations` won't directly call the `write`
As a result, when changing the translation of fields from translation dialog,
the orm cache won't be cleared, and translations won't be updated in views
even after refresh the page

after this commit:
when users translate fields and refresh the page, the new translation can be
updated in new views

opw-3267024

closes odoo/odoo#120602

X-original-commit: 8d8dbab203fe7c153522dcb2a420d97dc4adaadb
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2023-05-05 12:44:05 +02:00
Odoo's Mergebot d30be095f4 [MERGE][IMP] crm{_iap_mine}{_iap_enrich}{_sms}, web, iap{_mail}: improve UI
Purpose
=======
Improve some UI display of the CRM and CRM related modules.
CRM v16.3 promenade.

Specifications
===========
web
------
* Increase the maximum input field size to handle a larger number
of characters.

crm,crm_iap{_enrich}{_mine},sale,sales_team
-------------------------------------------------------------------
* Improve some small UI display like placeholders, search filters,
the wording of the lost reason modal, the fields alignments,
always underline certain fields, set certain fields as optional in
the reporting tree views, ...

crm
------
* Modify the informative lead count field to be displayed as a muted text
sentence with text color warning when it exceeds the maximum month count.

crm{_sms}
---------------
* Remove the reporting pipeline tree view buttons as the view is not
an operational one so those won't be used by the manager.

mail
-------
* Add a m2o avatar widget to a field.

iap_mail
-------------
* Improve the display of the lead enrichment message appearing in the
chatter after an enrichment.

More details in underlying commits.

See: https://github.com/odoo/enterprise/pull/38498

Task-3204763

closes odoo/odoo#115326

Related: odoo/enterprise#38498
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-05 12:44:00 +02:00
amdi-odoo 75231185a4 [IMP] iap_mail: improve lead enrichment message
Purpose
=======
Improve the display of the lead enrichment message
appearing in the chatter after an enrichment.

Specification
=============
In the enrichment chatter message:

- Remove the display of the company logo if the
company doesn't have any.
( Using alt="" to avoid displaying both image and text
placeholders if logo url exists but leads to a blank page)

- Fix the info alignment when having long characters.
- Add the twitter URL next to the followers count in
the enrichment info.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:59 +02:00
amdi-odoo cf3f562525 [IMP] mail: add many2one avatar widget
Use a many2one avatar widget instead of the
simple many2one in the schedule activity form
to display the user avatar picture.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:59 +02:00
amdi-odoo f8a8ce710d [IMP] crm{_sms}: remove reporting pipeline tree buttons
As the pipeline reporting tree view isn't an operational
view but more of a managerial one, remove the email, sms
and snooze buttons from the view as the managers won't
need those.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:59 +02:00
amdi-odoo a8e9b25761 [IMP] crm: add monthly lead assignment count color
Draw attention to the monthly assigned lead count when
it is exceeding the limit by changing the text color
to orange.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:59 +02:00
amdi-odoo b47f73bf4e [IMP] crm,crm_iap{_enrich}{_mine},*: improve UI
*: sale,sales_team

Improve UI of the CRM app:

- Add placeholders and underline m2o fields in the CRM quick create
- In the lead generation form, underline the industries field, add
the avatar widget on the user_id field, add the color attributes on
the tag field, add a placeholder for the states field and set a
longer selection field to avoid the caret from overlapping the content.
- In the opportunity form, align the expected revenue and probability
headers, set a longer width for the expected revenue field,
change the recurring plan placeholder.
- In the contact opportunities page, change the "Open Opportunities"
filter to exclude lost opportunities.
- In the Sales team page, add a groupby on the company_id.
- In the Sales team form, change the assigned lead count to be
a muted text, the pipeline checkbox should be visible only when leads
has been activated, the quotations/pipeline/leads options should be
aligned.
- In the lost lead modal, change the title from "Lost Reason"
to "Lost Lead" and the validate button from "Submit" to
"Mark as lost".
- In the Sales team member form, align the fields on the left and hide
the Create Employee field as it should not be displayed there because
this is not an hr module.
- In the lead analysis tree view, add the lost reason field with optional
hide.
- Align the enrichment company not found message to the left of the chatter.
- Update the crm iap lead role "Search More" list to display human
readable names instead of the technical names.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:58 +02:00
amdi-odoo cdde6575e4 [IMP] web: increase available input size
Modify a css class to increase the available input
width to handle larger input sizes.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:58 +02:00
Ivan Yelizariev 031999ad34 [FIX] website_sale_digital: let salesman download digital via portal
Portal shows all Sale Orders available for current user. For example, salesman
can see his sales. If such a user can download digital files via product form in
backend, it makes sense to let user download them via SO page on portal.
However, it wasn't the case because /my/download requires product be purchased
by current user [1]. Fix it by checking read access first.

STEPS

* in backend create SO with digital product (customer must be different from
current user)
* create invoice and register a payment
* navigate to portal  (without using customer's token),
* open SO, click download on digital product

[1]: https://github.com/odoo/odoo/blob/1a24477fab4dd323cf94c010321d8942fb2c1a01/addons/website_sale_digital/models/account_invoice.py#L14-L22

opw-3144600

closes odoo/odoo#120611

X-original-commit: 77da4731ad88daf07a9d91d5f2552f7f106b0c8b
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-05-05 11:37:31 +02:00
MerlinGuillaume 6b4835e229 [FIX] mail: disable the sidebar when opening a pdf in the chatter
The pdf viewer sometimes displays the sidebar when we open the pdf

Solution:
Add `pagemode=none` to the url when opening a pdf in attachments

opw-3193516

closes odoo/odoo#120530

X-original-commit: bd5f00e2c1f183ec7bb299a1db64efbd0542eb49
Related: odoo/enterprise#40746
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 11:37:29 +02:00
Yashkumar Vaishnav 9add589857 [FIX] project: fix line break issue in user assigneed mail template
In your inbox, when you are assigned to a task then you receive mail from
the project. In that mail, the mail subject and body are shown in one line.

In this commit, The mail template's "assignee_name" field currently has a 'span'
tag, which may cause inline subject and body issues. To prevent this, it is
recommended to use a 'div' tag instead.

task-3274690

closes odoo/odoo#118576

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-05 10:29:42 +02:00
Yashkumar Vaishnav 4e9a30bcfc [FIX] project: fix validation error of quick create view
In the quick create view, do not enter a value in the Task Title field and try
to create a task, a validation error is showing instead of a toast notification
highlighting that a required field is not set.

In this commit, display_name field is set as a required field so that when
required field is null, a toast notification is displayed instead of a
validation error

task-3274690

Part-of: odoo/odoo#118576
2023-05-05 10:29:42 +02:00
Renaud Thiry 39f14ca2c9 [IMP] mail: add auto_comment message type
Currently some auto_reply templates are internal as a means to prevent
notifying users everytime we send a reply to somebody.

This raises the issue that since responses to internal notifications
are themselves internal notifications, often nobody will be notified of
responses to these automated messages.

We fix this by marking these messages as auto_comments, which will
ensure responses to these messages are
considered non-internal (and thus 'discussions', by default).

task-2834304

closes odoo/odoo#94018

Related: odoo/enterprise#35466
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-05 09:25:42 +02:00
Renaud Thiry c9f55bb227 [IMP] mail: Show reorder template response
If a tracked value sent a mail template on creation of a record,
the template was displayed before the original message in the chatter.

We fix this by using precommit hooks similar to those already used for
tracking.

We also update the query count for a couple of tests. This is required
because in those tests the test user is not in the cache when we execute
the precommit hook, which we use to fetch a fallback language early in
the precommit.

Task-2834304

Part-of: odoo/odoo#94018
2023-05-05 09:25:42 +02:00
ravb-odoo c9637fd3bd [FIX] project: fix recurrence boolean should be hidden issue
Description of the issue/feature this PR addresses:
In project module, when sub-tasks is created then recurrence boolean field
should not be visible in that task. It only visible in parent tasks.

Current behavior before PR:
recurrence field is visible in sub-tasks.

Desired behavior after PR is merged:
recurrence field is not visible in sub-tasks.

task-3252521

closes odoo/odoo#120601

X-original-commit: c122da61dba916c74bca4c6994a289099d73eaa4
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-05 00:39:52 +02:00
moerradi 5881af92d8 [IMP] account: Enable saving bank account for new partners
This PR resolves an issue where it was impossible to save a bank account for a newly created partner (customer/vendor) without saving the partner details first. The solution implemented is to automatically save the partner when the user clicks on "add a bank account", thus ensuring a smoother user experience.

Problem Description:
When creating a new customer or vendor, users encountered difficulty when trying to add a bank account without saving the partner details first. The account holder field was required to save a bank account, but it didn't exist yet, creating a frustrating experience for users.

Solution Implemented:
We have implemented an auto-save feature for the partner when the user clicks on "add a bank account". This will force the save of the partner details before proceeding with the bank account addition, ensuring the account holder field exists and can be filled in.

closes odoo/odoo#120599

Task-id: 3266820
X-original-commit: d4defd079508e14b6a74c01a41868d3b57b2e0c0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Erradi Mohammed (moer) <moer@odoo.com>
2023-05-05 00:39:50 +02:00
Xavier-Do 10cccd1cb7 [IMP] base: add test for routing_map perfs
This test will help making stats on routing_map generation performances

This will help to mesure the time for the main `None` routing map as
well as for website1, the idea being that it would be possible to
mutualize a part of this computation between routing maps.

closes odoo/odoo#120591

X-original-commit: 6646fa7e2ef64e5f060bf38b0d85bf1188d79e4f
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-05 00:39:47 +02:00
Eteil Djoumatchoua(etdj) 0d56f9963b [FIX] website: render well the price range widget in RTL languages
Steps:
- Go to website/shop (with price range widget enabled)
- Change the language to Arabic

Issue: the numbers on the price range widget are overflowing

Cause:
The element leftCounter's right style property is always set to 0px.
So when changing the direction it's always on the right as his position
is absolute.

Solution:
Built-in handle by Bootstrap with end-0

Fixes #108557
opw-3221051

closes odoo/odoo#120568

X-original-commit: 4e05d93dce31f9a829961bded855a6cb7e8de7f3
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-04 23:31:00 +02:00
Habib (ayh) d7d02c44c6 [FIX] account: context issue when importing statements
The file uploader uses a context key `default_journal_id` to identify the journal to upload to. With commit https://github.com/odoo/enterprise/commit/0d7d1a2994f14b80cd8f3644871f87a472821741, we attempt to reconcile imported transactions immediately. When reconciling, if there is a partner and an account number, the res.partner.bank is created.

Problem:
When creating a partner bank account, the default_journal_id is in the context, and is interpreted as a default value, which causes a stack trace.

Solution:
Explicitly specifiy the journal_id when the partner bank account is created, so there is no invalid value when obtaining defaults.

task-3299109
opw-3291805
opw-3291064
opw-3291024

closes odoo/odoo#120554

X-original-commit: ff4e080d3e006104cf6345d96e56714b0f8be16d
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2023-05-04 23:30:54 +02:00
Victor Piryns (pivi) d0e55f082b [FIX] project: correct pager of project portal view
Current behaviour:
If a project has more than 80 tasks, there is pagination activated
in the project portal view. But when clicking on the second page, we
are requested to login, even when we come from a shared link.

Expected behaviour:
You should be able to scroll through the pages of tasks related to
the shared project without being requested to login.

Steps to reproduce:
- Install Project
- Create 100+ tasks in 1 project
- Copy the share link of that project.
- Log out, open the shared link.
- Go to page 2 of the tasks -> login request.

Reason for the problem:
Missing `access_token` in the pager urls to browse through the tasks.

Fix:
Add the `access_token` as url argument in the links when creating
the pager for the portal view.

Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master

opw-3220659

closes odoo/odoo#120546

X-original-commit: 87b3f6d865cddb91def5af2603c44e8e2a68b04c
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-05-04 23:30:52 +02:00
Yannick Tivisse ad0a4faa7d [IMP] calendar: Ensure a warning is properly displayed on private chatter
Purpose
=======

Currently the chatter of a private event is unavailable to excluded users
but a end user might be confused as no explanation message is currently
displayed on the chatter.

closes odoo/odoo#120545

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-05-04 23:30:49 +02:00
Jonathan Castillo (jcs) c8a5d8e993 [FIX] purchase_stock: update documentation link
This commit updates the documentation link in the settings tooltip, as
introduced by the documentation PR
https://github.com/odoo/documentation/pull/3762/
A redirection rule is added in that doc PR to act as a fallback.

closes odoo/odoo#120535

Related: odoo/documentation#4336
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-04 21:32:27 +02:00
Jeremy Kersten ef334d37f3 [IMP] website: perf - less invalidation of routing map
This commit avoid to invalidate the cache on creation of 301/302 that
have no impact on the routing_map as only 308 and 404 alter the routing
map:
- 404: remove entry from routing map
- 301/302: served as fallback later if path not found in routing map
- 308: add "alias" (`redirect_to`) in routing map

closes odoo/odoo#120500

X-original-commit: 1430644908d7d9a3119a1315389f5bf11888356a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-04 21:32:24 +02:00
Alexandre Kühn 08a6a5781e [FIX] mail: disable open chat from click on self-authored messages
Before this commit, when clicking on self-authored messages, it was
opening the form view.

It should neither open chat nor open form view for self-authored
messages.

closes odoo/odoo#120484

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 20:34:00 +02:00
Guillaume (gdi) 89af36516f [FIX] website, *: add a robust utility to enter in edit mode
*: test_website, website_blog, website_crm, website_hr_recruitment,
website_mass_mailing, website_sale, website_sale_wishlist,
website_slides

This commit creates a new util which clicks on edit and waits for the
edit mode to be started. This way, we make sure that the edit mode is
enabled before testing the next step of the test. This avoids race
conditions during tests.

This commit replaces all the uses of the old util with the new one, it
also removes the steps that are waiting for the edit mode to start.
Finally, from [this other commit], we can start a tour in edit mode. For
these tests (which have `edition: true`), it is useless to check if the
edit mode has started at the beginning of the test because this check is
already done by default. This commit removes unnecessary / duplicated
steps.

[this other commit]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35#diff-c7720501ec33f5f92c907d8bb41de50edd832a4564317073e801a6915796a6bdR278

task-3203820

closes odoo/odoo#120481

X-original-commit: https://github.com/odoo/odoo/commit/9fd5d25f59578abc9c608578a7d2e2953880b582
Related: odoo/design-themes#656
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-05-04 20:33:55 +02:00
Michael (mcm) 6527b01199 [FIX] web: open mobile search view in a dialog
Before this commit, the mobile search view was sent to the end of the
dom (t-portal) and so was on top of everything even the dialog that
was opened after it. Now, the mobile search view is open in a dialog
and the depth level between it and other dialogs is fixed.

task id: 3273035

closes odoo/odoo#120432

X-original-commit: 726ee64fb8b76fa7ded38e1d7e51612546e748c3
Related: odoo/enterprise#40663
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-05-04 20:33:49 +02:00
Victor Feyens 4b5ae09501 [IMP] sale: clarify that draft orders cannot be paid for
For orders that require "Online Signature" for confirmation,
it'll be clearly shown in the signature wizard (after trying
to submit the signature) that the order is not in a state
requiring customer signature.

But for orders requiring "Online Payment" for confirmation,
all the customer will see is "No suitable payment option could be found.".
This is confusing for the customer, and is mostly due to the fact that
payment providers & logic is only loaded when the order is in the right state.

With this commit, the user will see a clear message explaining that the order
cannot be paid in its current state (draft).

Fixes #120197

closes odoo/odoo#120255

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-04 20:33:47 +02:00
Alexandre Kühn ec8dc607d0 [FIX] mail: consistent unread/needaction of channel in messaging menu
Before this commit, unread and needaction shown in messaging menu
was inconsistent with discuss sidebar.

In discuss sidebar, unread channel are bold, and needaction are
shown with badge + counter. In messaging menu, previews could be
either unread or needaction previews, and channels had 2 previews,
one for unread, and the other for needaction.

This commit make the messaging menu preview of channels more
consistent with discuss sidebar:
- channels have a single preview for unread and needaction
- unread messages make title bold, unread counter is no longer shown
- the counter displays needaction on this channel instead.

This commit also improves ordering of messaging menu items, so that:
- needactions have precedence over non-needactions
- unread channels have precedence over read channels

Task-3293723

closes odoo/odoo#120144

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-04 19:10:20 +02:00
Odoo's Mergebot f26f6990d7 [IMP] base: improve user password wizard
This commit fix the users login disappearance when hitting 'Change Password' button without setting a
password by adding force_save parameter. It also removes the required parameter from the new_passwd
field so we don't get a vague missing field error when one omits to enter a new password.

Task-3184727

closes odoo/odoo#112806

Related: odoo/upgrade#4502
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-05-04 19:09:56 +02:00
Patrick Hoste cde4a9c647 [IMP] base: improve user password wizard
This commit fix the users login disappearance when
hitting 'Change Password' button without setting a
password by adding force_save parameter. It also
removes the required parameter from the new_passwd
field so we don't get a vague missing field error
when one omits to enter a new password. Instead of
an error, we just leave the old password for the
missing lines.

Task-3184727

Part-of: odoo/odoo#112806
2023-05-04 19:09:55 +02:00
Patrick Hoste 3c5d9e8e1d [REV] base,auth_password_policy: add form view for changing password
This reverts commit 14d97ec2
We revert this to keep the same design when changing password for
one or multiple users.

Task-3184727

Part-of: odoo/odoo#112806
2023-05-04 19:09:55 +02:00
Noe Antoine 69277f846e [IMP] website_slides : add attendee status, improve invitations to course
RATIONALE

Improve and make easier the invitations on courses, whatever the enroll policy.
The goal is to increase the number of attendees easily

PREVIOUS BEHAVIOUR

Before this commit, the attendees of a course were always enrolled.
No distinction existed. Inviting partners meant enrolling them at once, even if
they did not want to join. Also, invitations to a 'members only'-visibility
course were a problem since the invited member could not reach the course page
if not logged in. Therefore the invitation link in invitation mail was often
not usable (403 error). The invitation link did not act as a user creation link
if the partner was not linked to any user

PURPOSE OF THIS COMMIT

After this commit, attendees to a course can either be enrolled (default behavior)
or have pending invitation, allowing to preview the course before joining it.
Also, the invitation links redirect the partner according to their (potential)
linked user, their log in status and the ACL's. All course completion and
invitation status are covered by the new member_status selection field for attendees:
- 'invited' : member with pending invitation
- 'joined' : enrolled member, not started
- 'ongoing' : enrolled member, started but never finished
- 'completed' : enrolled member who completed the course

A) INVITATIONS: ADD ATTENDEES and INVITE

The way to add and invite attendees to a course attendees in now centralized in
two options, the buttons for which being added on the course forms / kanban cards
dot menu. On the attendee list view coming from a course, only the [NEW] button
is shown (= ADD ATTENDEES). Using the buttons will open the invite wizard. (the
same one, the difference being the value of the new boolean enroll_mode)

In both cases, when sending a link to a given partner, it will contain both a hash
based on the couple (partner_id, channel_id) and the value of partner_id. This will
allow giving access to the invited partner even if not logged in and for all visibilities

    1) INVITE: copy the course link OR add partners as 'invited' + send them an email

    This new option is meant for promotional purposes. It will give a preview access
    to potential new members, but will not add them as enrolled. It will send an
    email to partners not already in the active attendees, to invite them to check
    the course

    Clicking the invitation link will lead them on the course page, where a [BANNER]
    will explicitely ask the invited partner to LOG IN or to SIGN UP depending on
    them having a user or not, and explain them that they must first be logged to
    access previews and join / buy the course. Before that, they can only see a
    [PREVIEW] of the course: browse the list of contents (i.e. categories are available),
    to allow them to see whether the course is of interest (forum / reviews are hidden
    too). If they are logged, or once they are logged, they will see the course as if
    it were public, no matter its visibility. (they can join - buy - browse previews)

        [LOG IN / SIGN UP] links (see /identify route): they will bypass the value of
        the 'Free Sign Up' setting and route will 1) check the invitation values
        (hash, partner_id), and that there exists a matching attendee for the current
        course. 2) prepare the signup / login. This prevents the invited partner from
        being locked outside of the course, not being able to join it (as not able to
        create user)

        ENROLL policies:
        -> 'on invite': inviting is considered as granting access. The partner will
            not have to ask for access again, but will be able to join in directly.
        -> 'on payment': users will NOT be able to join the course without buying it.
            The buy button on the course page will be replace by [LOG IN / SIGN UP].
            We do not want them to buy a course and potentially be locked out.
            (further work should deal with the generic case of this issue.)

    2) ADD ATTENDEES: add partners as 'joined' and send them an email

    This option is the same as what existed before: partners are added as enrolled
    attendees and invited by email. When they click on the link, they will be able
    to create an account if they do not have a user, or to log in if they have one,
    whatever the visibility, BEFORE being redirected to the course. They are enrolled,
    so they need to log in in order to use the course. 'invited' members will also be
    enrolled and upgraded to 'joined' and sent a joining email.

    3) About (archived) ATTENDEES and COMPLETION:

    (From task 2199207 on, attendees are now archived instead of deleted, in order to
    keep track of progression. Status and completion updates must be dealt with when
    using invitation / adding attendees)

    Now, [ONCE 'COMPLETED', ATTENDEES REMAIN SO], whatever slides they mark as
    uncompleted / completed or is created / archived on the course. Karma for
    finishing the course is won only once. test_attendee_course_completion_values
    is added. Even archived, we never recompute completion (remains 100) and status
    of 'completed' members. The same is true for 'invited' members, we do not make
    any update. This means that archived 'invited' members can have positive completion.

    In addition to the obvious (recompute status and completion when completing a slide
    as 'joined' or 'ongoing'), we only recompute member_status and completion when
    enrolling an attendee as 'joined', in the method _action_add_members with
    member_status = 'joined'. We explicitely recompute the values then. This happens
    on joining (possibly from an 'invited' state), on adding members as 'joined', or
    when unarchiving a record at least 'joined'.

        3.1) Archived with progress:

        When inviting an archived member with progress, we set their member_status
        to 'invited', and unarchive them. It means that completion could be > 0 for
        active (or inactive) 'invited' members. When enrolling them, we set them to
        'joined' but we need to recompute their completion to update the completion
        value (there may have been changes in the contents) and their member_status
        accordingly.

        3.2) Archived as 'invited' (no progress):

        When inviting them, we simply unarchive them. When enrolling them, they are
	unarchived and set to 'joined', status and completion being then recomputed.

	3.3) A complex and full example.

	Attendee A completed the course C, having 4 contents. member_status is
	'completed' and completion = 100. Then A leaves the course and is archived.
	Later, C gets 1 more content. The member_status and completion do not change.
        A is invited. Its member_status is now 'invited', and completion 100. 3 contents
	are archived. Again, values do not change. A clicks the link and enrolls. It
	is added as 'joined' and _recompute_completion is called. completion is set
	to 50% and status to 'ongoing'. As the completion was 100 but is not anymore,
        the karma for completing the course is lost. They see the new slide and are
	set to completion = 100 and 'completed', winning the course karma back.

B) ACCESS RIGHTS UPDATES

    1) PREVIEW:
    In order to give access to 'members only' courses even without logging in, we
    use the url parameters invite_hash and partner_id. They can access as sudo the
    course but _can_publish and _can_upload stay False. Categories can also be clicked.
    No slides are accessible, only the course page, checking the access values each time
    the channel route changes. See _get_channel_values_from_invite for all the checks on
    the direct invitation parameters invite_partner_id and invite_hash)

    The breadcrumbs and routes are updated to use channel_id instead of slug (since it
    would lead to a 403 error) The course_id routes should only be used in the context of
    an invitation. (generic or direct). Also, the main channel route now checks the access
    rights to the course and redirect to /slides if the access is not granted, useful for
    the generic invitation.

    2) ACLS
    - Slides: invited members to 'members only' courses now have the same access as
    anyone for public courses: previews and categories, once logged in.
    - Course: invited members have access to the course
    - Self-enroll: 'invited' member can self-enroll to 'on invite' courses, this is done
    with a sudo on the /join route.

    3) About ARCHIVED ATTENDEES. [FIX] (tests included)

    (*) In task 2199207, the ACL's were not updated to prevent archived members to have the
    same rights as if they were active. This is because the active value is not tested by
    default in rules. It is done by changing partner_ids into a computed field search method.

C) MODELS

    1) SLIDE.CHANNEL.PARTNER
    - new: invitation_link computed field. It generates invite_hash with course and
    partner_id and contains invite_partner_id as well, used for verifications.
    - recompute_completion will always recompute the completion %. However, member_status
    will only be updated if not currently 'invited' and currently active. One should write
    'joined' on attendees before in order to see the status of an 'invited' member updated.

    2) SLIDE.CHANNEL
    - channel_partner_ids / partner_ids keep the meaning of enrolled attendees/partners.
    partner_ids is now replaced with a compute field, and channel_partner_ids has a
    domain on member_status. search method is implemented (*)
    - new: channel_partner_all_ids / partner_all_ids also includes invited attendees /
    partners. partner_all_ids is also a computed field. search is implemented (*)
    - new: is_member / is_member_invited are computed fields to indicate the current
    user's membership status to the course

    - _action_add_member is removed and _action_add_members now centralizes the logic of
    adding an attendee. It will now return all NEW ACTIVE MEMBERS for the given status.
    The ones unarchived, the ones created, and the ones enrolling from 'invited' state
    for parameter = 'joined'. Therefore, reinvitation of 'invited' members in dealt with
    in action_invite in slide.channel.invite model as they will not be returned.

    3) RES.PARTNER
    As a rule of thumb, the fields and display are the same as before. They cover the
    courses partner is enrolled to. Changes are done to ease the search on partners:
    - slide_channel_ids keeps the same meaning: the courses the partner is enrolled to.
    It is changed to a compute field since we do not want to consider 'invited'
    members. search method is implemented
    - new slide_channel_all_ids contains all the courses: the ones the partner is
    invited to or enrolled in
    - Most compute methods are centralized in a single method and read_group is used.

D) VIEWS AND OTHER MAIN CHANGES

INVITE WIZARD
    - As a course can be only shared via its generic link, the invite wizard now has
    a [TOGGLE] 'send_email' that is visible for public courses and allow to either
    copy and share the generic link, or, if toggled, show and use the email composer.
    - if course is not published, a warning alert message is shown at the top. In
    order to have a clean UI, the form is restructured using a sheet
    - The course field is now hidden and is directly shown in the title of the wizard

ATTENDEE LIST VIEW
    - [NEW] button when coming from a course (i.e. not for reporting), acting as the
      [ADD ATTENDEES] button
    - new columns

OTHER VIEWS
    - Pivot and graph reporting views are added. A default member_status groupby too,
    on all reporting views. The % of completed slides is not used as measure on pivot
    view. However, it is on the graph view to compare completion of different members
    easily. Avg is used as an operator, as sum of percentages does not mean much here
    - Attendees kanban view update and new filters / group by's
    - Quicksearch 'Tags' and 'Responsible' on slide.channel model

MISC
    - Use 'course' instead of 'channel' in readable labels
    - Use 'attendee' instead of 'member' in readable labels
    - Error mgmt: clicking the invitation link may lead to an error, as well as
    accessing a course without the rights. The user will be redirected to the main
    /slides page with the appropriate error message
    - Add a new template similar to the one used to join a course, but for the
    invitation action
    - New template for the popup appearing when joining a course. (Login or Signup)
    - Use fstrings and t-attf when possible
    - Use native js instead of jquery
    - New placeholder if no contents on course page in the front-end
    - Markup is used when possible

E) Invitation Expiration

As the invitation could be used as a promotion tool, there may be a lot of records
created as 'invited'. In order to monitor that number, we use a garbage collector.
It will remove attendees as 'invited', active or not, with completion = 0 and invited
for the last time at least THREE MONTHS before (at least invited once). Also, an
invitation older than 3 months will become expired and will not grant access to
'invited' members.

In order to track the invitation dates, a new field last_invitation_date is added to
the slide.channel.partner model. Every time one invites an attendee, it is set to the
current date. One can reinvite attendees and send them an email more than once. This
may prevent the invitation to be collected by the GC. If not set, last_invitation_date
is considered as expired.

F) TESTS and TOURS

Extensive tests and tours are added for the different new flows coming from
this new distinction between joined and invited members, and invitation flows.
They test functionality, UI, security (access rights) and model correctness.

--- Links ---
Task-2508019
COM PR - odoo/odoo#70291
UPG PR - odoo/upgrade#2572

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-04 19:09:49 +02:00
Noe Antoine dc8b0011e0 [REM] website_slides : remove deprecated enroll route
Removes the route slides/channel/enroll, (slides_channel_join_http method).
The attendees are enrolled in front-end through slides/channel/join,
used in different places through the Join channel button and javascript.
The old route is not used anymore.

Task-2508019
COM PR - odoo/odoo#70291
2023-05-04 19:09:49 +02:00
Mahamadasif Ansari 1ca40a63c9 [FIX] payment: prevent deletion of payment provider if it has external reference
"ValueError: External ID not found in the system: payment.payment_provider_
stripe" is generated because the user deleted the Stripe payment provider
record and its corresponding model tried to access the record of it.

Steps to produce the error:(in >=16.0)
1. Install e-commerce
2. Install 'Payment Provider: Stripe'
3. delete the Stripe from payment Provider
4. Go to the website > Reporting > e-commerce
5. Click Activate Stripe on eCommerce Dashboard

This commit solves the above issue by preventing the deletion
of the payment provider if it has a external reference.

sentry-4041178833

closes odoo/odoo#120534

X-original-commit: 7082ce2460494891e8e063c11678226b164f99e7
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Ansari Mahamadasif (maan) <maan@odoo.com>
2023-05-04 16:53:57 +02:00
Maryam Kia ec93077b8d [IMP] mail: Edited label on edited message
By this commit, If a user edits the message body or changes
the message attachments, the edited label in the blob,
shows the last edit Info.

Task-2664848

closes odoo/odoo#117896

Related: odoo/enterprise#40208
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-04 14:03:42 +02:00
Damhaut Florian (flda) cee32aa16e [FIX] product: Improved error message for pav deletion
What are the steps to reproduce your issue?
- Create a product with more than one attribute.
- Let say color White, black and purple
- Create a 'draft' invoice for the purple product variant
- Remove the 'purple' attribute value from the product
- It will archive that variant (because the account.move linked to it)
- Try to delete the attribute value from menu Sales > Cofinfiguration > Attribute

What is the current behavior that you observe?
- technical error message

What would be your expected behavior in this case?
- non-technical message for end-users

Solution :
- Change both message to tell user he cannot delete the value if the value has been referenced somewhere else.
opw-2623583

missing forward-port of db1e52f0234f73e1bda22a411baba7b1f0994d5a

closes odoo/odoo#120495

X-original-commit: 0c8c43d50a574d73d9d5ac925eb16faf730a76ba
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-05-04 12:15:21 +02:00
Julien Van Roy 91a276058c [FIX] account_edi_ubl_cii: handle paid invoice at import
The edi attachment (for every format in `account_edi_ubl_cii`) contains
a tag indicating whether the invoice is fully/partially paid.

Before this fix, when this tag was filled, a down payment section was
created on the invoice. For a fully paid invoice, the resulting amount
was then 0, so the invoice was marked as "Paid".

This was wrong. The correct amounts need to be kept on the invoices.
This fix no longer creates a down payment, instead a message is logged
in the chatter.

task-3264843
opw-3248200

closes odoo/odoo#120485

X-original-commit: 47333b5b13823ac2812a120f2cb443cb68d7d92c
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-05-04 12:15:18 +02:00
Thomas Lefebvre (thle) 747b60e2c5 [FIX] sale_loyalty: correct display coupon points
Steps to reproduce:
- install website_sale and website_sale_loyalty;
- activate Payment Providers Demo and Wire Transfer;
- put them in 'test mode';
- go to ecommerce;
- add a gift card;
- process the checkout.

Issue:
Depending on the configuration of the payment acquirer used,
sometimes the amount displayed is doubled
(in the display of the gift card amount
after the payment process in brackets).

- Demo in test mode: amount will be doubled
- Wire Transfer in test mode: amount will not be doubled

Remark:
The amounts are correct in the backend.

Cause:
Sometimes the `action_confirm` function is used and sometimes it is not.
When you enter it, the points of the coupon are already set.
Therefore, we add the amount again in the `_get_real_points_for_coupon`.

Solution:
Display the information of the gift card only
when the sale order is validated.
Therefore, there is no need to bypass (with `post_confirm`)
to add the points that will be valid when the sale order is confirmed.
Because with the display correction, we won't see the points.

opw-3166164

closes odoo/odoo#120227

X-original-commit: b3322ecc020e027c1b71ec3a222b8c2e5d0ee97e
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-05-04 12:15:15 +02:00
Hugo Carlier (Huca) 9c0e8d5059 [FIX] project: allows to quick create record from My Tasks kanban
The refactor of the kanban quick create implemented in
https://github.com/odoo/odoo/pull/117449 introduced a traceback when
creating a task from the My Tasks kanban view due to the presence of
'default_personal_stage_type_ids' key in the context.

This commit fix that by removing this key from the context in the
customization of the kanban view for project.task model. It also add a
js tour test to ensure that personal tasks can be created from the quick
create form in the My Tasks kanban view.

Steps
=====
- Install module project
- Go to the view "Tasks -> My Tasks"
- In the main Kanban View click on "New"
- Enter a Task title and clicl on "ADD"

Issue
=====
A traceback appears indicating that the value of the field user_id is
missing for the model project.task.stage.personal and the task is not
created.

Cause
=====
In kanban and list views, when the records a grouped by a given field, a
key is added in the context when creating a record from one of the
resulting categories. This key is of the form:
`default_fieldGroupedBy: current_category_value`

In the case of the view My Tasks, the records are grouped by their
fields personal_stage_type_ids (M2M). Therefore, the key
default_personal_stage_type_ids will results in a write in that M2M
table when creating the record. But the way personal stages are managed
in project is as confusing as it is mindblowing and the M2M table
storing the relation between task and personal stages is also the table
that store records from the model project.task.stage.personal. And this
model also as a field user_id that is required. Therefore
at creation of the project.task record with that key, the orm will miss
a user_id for the newly created project.task.stage.personal.

Fix
===
The correct way to add/modify a record project.task by setting its
personal stage is actually to use the already existing methods of
project.task, i.e. _inverse_personal_stage_type_id. Therfore, instead of
modifying directly the M2M relation, update the computed M2O field and
let the inverse method to the job of personal stage assignment.

To do that, the value contained in the context for the M2M relation is
copied in the write value of the M2O (personal_stage_type_id) and the
key in the context corresponding to the M2M relation is deleted.

task-3281005

closes odoo/odoo#119055

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-04 12:15:10 +02:00
Guillaume (gdi) bbbd4246b1 [FIX] web: remove prohibited dropzones of the menu editor
In the website menu editor and in the studio menu editor, the user can
drag & drop the elements that constitute the menu of his website/app.
Users can also put a menu into another menu to create a sub-menu. For
the website, we allow two levels of menu but not more. For studio we
allow 5 levels of menu. When the user starts to drag an item, dropzones
can be drawn on the prohibited level (3 in website, 6 in studio) while
he can't create this level of menu. This commit adds a css rule to hide
those forbidden dropzones.

task-3251032

closes odoo/odoo#120497

X-original-commit: dac80feb84d213e5e0a1aa140fa019944ea4e826
Signed-off-by: loco-odoo <loco@odoo.com>
2023-05-04 10:00:45 +02:00
Mountain Tran a774b5ec7f [FIX] point_of_sale: correctly translate some UI elements
Before some translations didn't work in the point_of_sale because in owl
you can't use t-set to manage translations. In cashMovePopup, _t was
used at a time when loading translations is not yet guaranteed.

Now we have changed _t to _lt to ensure that the translation is done
correctly. For the t-set, we have added the translations in static
properties of the concerned components.

closes odoo/odoo#120403

X-original-commit: b2b9f760844304858aa64c51e7bda87190b11386
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-05-04 10:00:42 +02:00
Alexandre Kühn c0ce6ca7b6 [FIX] mail: do not auto-open chat window when self-posting a message
Before this commit, when posting a new message in a channel in the
discuss app, a chat window of this channel was automatically open.

This happens because new message from self where considered
new messages in a channel, and all new messages in a channel
were automatically opening a chat window.

This commit fixes the issue by not making self-authored messages
automatically open the chat window.

closes odoo/odoo#120478

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 08:56:20 +02:00
dasz f53800a17d [IMP] hr_holidays: ignore future leaves in accrual computation
Current behavior:

An accrual uses all planned leaves to calculate how many days it can
give, even if the leaves are planned in the future and could be
cancelled.

Desired behavior:

An accrual should only take into account leaves that have already been
taken or already started, and ignore future leaves.

After this commit:

New context key 'ignore_future' for method _get_employees_days_per_allocation
decides if future leaves should be taken into account or not. Some
use cases need to take into account future leaves, others don't.

task 3207843

closes odoo/odoo#120456

X-original-commit: d917a406fc7933af852ad5338533b93fc3fd2218
Related: odoo/enterprise#40678
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-04 08:56:17 +02:00
dasz 1b8b35e216 [FIX] hr_attendance: account for lunch break in overtime calculation
Remove lunch hours from work intervals so that overtime is not calculated when it's not due
tests adapted to take into account lunch period

task 3217799

closes odoo/odoo#120455

X-original-commit: 97c052432a25a1461de23fd8ab0c73ffe9b084ff
Related: odoo/enterprise#40677
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-04 08:56:12 +02:00