Commit Graph
160836 Commits
Author SHA1 Message Date
Harsh Bhatt (habh) 48205129fa [FIX] l10n_in_edi*: fixed document link in settings
l10n_in_edi:

Before this commit : In Accounting settings the documentation link
no longer works.

After this commit : In Accounting settings the documentation link
is updated and works.

l10n_id_edi_ewaybill:

Before this commit : In Accounting settings the documentation link
no longer works.

After this commit : In Accounting settings the documentation link
is updated and works.

task-3247082

closes odoo/odoo#120237

X-original-commit: cb905342c20201501d97ebb2ee2f9c154869f392
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-05-05 15:58:42 +02:00
flvr-odoo 30b283fe7d [FIX] hr_expense: prevent linking of expense with no perm
Previously, a user could link his own expenses to a expense sheet
of someone else.

This would not be allowed upon creation but was allowed when updating
the values of the expense.

This commit add a simple check at the beginning of the write()

closes odoo/odoo#120661

X-original-commit: 884510b1496e0a0eba7171f4ef4bb749856cb1bf
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-05-05 14:55:10 +02:00
Alexandre Kühn c5c3362a21 [FIX] mail: arrow up/down should change selection inside composer
Before this commit, when composer had some text content in
multi-line, arrow up/down was not jumping to previous/next
line.

This happens because the navigable list is active even when not
shown, and was preventing all keydown events.

This commit fixes the issue by limiting handling of keydown
events of navigable list to when it is shown.

Also fixes a bug where the quick edit of last message was triggered
when composer text was non-empty with ArrowUp. This should only
be triggered when the composer text input is empty.

closes odoo/odoo#120657

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-05 14:55:08 +02:00
rhe-odoo d28363ba5b [FIX] pos_sale: correctly assign partners in the invoice
When settling a sale.order from the pos app, it's possible that the sale.order
have different partners assigned to it (partner_id, partner_shipping_id,
partner_invoice_id). After this commit, we are now properly assigning these
partners to the generated invoice.

Additionally, this commit makes the settling of sale.order more robust by
avoiding issue on having multiple incompatible sale.orders in a pos.order (more
than 2 sale.orders and their partners are not the same). After this commit, we
are only reusing the current pos.order as container of the new sale.order to
settle if the sale.order is compatible to the current pos.order. Basically, we
now only allow adding new sale order to the current order if the partner_id,
partner_invoice_id and partner_shipping_id of the new sale.order are the same to
the current pos.order's linked sale.order. In other words, if the new sale.order
to settle is incompatible to the current pos.order, we create a new pos.order to
settle that sale.order.

closes odoo/odoo#120649

X-original-commit: 2782bedafb9fcbe7c65f4c6951ce270c3a5a5bd3
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-05-05 14:55:05 +02:00
Thomas Lefebvre (thle) bc2d796dbc [FIX] hr_attendance: prevent the edition of employee_id
Issue:
A user has write access rights to modify his own attendances.
However, he can modify the `employee_id` field.
This can cause attendances to be moved to other employees.

opw-3280850

closes odoo/odoo#120632

X-original-commit: 1c25a9b964e9e2acf9d431897e83cf72ecdca1cb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-05-05 14:55:00 +02:00
Sébastien Theys e6b3323237 [REF] mail: move channel commands to discuss folder
Part of task-3265211

closes odoo/odoo#120429

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 14:54:57 +02:00
fdardenne 6c881fda04 [FIX] mail: activity view: fix the records limit
The activity view is an aggregation view, meaning that we show all the
activies with no limit of records.

Steps to reproduce:
There is no easy way to reproduce the bug, the database should be
populated with more than 80 records in a model and have an activity
planned for the 81th record.

Current Behaviour:
The Activity view loads all the activities without limit and so the
activity for the 81th record. The problem is that the 81th record does
not have been loaded due to the default limit of the RelationaLModel.
Therefore the activity view crash because it cannot fetch the missing
record for a loaded activity.

Expected Behaviour:
The activity view laods all the activities but also loads all the
records so it can render them.

closes odoo/odoo#120654

X-original-commit: 885c7bb33a3cb25962c090290e6b27bc11a71f41
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-05-05 13:52:34 +02:00
Alexandre Kühn 78b275f54d [REF] mail: simplify message template
Simplify template so there are less code duplication between
editing state and non-editing state.

Also fixes following small style issues:
- missing opacity-25 when editing message of others
- expanded options of message come on top of jump present alert

closes odoo/odoo#120550

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 13:52:29 +02:00
Julien Mougenot 6cdbce8490 [IMP] form: Support daterange field dependencies
This commit allows the server-side form arch parser used in tests to
also include the "end_date_field" defined in the `options` attribute of
daterange widgets in the dictionnary of fields found in the arch.

The daterange widget is currently the only case where the client adds
another editable field dynamically in the list of known fields. This is
not ideal since the server does not know that when computing the initial
arch sent to the client. The workaround is to also include the
"end_date_field" in the arch with `invisible="1"`, and to add a special
case for the server-side form arch parser used in tests.

Ideally we would want a proper way to define field dependencies in the
arch, but since this widget here is the only use case for that feature
it is better for now to handle it in this simple, more naive way.

Part of task 3121497

closes odoo/odoo#112171

Related: odoo/enterprise#38569
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-05 13:52:22 +02:00
Julien Mougenot 10dc896c1e [REF] *: Adapt views to Owl DateTimePicker
This commit follows the addition of the OWL date picker and intends to:

- update views calling daterange widgets to use the new syntax (and
remove the end date field from the view in most cases);

- change the remaining components extending the previous DatePicker and
DateTimePicker components.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:22 +02:00
Julien Mougenot c6637e537e [REF] *: Remove date picker libs from main bundles
This commit removes both DateRangePicker and TempusDominus libraries
from the common asset bundle. The legacy widgets still depending on
these libraries will now load them lazily when instanciated.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:22 +02:00
b5794e89e1 [IMP] web: Owl DateTimePicker
This commit introduces a date picker OWL component meant to handle the
following use-cases:
- date picker
- date & time picker
- date range picker
- date & time range picker

Basically, this component is the union of the two previous third-party
libraries handling these cases: TempusDominus and DateRangePicker.

New components introduced:

* The main addition of this commit is the `DateTimePicker` itself which
handles the display and interactions of the calendar and time pickers.
> see @web/core/datetime/datetime_picker

* The picker can then be coupled to an input using the
`useDateTimePicker` hook. The purpose of this hook is to handle events
on a given input element and syncronize its value to a date picker it
will spawn in a popover.
> see @web/core/datetime/datetime_hook

* Lastly, a simple `DateTimeInput` component will render an input and
call the hook mentioned above to handle it. This component is
effectively replacing the previous DatePicker and DateTimePicker
components (note that it does not handle range values).
> see @web/core/datetime/datetime_input

Another noticeable change of this commit is the definition of daterange
fields in views:

- Previously, the arch would have to define both fields
and bind them via their options, while also adding an arrow between
inputs or other forms of connection.

- In the new implementation, only the start date field must be declared,
and a date range can be spawned by providing an `end_date_field` in its
options.

Example:
```xml
<field
    name="start_datetime"
    widget="daterange"
    options="{'end_date_field': 'end_datetime'}"
/>
```

warning Added limitations:

- this new way of declaring date ranges means that templates have been
revised to declare one field tag instead of two. This means that list
views using date ranges have lost the ability to be sorted on their end
date fields.

> Justification: the current use cases have been reviewed and it has
been decided that it was not needed to sort on the end date on the
affected list views.

> Workaround: drop the date range and declare both fields as simple date
pickers (i.e. without the end_date_field option).

- all modifiers applied to a field using a date range will be copied and
applied to the end date field. There is no way to define modifiers
specific to one field or the other.

> Justification: there was no use case where one of the two fields
needed specific modifiers.

> Workaround: same as the previous point: split the range into 2 simple
date picker fields.

Additional notes:

- the widget="daterange" is not mandatory in form views, but is required
in list views because only fields with explicit widgets will not be
rendered as simple <span> elements. The date range feature will be
available as soon as an end_date_field is specified.

- as the end date field is not explicitly defined in the view anymore,
any modifier depending on it need to have it defined as invisible
somewhere in the arch.

Task ID: 3121497

Part-of: odoo/odoo#112171
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Pierre Pulinckx <pipu@odoo.com>
2023-05-05 13:52:22 +02:00
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