Commit Graph
166177 Commits
Author SHA1 Message Date
Saurabh Choraria 85b5ddfc0d [FIX] base_import: accept single character in text delimiter
When a user tries to import the CSV file with an empty text delimiter
or more than one character in text delimiter at that time the traceback
will be generated.

Steps to reproduce:
- Install Accounting module.
- Click on import in the bank statement.
- Select any CSV file for the bank statement line or can download and import
this file - https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
- Enter empty text delimiter or more than one character in text delimiter.
- Click on the test or Import button.
- Error will occur.

Error: ValueError: Unsupported file format "text/csv", import only supports
CSV, ODS, XLS and XLSX

The issue is occurring because text delimiter (options['quoting']) is used
as quotechar while reading csv file and quotechar is always a single
character string. Check here -
https://github.com/odoo/odoo/blob/0fde590bee71618f78e5f954349530bd007c62cf/addons/base_import/models/base_import.py#L494-L497

To solve this issue the length of text delimiter has been checked and if it
is not equal to one then a warning is given to the user.

sentry-4390461991

closes odoo/odoo#138638

X-original-commit: 1f4aa620779ebe6a0cb7f7ca1910080a258d6fac
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-10-13 14:14:05 +00:00
tsm-odoo 8bf49da5a7 [FIX] website_livechat: fix tour failing nondeterministically
This commit fixes the `website_livechat_chatbot_flow_tour` that was
failing in a nondeterministc way. This is due to the tour sometimes
taking more than `60` seconds which is the default timeout for python
tours.

Most of the time is consumed waiting for the user to finish its
multiline input. This issue is solved by shortening the delay to
consider the multiline input as done: from `10`s to `500`ms.

fixes runbot-24557

closes odoo/odoo#138629

X-original-commit: cdca70941dab1b20dca9bdf9d44d354327176b59
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-13 14:14:04 +00:00
Sina Chaichi Maleki (cmsi) 6357e6dd3a [IMP] hr_recruitment: refine user access to job positions view
Previously, a user could be a recruiter but not an interviewer. With the
new changes, the recruiter role is also an interviewer. On the job
positions kanban view, the functionality of the "X to Recruit" link
depended on whether a user was an interviewer or not. Now, since an
admin is also an interviewer, they only have interviewer access and can
only see the application list, which is not desired. In this commit,
we've changed the condition from being an interviewer to being a
recruiter. Consequently, the admin can navigate to the job position
edit form while interviewers only see the application list. Users with
neither role won't see the kanban view at all, so there's no concern
regarding that.

closes odoo/odoo#138628

Task: #3471557
X-original-commit: 06712c3a2c34ece2dc1b93180a270da46e7e5966
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 14:14:00 +00:00
Ken Luzuriaga 4c0a5ed445 [CLA] add new member to CLA Trescloud
closes odoo/odoo#138627

X-original-commit: 04d199187e2d698f6adfcca34121454ed0a188b6
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-13 14:13:58 +00:00
Brieuc-brd 1d512330a5 [IMP] pos_restaurant: add app icon
task-3542892

closes odoo/odoo#138561

X-original-commit: 837b121a67ffd8c3e7d7d64d4e2c20e5a0f46951
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-13 14:13:56 +00:00
Pierre Paridans 35122d5c7c [REF] *: use raw CSS rules instead of extend utility classes
*:mail,portal,project,web

task-3546717

closes odoo/odoo#138615

Related: odoo/enterprise#48920
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-13 11:46:30 +00:00
Pierre Paridans daf05c241e [IMP] calendar,web: extract static CSS rules out of loops
This commit seperates the static and color dependent rules for the
Calendar view and app to avoid duplicating the static ones.

task-3546717

Part-of: odoo/odoo#138615
2023-10-13 11:46:30 +00:00
Ricardo Gomes Rodrigues 8b4719a0d0 [FIX] account: allow import of receipts
Steps to reproduce:
- Activate the receipts in the Accounting Settings
- Go to Vendors -> Receipts
- Upload a file
-> Error "The journal in which to upload the invoice is not specified."

opw-3544292

closes odoo/odoo#138612

X-original-commit: 00bad1954cd0bda21a7ec58f8ea8000a78e551ad
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-10-13 11:46:29 +00:00
Aaron Bohy c5f92537fc [FIX] web: search view: evaluate invisible attrs
Since [1], invisible attributes on views are no longer evaluated
server-side. In search views, field and filter nodes can have an
invisible attribute which can be static ("1" or "True") or dynamic,
depending on the context (e.g. "context.get('something')"). Before
[1], in the arch received by the client, the value of the invisible
attribute was always static as "context.get(...)" expressions were
evaluated server-side. This is no longer the case, and we thus have
to evaluate the expression client side.

Before this commit, the invisible attributes in search archs were
simply ignored if they weren't static. This could be observed for
instance in Project > open a project: the "Private tasks" filter
was available even though it is dynamically invisible, and shouldn't
be there.

This commit ensures the invisible attributes are always taken into
account and evaluated.

[1] odoo/odoo@ba1a5509fa

closes odoo/odoo#138590

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 11:46:28 +00:00
tsm-odoo 2a69035e38 [FIX] im_livechat: do not overwrite author of message format
Before this commit, the `_message_format` override of the live chat
module would overwrite the author. Since [1], values provided by the
live chat override are incomplete which result in incorrect message
display in the discuss app. This commit modify the live chat override
to enrich the author instead of totally overwriting it.

Steps to reproduce:
- Log in with mitchell admin
- Change its live chat user name in its profile
- Open a chat with a visitor
- Send a message with mitchell
- The message is incorrectly marked as sent by the visitor

[1]: https://github.com/odoo/odoo/pull/137276

closes odoo/odoo#138533

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-13 11:46:24 +00:00
maad-odoo 038b0e4fd2 [FIX] mail: Left border of the 'send' button is missing after clicking on it
Before this commit:
When we click on 'send' and 'log,' the left border disappears for
a short while.

After this commit:
The left border on the 'send' and 'log' buttons is visible even after
clicking on them.

task-3549138

closes odoo/odoo#138513

X-original-commit: ec42f19ad2996f1c471ea520ce0211f4d9e2ab0a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-13 11:46:23 +00:00
Pierre Rousseau cb5d5fe15a [REF] spreadsheet, spreadsheet_dashboard: use MultiRecordSelector
This commit replaces the RecordsSelector component by the MultiRecordSelector
component in the global filters of the spreadsheet and the spreadsheet
dashboard. Thus, the RecordsSelector component is not used anymore and
can be removed.

Part of task-id 3433922

closes odoo/odoo#138464

Related: odoo/enterprise#48857
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-13 11:46:21 +00:00
Pierre Rousseau 29e301fe32 [IMP] web: multi record selector: add keyboard navigation
This commit adds keyboard navigation to the multi record selector.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau d949e001c9 [IMP] web: introduce useTagNavigationHook
Currently, the newly created component `MultiRecordSelector` (https://github.com/odoo/odoo/commit/bd0f2c6d799961b0a41222652eae7214c01dc5fe)
does not support the keyboard navigation between its tags (selecting or
deleting a tag). This behavior is currently implemented in the
`Many2ManyTagsField` component. This commit extract this behavior from
the `Many2ManyTagsField` component into a new hook that will be used by
the `MultiRecordSelector` component.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau 78a859e0a1 [IMP] web: support placeholder for record selectors
This commit introduces the support for placeholder in record selectors.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Roy Le bb323e3989 [FIX] account, sale: avoid error when internal user (no accounting
permissions) edit information at /my/account

Issue:
Internal user cannot edit their information (email, street,...) at
portal without permissions in the accounting

Analyze:
Because the method `can_edit_vat` has a search from the account.move
model, it causes an error

Fix:
Use sudo to avoid error when searching

closes odoo/odoo#138291

X-original-commit: eb9505375483d18cf21fbaf8e5a60398d5c041c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-13 11:46:18 +00:00
Alexandre Kühn 631ae1c4d8 [REF] mail: simplify JS discuss models further
- Remove "channel" field in thread formatter.
- Pass `type` for all persona formatters.
- Remove some snake_case to camelCase conversions.
- Add support for inverse fields in discuss JS models.

Details:

1. [REF] mail: remove field 'channel' in thread formatter

This field was used for channel-specific fields, which made
sense when there was a dedicated Channel model that was modeled
with composition with Thread.

To simplify formatter of threads, it's best to flatten props
so that channel-specific fields are immediately available on
thread model. This will improve insertion of data with Threads.

This commit also makes the following other changes:

- remove `discuss.channel/legacy_insert` to use
   `mail.record/insert` instead.

- Introduce `toData()` on record, which is helpful to have record
  in data format e.g. to pass as a JSON.stringifiable object.

2. [REF] mail: slightly simplify Message.insert from notif

The handling of `mail.record/insert` for Message was handling
transition from starred non-empty message to starred empty message.

To simplify all record insert from server formatted data, the notif
data is just inserted in Message. The adjustment of starred counter
is managed at model level.

This is a prerequisite to significantly simplify all
`mail.record/insert` handling.

3. [REF] mail: rename 'res.users.settings' notifications

Before this commit, notifications related to changes of user
settings were using named notification `mail.record/insert`.

This named notification should be only used for Discuss data that
should be inserted in models. `res.users.settings` is not integrated
in Discuss model, thus it has no reason to use this named
notification.

This commit rename the notification name to `res.users.settings` for
these specific notifications. This prepares simplification on
handling any `mail.record/insert` notifications that should simply
call `Record.insert()`

4. [REF] mail: make dedicate notif for Thread/fold_state

This was using named notif "mail.record/insert", which should
be used to immediately insert data in models. This is however
a dedicated notification to imperatively manager chat window
state based on timing of receiving thread data.

This may eventually become a `mail.record/insert` in the future,
but right now it's much simpler to define it as its own named
notification, in preparation to simplify `mail.record/insert`
notifications handling.

5. [REF] mail: remove Channel in mail.record/insert

This is replaced by `Thread`, so that these data can be
immediately inserted in Thread model.

6. [REF] mail: simplify slightly Attachment.update()

Now that data containing commands is supported, we could
just assign with the command rather than destructure and pick
the dict data part.

7. [REF] mail: introduce assignIn() utils

This function helps reduce LOCs from using the "in" conditional
in sequence:
```js
if (a in data) {
	this[a] = data[a];
}
if (b in data) {
	this[b] = data[b];
}
if (c in data) {
	this[c] = data[c];
}
```

To simply:
```js
assignIn(this, data, [a, b, c]);
```

8. [REF] mail: remove snake_case to camelCase conversion in models

They exist for the sake of keeping Python code snake_case and
JS camelCase. While it's good that each language have a community
that prefer syntax convention, when a codebase uses both languages
and they should work with the same data, it's not great to convert
snake_case to camelCase and vice-versa all the time.

Since server has authority over the data, the server chooses the
format for the keys. Most of them are snake_cased, therefore this
is usually the one we pick.

9. [REF] mail: rename Message.messageReactionGroups to Message.reactions

Easier to read, and matches relation name in JS model

10. [REF] mail: remove explicit assign of some many relations in Message

This reduce amount of custom code in insert(), in preparation to make
all models behave the same in response to inserting data.

11. [REF] mail: rename Thread.customName to Thread.channel_custom_name

To match server data field name, and avoid useless conversion in JS.

12. [REF] mail: simplify Message.insert for recipients

Have formatted data contain `type: "partner"` so it can be assigned
in relational field without adding `type: "partner"` manually in JS.

13. [REF] mail: introduce inverse field in discuss models

With this commit, fields in different models can be linked
together, so that one is mirror of the other field.

This simplifies some `onAdd`/`onDelete` that were added to
sync such fields, and this also simplifies insertion in
relational fields for discuss models that are identified
by records, such as the `MessageReactions` that is identified
by the message and the emoji.

14. [REF] mail: rename CannedResponse.name to 'source'

To make JS model and server data more alike.

15. [REF] mail: remove assignDefined in Persona model

So that eventually all model inserts use `Object.assign()`.

16. [REF] mail: remove 'last_message_id' from channel_info

At some point it was used to display last message in messaging menu.
This is already covered by `channel_fetch_preview` when opening the
messaging menu for the 1st time, so passing `last_message_id` in
channel_info is obsolete.

closes odoo/odoo#137750

Related: odoo/enterprise#48484
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-13 11:46:13 +00:00
Andrea Geraldo 200b77b216 [IMP] website_sale: _onChangeCountry improvements
Changed _onChangeCountry and _changeCountry from
website_sale.js to make them inheritable by
returning the value of the promise instead of
returning nothing.

closes odoo/odoo#137480

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-13 11:46:12 +00:00
pash-odoo 13de773edd [FIX] hr_holidays: hide employee information in My Time menu
Before this commit, In time off if we got to dashboard and open list view then
information related to employee is missing.

In this commit,
  we have added invisible employee, department, time-off type
in my time menu of the list view

task-3482508

closes odoo/odoo#134453

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 11:46:11 +00:00
Julien Van Roy 6334b04fb2 [FIX] account_edi_ubl_cii: fix peppol fields test fail when DK installed
When l10n_dk is installed, the tests on the peppol fields (EAS/Endpoint)
fail. This is due to the `_compute_company_registry` being overriden,
which will assign the VAT number as the company_registry.

To fix this, we simply use another country that currently hasn't any
loca module in Odoo (so we ensure the VAT/company_registry will not be
affected in any unexpected way).

Linked to runbot error 25700.

closes odoo/odoo#138588

X-original-commit: 64559fe8df9f32bd41b7e79ca501b9d1363378c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2023-10-13 10:36:08 +00:00
pash-odoo af51d1ab19 [FIX] hr_holidays: fixed Uom display issue
Before this commit, there was a huge gap between Uom and duration in time off
wizard.
In this commit, moved the Uom closer to duration.

task-3482508

closes odoo/odoo#138571

X-original-commit: 56b9243bc583b5f9b681b7c34355b505d892e313
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 10:36:07 +00:00
oco-odoo cdca92ded6 [FIX] l10n_ch: allow generating SEPA QR-code for Swiss customers
This commit https://github.com/odoo/odoo/commit/a9980477048e4adffda4a71a72ff1cc8490637f9 wrongly impeached to generate a SEPA QR-code on the invoice when l10n_ch was installed and the company and customer were in Switzerland. This was too restrictive, and broke the previous behavior, which allowed manually enabling the SEPA QR invoice by invoice if necessary. We restore the old behavior with this commit.

OPW 3516380

closes odoo/odoo#138395

X-original-commit: d5fe06d75369716925ff65cf3f34928e890fc932
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-13 09:17:48 +00:00
Michael (mcm) e062e6f483 [IMP] web,*: remove legacy env
This commit removes all the legacy envs (common_env, env, public_env)
as well as the files used to set up them.

task 3439226

closes odoo/odoo#138348

Related: odoo/enterprise#48781
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 09:17:45 +00:00
Michael (mcm) 94824d8767 [IMP] *: remove legacy notification service mapper
This commit removes the mapper to the notification service and adapts
widgets that display notifications.

task 3439226

Part-of: odoo/odoo#138348
2023-10-13 09:17:45 +00:00
guva-odoo bf6673c375 [FIX] base: address_format for Thailand
State code is shown instead of state name
in company details for Thailand companies.

opw-3493307

closes odoo/odoo#138576

X-original-commit: 6a47980364e4ceeb5a77b4f7e2f2a9475872275e
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-10-13 07:33:57 +00:00
Antoine Guenet e70a4baf40 [FIX] web_editor: split text node on insert after delete range
The `insert` command was splitting the selection's starting text node
only if the selection was collapsed. But after deleting the range, the
selection is inevitably collapsed and therefore the same should be done.

closes odoo/odoo#138549

X-original-commit: 06a375db7e6250b388d410010a3d1c50e8af1326
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-13 07:33:55 +00:00
Antoine Guenet 8438972939 [FIX] web_editor, test_lint: clean test HTML in utils tests
Test HTML being inserted for the utils tests was not cleaned at the end
of the tests.

X-original-commit: 092cee52b343665ea3ca90e4f4aa302318a763b5
Part-of: odoo/odoo#138549
2023-10-13 07:33:55 +00:00
Antoine Guenet 7cefa81f7e [ADD] web_editor: add some tests for state preservation utils
This adds a few tests for `getState`, `restoreState` and
`enforceWhitespace`, regarding the handling of space visibility. Each
test handles equivalent cases for all three functions.

X-original-commit: 2f28f42640a7322eec35a4d48a1ec7ce287b77b3
Part-of: odoo/odoo#138549
2023-10-13 07:33:55 +00:00
Antoine Guenet abb80ffe1c [IMP] web_editor: add debugging options for prepareUpdate
This adds an option to log information in prepareUpdate flows for
convenient debugging.

X-original-commit: 3ec104d57e9b6bbe210f45354f160d982a9c6254
Part-of: odoo/odoo#138549
2023-10-13 07:33:55 +00:00
Antoine Guenet b128d3a5a2 [IMP] web_editor: add label to prepareUpdate
This adds a label to the prepareUpdate function to be able to easily
track which update is being restored when debugging.

X-original-commit: 5bb8a5a9b5d54ebe93c473087981e3464cd61368
Part-of: odoo/odoo#138549
2023-10-13 07:33:55 +00:00
Antoine Guenet 0c95529e0f [FIX] web_editor: preserve leading spaces on delete range
When pressing delete on "[a] b c" the result is " b c" instead of
"&nbsp;b c". As result, text is rendered as "[]b c". The cause lies in
`deleteRange`: it ensures trailing spaces remains visible, but does not
take care of eventual invisible leading spaces. This adapts it to make
use of `prepareUpdate` which is made to handle this sort of issues. In
so doing we need to adapt `getState` and `prepareUpdate` to handle the
special cases brought by `deleteRange`. An option is introduced in
`prepareUpdate` to prevent its reentry until the update is complete (as
otherwise we may restore invalid intermediary states in the middle of
the deletion process).

task-3143042

X-original-commit: 8fd69afa591d11afe07da803ec550f052402713f
Part-of: odoo/odoo#138549
2023-10-13 07:33:55 +00:00
Odoo's Mergebot 8c759e2277 [IMP] mail, web: prepare overhaul of /file command
Preparations for the rework of the Knowledge `/file` command (see [enterprise PR])

- Extract basic props needed by the `FileViewer` for `files` instances in a
  reusable `Mixin`.
- Allow providing a custom `MediaDialog` class through `openMediaDialog` to
  allow Knowledge custom behaviors.
- Export the rendering part of `save` for the `MediaDialog` so it can be
  overridden.

[enterprise PR]: https://github.com/odoo/enterprise/pull/43488

task-3172056

closes odoo/odoo#127021

Related: odoo/enterprise#43488
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-13 07:33:52 +00:00
abd-msyukyu-odoo 3046f7ab9d [IMP] web, web_editor: knowledge file command overhaul preparations
- Allow providing a custom `MediaDialog` class through `openMediaDialog` to
  allow Knowledge custom behaviors.
- Export the rendering part of `save` for the `MediaDialog` so it can be
  overridden.

task-3172056

Part-of: odoo/odoo#127021
2023-10-13 07:33:52 +00:00
abd-msyukyu-odoo 62ca95f0fd [IMP] mail, web: create FileModelMixin for FileViewer
Extract basic props needed by the `FileViewer` for `files` instances in a
reusable `Mixin`.

task-3172056

Part-of: odoo/odoo#127021
2023-10-13 07:33:52 +00:00
Odoo's Mergebot 31eeb6de6a [MERGE] event: remove autoconfirm, rework pay status
We remove the is_paid field and based the logic on the payment_status
as these two fields are a bit redundant. It is also in preparation
to the removal of the field auto_confirm on the event.event model.
The goal is to ease and simplify the management of registrations.

Remove autoconfirm logic and simplify the flow of event registrations. Now a
registration is by default considered as confirmed and the draft state is
not used anymore by default. It is used in combination with sales before
a registration is considered as paid. It allows to avoid blocking seats
in an event while registration fees are not paid.

task-3061849

closes odoo/odoo#126431

Related: odoo/upgrade#4836
Related: odoo/enterprise#47982
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-13 07:33:49 +00:00
Jérémy Hennecart (jeh) 24ec9e824a [IMP] {website_}event{_sale}: improve general design
Following the removal of the auto_confirm field on event
and the payment_status computation, we improve the design
and flow of the event module.

- Adapt and simplify the kanban view for event
- Add the payment_status on graph view
- Improve the payment_status field in registration views (banners)
- Fallback on the registration page if there is not enough seats
after filling the registrations info with an error message.

task-3061849

Part-of: odoo/odoo#126431
2023-10-13 07:33:49 +00:00
Jérémy Hennecart (jeh) 4a20cb320b [IMP] *event*: remove autoconfirm
Remove autoconfirm logic and simplify the flow of event
registrations. Now a registration is by default considered
as confirmed.

The draft state is kept for registrations with
a payment pending.

These registrations are no longer counted
as expected attendees for the seats computation.
To match the behavior of events, we also add a seats_expected
computed field on event tickets.

The registration status is now based on the sale order state.
So the payment_status field is renamed sale_status.
We consider now that a registration linked to a SO in a sale
state should be confirmed and reserved.
A sale order is in the `sale` state when manually confirmed
or when the transactions done match the amount_total of the
sale order.

We also rename the seats_expected field into seats_taken to
better match the process. It was a bit weird to have expected
in the name when the registration attended were counted into it.

UPG PR: odoo/upgrade#4836

task-3061849

Part-of: odoo/odoo#126431
2023-10-13 07:33:49 +00:00
Jérémy Hennecart (jeh) 692496c6d5 [IMP] event_sale: remove is_paid and store payment_status
We remove the is_paid field and based the logic on the payment_status
as these two fields are a bit redundant. It is also in preparation
to the removal of the field auto_confirm on the event.event model.
The goal is to ease and simplify the management of registrations.

UPG PR: odoo/upgrade#4836

task-3061849

Part-of: odoo/odoo#126431
2023-10-13 07:33:49 +00:00
Thomas Lefebvre (thle) 26e3a113df [FIX] project: invalidate field to get user_ids
Steps to reproduce:
-------------------
- create a project;
- set project visibility of project as
    'Invited portal users and all internal users (public)';
- share that project with a portal user;
- create a task in that project and set one of user in 'Assignee' of the task;
- login in website as that portal user;
- from kanban view of task, open a task.

Issue:
------
The 'Assignees' are not visible in the opened form view.
The `portal_user_name` field will be empty, with the result
that no assignees to the task will be displayed in the project task form view.

Cause:
------
In the business flow, we first perform a `read` (with portal rights)
which will set the value:
`project.task.user_ids: {project_id: ()}` in the cache.

After, we try to get `user_ids` inside the `_compute_portal_user_names` method.
The `insert_missing` method of the cache does not overwrite existing values in cache.

Note:
fetch method uses `_determine_fields_to_fetch` with
parameter `ignore_when_in_cache` equal to `True`.

Solution:
---------
It is necessary to invalidate the cache for this field for the recordset
to make sure the value is updated.

opw-3536187

closes odoo/odoo#138557

X-original-commit: e533daf44c7946fae1e4467e70f9363f675dad07
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-13 06:27:43 +00:00
Mathieu Duckerts-AntoineandMathieu Notté 6428aef678 [IMP] *: improve domain selector edition, dom, and style
We improve various aspects of the domain selector:

- We make the domain selector be able to display all domains accepted by the class Domain (domain.js)
- We improve the edition/selection of values, e.g. for the operators in/not in
- We improve/simplify the style/dom

Task IDs: 3507123, 3508940

closes odoo/odoo#128680

Related: odoo/enterprise#48324
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Notté <mano@odoo.com>
2023-10-13 06:27:42 +00:00
Damien Bouvy d9ed827323 [IMP] base: quick UX improvement of ir.module.module form view
Move stuff around, re-organise tabs, etc.

closes odoo/odoo#138577

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-10-12 21:00:49 +00:00
Guillaume-gdi bbb40a6b0c [FIX] website: prevent instagram call in test
This commit removes instagram from the `snippets_all_drag_and_drop` tour
to prevent too much external calls.

task-2603045

closes odoo/odoo#138558

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-12 17:20:51 +00:00
mano-odoo e9804ccf29 [FIX] website_sale: checkout summary offset header
This PR offset the cart_summary of the size of the tallest header to
make sure the header is not hiding the cart summary when the user
scrolls in the checkout.

This is a temporary solution and the real header height should be
used as a value instead of the default's one.

task-3551420

closes odoo/odoo#138543

Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-10-12 17:20:50 +00:00
MerlinGuillaume 36e98afb4f [FIX] hr_expense: use correct employee model according to user group
A traceback occurs when clicking on Search More in the employee field of
expense if the user has no rights on employee

Steps to reproduce:
1. Install Expenses
2. Go to Settings > General Settings > Users and click on Manage Users
3. Open user Mitchell Admin and remove all access rights on Employees
4. Go to Expenses and create a new expense
5. Click in the employee field, then on "Search More..." in the dropdown
6. An error occurs

Solution:
Depending on the group of the user, use 'hr.employee' or
'hr.employee.public' as done in https://github.com/odoo/odoo/commit/41eaff0f4c172a6018b0c8d9518d521c3832ef94

opw-3473418

closes odoo/odoo#138539

X-original-commit: 5d842587090b684786c3279d1ebe962ae57021b7
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-10-12 17:20:49 +00:00
Romain Derie f94c1ea65f [FIX] website: prevent traceback because megamenu toggle does not exist
Commit [1] introduced a method to restore the mega menu state (closed)
so it's not saved open when saving the website builder edition.
That method is `_restoreMegaMenus()`.

It was then moved with commit [2], where it was called in `destroy`
where it was actually making the code crash because once you reach
`destroy`, the website content (the iframe) has already been reloaded
(and thus removed / recreated).
It's done through `reloadIframe()`.

So, depending of your network speed and the server response time, if the
page is served before reaching the mega menu restoration, it will crash.

Restoring the mega menu in the (wysiwig) destroy doesn't seems to do
anything as the page is already saved when reaching `destroy`.

Step to reproduce:
- Have a high latency, like 500ms (you can create a profile in chrome
  debug tool in network tab)
- Create a mega menu on the website
- Enter edit mode
- Directly save or discard
-> Traceback, the jQuery toggle elements (`.o_mega_menu_toggle`) are not
   in the DOM anymore, since the iframe got reloaded. Those elements
   thus don't have a reference to `$` anymore, ultimately making this
   line crash:

```js
const $toggle = toggle.ownerDocument.defaultView.$(toggle);
```

[1]: https://github.com/odoo/odoo/commit/1345702258adbfbee0d780dc22e552395e6d1df7
[2]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997

opw-3483837
opw-3478642

closes odoo/odoo#138538

X-original-commit: caeb92bfb624c9c30ec9f9e3c2b1dd385e9b089b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-12 17:20:47 +00:00
abd-msyukyu-odoo 5a2ee50798 [FIX] web_editor: change oe-id when switching record
Add a test to ensure that the `MediaDialog` is opened with the correct record
`resId` (to properly link files to that record) inside an html field.

task-3502797

closes odoo/odoo#138525

X-original-commit: 5184bed2efd9923c0371d5e117a7915415ceee5a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-12 17:20:46 +00:00
Rodolpho Lima 0552322774 [FIX] web_editor: record info for MediaDialog
HtmlField's Wysiwyg and website's Wyiswyg have different needs when it
comes to record info. The former has such info in the options object
received from its parent component, which is updated when the record
changes (ex: switching pages in a form view). The latter uses the
Wysiwyg with multiple editable ".o_editable" elements, and each one of
those carry such information in its dataset.

Before this commit, when the HtmlField's record changed, the MediaDialog
would fetch the record info from the editable's dataset, which was no
longer updated. This led to the creation of attachments for uploaded
images with the wrong record reference.

This commit makes sure the correct data is read from the Wysiwyg options
object instead (which contains the up-to-date record info), while making
this behaviour overridable (by website).

This commit also removes the 'res_model' and 'res_id' props passed to
the MediaDialog component, as such props are not used ('resModel' and 'resId' are
used instead).

task-3502797

X-original-commit: 5cd7145a6a182c5d9bff68b0df7d825d4d932209
Part-of: odoo/odoo#138525
2023-10-12 17:20:46 +00:00
Achraf (abz) a83bb76011 [FIX] loyalty: Prevent reward_ids to be reset to default
Steps:
    - Install `sale_management`
    - Go to `Discount & Loyalty`
    - Create a new one and set a name
    - Change default program type from `discount` to `buy x get y`
    - Remove the default rewards
    - Add a new one (the default one)
    - Click `Save & Close`
    - Trigger save

Rewards is reset to default `discount` instead of `buy x get y`

closes odoo/odoo#138523

X-original-commit: 798c69f44bfde2f66826775a5a11fe5e51adb9a8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-12 17:20:44 +00:00
Pierre Pulinckx (pipu) d2462d8627 [FIX] mass_mailing: add markup to preview mobile dialog
This fix is only a missing of the commit 7f5a0ccf9e5fdf3f7fece8a9.
As a reminder, in 7f5a0ccf9e5fdf3f7fece8a9, we check that the content of
the dialog is markuped. If not, we escape it.
So in this commit, we add the markup to the "props.preview".

closes odoo/odoo#138494

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-12 17:20:42 +00:00
Odoo's Mergebot fc2f89cea1 [MERGE] mail, hr, various: introduce activity plan and batch scheduling
Generalize the hr.employee activity plan to any model, allowing to create
activity plan that can be launched on any model.

The activity can now be created in batch by selecting multiple record in the
list view and then clicking on a "clock" icon in a row similarly to the batch
records update (selecting multiple records allows to change for example their
name in batch in the list view). We implement also that functionality for the
plan, allowing to launch a plan on multiple records at once.

We also centralize the launching of activity or activity plan through either
the  "Activities" button in the chatter or the "clock" button in the view list.

Scheduling activity is now taken in charge by a wizard that can schedule a
single activity as well as a plan. We add/update tests for checking that the
wizard is launched with the right record selection (on a single record or a
batch) and add tests for checking the wizard itself.

The plan can be defined through an added menu in the technical admin menu but
also through configuration menu added in the module crm, project.

Technical notes:
In the added wizard, to determine that there is a error, we introduce the
has_error field because we cannot use easily the error field for that. Indeed,
to determine that there is no error, we have to compare it to "<p><br></p>"
(more precisely &lt;p&gt;&lt;br&gt;&lt;/p&gt;) which is not handy and may
change in the future. This is because when we write False on field error and
read it after, we get "<p><br></p>". Instead, we centralize this weird
comparison in the model in the compute method of has_error.

The ActivityListPopover still displays the activity of the record on which it
has been triggered but the button to schedule activity will launch a wizard
that create activities in batch for the selected records if more than one was
selected. For that, the ActivityListPopover component receives now an
additional prop: resIds (selected records) on top of the resId prop (record on
which the popup has been triggered). Note that when the line that trigger the
popup is not selected, the batch mode is disabled to avoid confusion.

We convert the custom plan implementation to use the generic one. As the
generic one can define plans for multiple model. We use the check
dedicated_to_res_model == 'hr.employee' to activate the specific feature for
hr.employee. Indeed, that field contains the model name when the plan is
applicable only for one model.

Task-3390865

closes odoo/odoo#137969

Related: odoo/upgrade#5243
Related: odoo/enterprise#48599
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-12 16:12:09 +00:00