Commit Graph
160800 Commits
Author SHA1 Message Date
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
Nasreddin Boulif (bon) 38aaaeb27e [FIX] website_slides: Raise error if not responsible on invite
Steps to reproduce:

- Install `E-learning` module
- Create a user X with only "Officer" as rights for `E-learning`
- Login with user X
- Go to `E-learning` and open any course
- Ensure that the user X is not the responsible and that the course
  enroll policy is set to "On invitation"
- Invite any user not already a member

Issue:

  No user was invited (not added as member) and no warning message
  raised.

Cause:

  Due to the ir.rule "Channel: officer: create/write own only", the
  `Officer` user can only edit (and therefore invite members) on
  courses where he is responsible.

Solution:

  Add a param `raise_on_access` (set to False by default) to the
  `_action_add_members` & `_filter_add_members` methods.

  In the wizard, call the `_action_add_members` method with the
  `raise_on_access` param set to True so that the error is only raised
  in this flow.

opw-3133733

closes odoo/odoo#120114

X-original-commit: 515912108aef86376349df5eee51b4a5d664d2a4
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-04 08:56:07 +02:00
620c901847 [FIX] account,purchase,sale,l10n_it_edi: tax totals with global rounding
# Steps to reproduce

* create two 17% sales taxes. We'll call those taxes `17a` and `17b`.
* set rounding method to global
* create a SO with the following 2 lines:
  * Price = `50.4`, Taxes = `17a`
  * Price = `47.208`, Taxes = `17b`
* note that the total tax amount on the SO is `16.59`
* confirm and invoice the SO.

You should see that the total tax amount on the invoice is `16.60`. The
invoice and SO should have the same tax amount.

opw-3179228

closes odoo/odoo#120224

X-original-commit: 715d0e269c3d42a5e25f8ddf648d275069354aaa
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Co-authored-by: Laurent Smet <las@odoo.com>
Co-authored-by: Yolann Sabaux <yosa@odoo.com>
2023-05-04 07:58:42 +02:00
Vincent Schippefilt 7d276aa941 [IMP] web: add reference fields to web_read
add support for fields of type `reference` and `many2one_reference` to `web_read` and `unity_web_search_read`

for both you can add a field_spec requesting fields of the "co-model":

request:
```python
{
    #reference
    'field_reference':
        {
            'fields': {'write_date': {}},
        }

    #many2one_reference
    'm2o_reference_id':
        {
            'fields': {'display_name': {}, 'write_date': {}},
        },
    'm2o_reference_model': {}
}
```
response:
```python
{
    'id': ...,
    #reference
    'field_reference': {
        'id': {'id': 3, 'model': 'comodel_name'},
        'write_date': '2004-11-23 11:30'
    }

    #many2one_reference
    'm2o_reference_id': {
        'id': 3,
        'display_name': "special first day",
        'write_date': '2004-11-23 11:30'
    },
    'm2o_reference_model': 'comodel_name',
}
```

closes odoo/odoo#119995

Task-id: 3284222
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-05-04 00:46:53 +02:00
Camille Spiritus 6f71d0c288 [IMP] account/l10n_ch: usable demo data for QR bill
Until 15.0, to show the behaviour of the QR billing in Switzerland, you had to manually configure a bank account for CH company and create a QR Bill compliant customer before creating an invoice, which was time consuming in the contaxt of a demo.

Updated the demo company's bank account and added an adequate customer to ease the process.

task-3264826

closes odoo/odoo#120349

X-original-commit: 69aab9f4db89f8bf3ba8f29a96fbf9eabd4bac4a
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-03 23:12:40 +02:00
william-andre 3d2f6a0c10 [FIX] account_sequence: flush fields depending on sequence
Because we are flushing, and because the business code might be flushing
elsewhere (i.e. to validate constraints), the fields depending on the
sequence field might be protected by the ORM. This is not desired, so we
already reset them here.

The symptoms were that sometimes the related field `move_name` on
`account.move.line` would stay at `/` even after the new `name` was
given.

closes odoo/odoo#120488

X-original-commit: e7db87db57e4f98719602502d80948a5ed51adc2
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-03 22:09:47 +02:00
Gauthier Wala (gawa) 4523a250e0 [FIX] account: avoid wrong taxes quick encoding
How to reproduce:
- Activate l10n_be and go on a Belgian Company
- Activate Quick Encoding on Bills
- Setup account 600000 with taxes 12% (Sales) and 12% M (Purchase)
- Create a Bill
- Put 112 as the amount Tax Incl.
=> Both taxes are put on the line, which makes no sense, resulting
a sale tax on a purchase document.

It was forgotten in https://github.com/odoo/odoo/commit/85d89a986b6adcf9d0ac0ce57599d4b2678b59a3

closes odoo/odoo#120486

X-original-commit: 04287db0045eefed1b03e04d745874caf206731f
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-03 22:09:45 +02:00
Antoine Vandevenne (anv) 328f64ab51 [IMP] payment(_adyen): support multiple payment forms on the same page
This commit addresses an issue with the checkout form displayed on the
portal page of the Subscriptions app: when only one payment provider was
available for checkout, and it required an inline form to be displayed,
the latter would not be shown, and customers were able to hit the "Pay"
button, resulting in a client error. The problem was that Subscriptions
now simultaneously displays two payment forms on the same page, one for
checkout and one for managing payment methods, which was not supported
by the payment engine.

closes odoo/odoo#120482

X-original-commit: 91d701e34a25d2ceada1679f36a9cdbb96c6c019
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 22:09:42 +02:00
Lucas Lefèvre bb6428825b [FIX] spreadsheet: support properties field in lists
Steps to reproduce the issue:
1. Project> select Project > Task> List view
2. Studio list view > Add existing properties field
3. Go back to list view > Favorites > add to spreadsheet
4. New Spreadsheet > Will receive error

opw-3284273

closes odoo/odoo#120473

X-original-commit: 5eb80e34db2e54b56164ea4b98bea3cebb09312b
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-03 20:08:59 +02:00
FrancoisGe 33eeef69f1 [IMP] web: handle before/after saved Record
This commit adds to the Record Component, the possibility to pass
the onWillSaveRecord/onRecordSaved props that will be
triggered before the save of the Record and after it respectively.

closes odoo/odoo#120448

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-05-03 17:25:01 +02:00
Alexandre Kühn 9f115fce17 [FIX] mail,*: fix style in 1st column of activity view
Task-3290752

closes odoo/odoo#120189

X-original-commit: a97c86a2b962f56955e3c16b7ad99cabb0b13b9c
Related: odoo/enterprise#40564
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-03 17:24:58 +02:00
Maruan Aguerdouh (magm) 6a5cc4c7b4 [FIX] crm: lost button don't trigger lost reason popup in list for leads
Steps to reproduce:

- Install crm
- Go to settings and activate leads in crm.
- Go to leads list and select any lead, now mark it as lost.

Issue:

It will ask for lost reason. But if we do it from the Leads form view,
we don't get to set any reason. I discussed with the PO and we don't
want to add the lost reason in the leads.

Solution:

Modified action of lost so it takes leads into account.

opw-3119748

closes odoo/odoo#120033

X-original-commit: 3834577a8beec2f9eb4a30dd8a0ae72403041af5
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-05-03 17:24:53 +02:00
Patrick Hoste 39fdb8064c [IMP] website_slides: allow course to have prerequisites
This commit allows the course manager to add prerequisites
courses to a course so that the final user will be notified
on the frontend he has to take some courses before the one he
wants. He could however request access to the course and
take it without taking the prerequisites before if the access
has been granted.

Task-3213628

closes odoo/odoo#114710

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-03 16:19:55 +02:00
Naman Shah 8272b1ff0a [FIX] crm: remove the field date_closed from demo data
Purpose:
The purpose of this commit is to change the current behavior of days to close
graph generating from customizable desk demo data.

Specification:
For the opportunities, the day_close field is a compute field depending upon the
date_closed field. For the customizable desk demo data, the date_closed field
pre-existed, due to that customizable desk opportunity was not won or lost but
the graph report was generated.
so, this commit fixes the current behavior for customizable desk opportunity.

Task-3278039

closes odoo/odoo#120433

X-original-commit: e368725b3a042c4071986d0c8d49f724d76a7416
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-03 15:05:04 +02:00
Kevin Baptiste 7fc04795a8 [FIX] hr_recruitment: count archived/refused for other applications
The fix introduced in odoo/odoo#119017 was no longer taking into account
the refused/archived applications, showing a negative number in some
cases.

task-3293460

closes odoo/odoo#120426

X-original-commit: 55e279f96c9d878103657f437222066ae74dcf0f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 15:04:56 +02:00
qdp-odooandLucasLefevre 9221ad5e53 [FIX] spreadsheet_account: don't include unposted entries by default
All figures coming from the accounting dashboard should be, by default, excluding the unposted entries since this is the default filter when opening the reports.

opw - 3268676

closes odoo/odoo#120424

X-original-commit: fd20e65fbfeadcc477ea7179900741dd6e98cf16
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>
2023-05-03 15:04:53 +02:00
Manushi Shah (mash) 26c6df8bc3 [FIX] marketing_automation: fix the display of mobile preview
Prior to this commit:
When the mobile preview is clicked in the mailing template of the marketing
automation, the preview is empty. The preview is seen after closing all the
dialog boxes, but it is still not obtained as expected.

Post this commit:
The mobile preview is working properly while clicking on the preview button.

Task-3272504

closes odoo/odoo#120415

X-original-commit: 095b456bf518a6730b5b0039fef40f4cfe8e3511
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-03 15:04:49 +02:00
Mayurrajsinh Rathod 3243a4f0d6 [FIX] website_slides: modify error message
Modify user error message when answering an unpublished quiz.

Task-3255897

closes odoo/odoo#120414

X-original-commit: 8a0e5749ea166ce576d1ed4e95b53b6e37332576
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-03 15:04:47 +02:00
Joseph CaburnayandLoan 867f4265be [FIX] l10n_fr_pos_cert: update translation
closes odoo/odoo#120266

X-original-commit: 02fc3af79c33649bb32702bbf2d1e3e3a0a1827d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Co-authored-by: Loan (LSE) <lse@odoo.com>
2023-05-03 15:04:44 +02:00
Aman Patel 85e5c2b8d1 [IMP] web: change label of delete modal confirm button
This commit changes the label of the delete modal confirm button from 'Ok' to
'Delete'.

TaskID-3264614

closes odoo/odoo#119025

Related: odoo/enterprise#40487
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-05-03 15:04:38 +02:00
Nicolas (vin) ba6ff1b616 [FIX] account: res partner bank bugprovement
Improve some aspects of the recent res partner bank improvement:
    - the url toward the docs open in a new tab
    - fix the account creation by disabling the readonly when trusted
      while the record isn't existing in the database yet
    - improve the visual of the setting by putting it in the accounting
      section

closes odoo/odoo#120423

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-05-03 13:57:29 +02:00
amdi-odoo cda43b6076 [FIX] website_profile: fix rank image display
Fix the rank image display which has currently
disappear by making it appear again in the xp circle.
Also making sure the xp circle tooltip is correctly
showing on hover.

Task-3285548

closes odoo/odoo#120408

X-original-commit: e96bd5a7ee4397440503ab4605f2df29d3a2d6f2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-03 13:57:27 +02:00
David Monnom (moda) f23edc1729 [FIX] pos_restaurant: wrong arguments for orm.call function
The first two arguments of the call() function of the orm service
have been inverted.

This is fixed.

closes odoo/odoo#120404

X-original-commit: 0a4e035083d6d3d62d0041fad62f71668dd77d7e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Monnom David (moda) <moda@odoo.com>
2023-05-03 13:57:24 +02:00
Stanislas Sobieski 7496a710b9 [FIX] cloc: avoid memory issue on big file
Before this commit:
Files that should be ignored in the manifest but aren't (js library for example)
it can happen that files have huge lines, the regex to substract the
comments will overuse memory.
For example, a file of 13M with a line of more that 8M characters, the
memory consumptions peak at 1.7G

The results might be different, but it's an acceptable compromise

closes odoo/odoo#120376

X-original-commit: 63b13af2e49a83168d4304a06b6489c4b86eabf6
Signed-off-by: Thibault Francois <tfr@odoo.com>
2023-05-03 13:57:17 +02:00
Claire Bretton (clbr) 23bb2eff38 [FIX] l10n_ch: fix de+it translations of QR codes
QR codes had different translations than the official ones.
That prevented the QR-bill to be submitted through Snailmail.

Reference of translations (p.58): https://www.six-group.com/dam/download/banking-services/standardization/qr-bill/ig-qr-bill-v2.2-en.pdf

closes odoo/odoo#120371

Opw: 3223714
X-original-commit: 351b4e4b69629624158bad590c39e7930b6ae75f
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-03 13:57:14 +02:00