Commit Graph
164782 Commits
Author SHA1 Message Date
maad-odoo aa8b60a0c8 [IMP] mail: rename activity type To Do to To-Do
upgrade: https://github.com/odoo/upgrade/pull/5057

Renaming the activity type 'To Do' into 'To-Do' so that the naming
convention is consitent with the To-Do app.

task-3469745

closes odoo/odoo#132467

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-05 19:58:02 +00:00
FrancoisGe d8f03151fa [IMP] web: add relatedFields in x2m sub-views
The goal of this commit is to allow relatedFields to be added to a one2many
field using a sub-view.

Before this commit, if an x2many custom contains a sub-view and relatedFields,
we ignore the sub-view and use only the relatedFields.

Now we're going to add the relatedFields to the fields/activeFields
defined in the sub-view.

Use case:
Created a custom x2many field dependent on the 'display_name' of
a many2one field that should not be present in the sub-view. For example,
to simulate a groupBy on this many2one field.

closes odoo/odoo#132351

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 19:58:01 +00:00
shag-odoo f581d4ad17 [IMP] fleet: improve the search positioning and add filter_domain
Before this commit, the 'Current Driver(Employee)' option was present within the
search menu and appeared as the last choice in the search list.

IMP:
Following this commit, the 'Current Driver(Employee)' is been
removed and all its functionality is implemented in Driver.

closes odoo/odoo#131512

Taskid: 3459896
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-05 19:58:00 +00:00
Didier (did) 6aa3a1e243 [IMP] mail: message action registry + reorder actions in inbox
Before this commit, message actions were all defined in template
of `Message` component. It's good when there are few actions and
the ordering of actions is always the same, but there are now
many actions and we want to order these actions depending on context.

This commit fixes the issue by introducing a special registry to add
message actions. This registry is quite similar to thread actions:
each item define conditions to be shown, behaviour on click, and
their sequence which can depend on the context where the message is
being viewed.

In addition to this message action registry, this commit also
reorder message actions in inbox as follow:

1. Quick actions:
 - Add a Reaction
 - Mark as To do
 - Mark as Read
2. More menu:
 - View reactions
 - Reply
 - Unfollow
 - Edit
 - Delete

Task-3458086

closes odoo/odoo#131426

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-05 18:44:24 +00:00
Vincent Larcin 71705e4ea3 [IMP] project: add date_last_stage_update to task list view
This commit adds the "Last Stage Update" field to the task list view

Task-3455177

closes odoo/odoo#130880

Signed-off-by: Vincent Larcin (vila) <vila@odoo.com>
2023-09-05 18:44:23 +00:00
Vincent Larcin fef29c62f5 [IMP] project: update date_last_stage_update when changing state
Currently, the field date_last_stage_update is updated when the state of the task is changed,
but only if the target stage is a closing state.

It could however be useful to know when the state was last changed regardless of if it's closing or not.

This commit makes it so that the field is updated after any state change.

Task-3455177

Part-of: odoo/odoo#130880
2023-09-05 18:44:23 +00:00
Prakash Prajapati b038bbfad4 [IMP] hr_recruitment: remove default responsible in applicant
Steps:
 - install hr_recruitment app
 - Create a job Positions without Recruiter
 - Published job Positions
 - Got To website and apply
 - Open applicant
 - Public user is set in applicant responsible

Issue:
   public user is set if Recruiter is empty in job Position

Fix:
   In this commit we have removed the default current user as the responsible
  applicant.

task-3424017

closes odoo/odoo#128721

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-05 18:44:20 +00:00
Adrien Guilliams (adgu) 17d1a52f56 [IMP] pos*: Improve demo data
pos*: point_of_sale, pos_restaurant, pos_self_order

**Purpose:** This change is for better UX of the testers.

**Notable changes:**

1. Historical pos order data which include past sessions and past orders.
2. New open session and open orders.
3. Onboarding data containing all demo datas and the new open session
and open orders.
4. Adding more drinks demo products.

closes odoo/odoo#128699

Task-id: 2484444
Related: odoo/enterprise#44198
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-05 18:44:18 +00:00
Benjamin Vray 7f730f81ec [IMP] web_editor, website: add an "on hover" option for animations
This commit adds an "on hover" option for animations. We've added the
"on hover" option to the animation selector. This feature is only
available for images. It allows you to pick an animation that triggers
when you hover your mouse over an image. There are six different
animations to choose from. This new animation option doesn't work with
animated shapes and devices shapes.

task-3094258

closes odoo/odoo#119197

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-05 18:44:17 +00:00
Benjamin Vray fbb395021d [IMP] web_editor: allow to flip/rotate image shapes
This commit adds the possibility to horizontally/vertically mirror and
rotate the shape of an image. We've introduced a new sub-option for
image shapes called "Transform". This new option is not available for
certain shapes:
- If the transform will have no effect (a vertically and horizontally
symmetrical shape).
- With some animations, if the animation is too complex for the system
to work.
- For "devices" shapes because they are too specific for the option to
work. And anyway "devices" shapes are already available horizontally
flipped in the list.

task-3094258

Part-of: odoo/odoo#119197
2023-09-05 18:44:17 +00:00
Odoo's Mergebot 76fcebd2ca [MERGE] base_automation: simpler edition workflow
This PR makes "Automated Actions" more discoverable and usable by:

- Adding a menu in the kanban header config dropdown to add/edit them.
- Creating a new custom kanban view for a clear understanding of each
  automated action record and its associated actions.
- Introducing new "smart" triggers that appear in the form view based on the
  chosen model:
  - Updated Values category:
    - "Stage is set to" when a `stage_id` field exists in the model,
      allowing users to select a specific stage value.
    - "State is set to" when a `state` field exists in the model,
      allowing users to select a specific state value.
    - "Priority is set to" (`priority`) where users can select a specific priority.
    - "User is set" (`user_id`, `user_ids` fields)
    - "Tag is added" (`tag_ids` field) where users can select a specific tag.
    - "On Archive"
    - "On Unarchive"
  - Timing Conditions:
    - "After creation"
    - "After last update"
- Deprecating previously known triggers "On Creation" (`on_create`) and "On
  Update" (`on_write`) to simplify the user experience. "On Creation & Update"
  (`on_create_or_write`) is retained and renamed to "On save".
- Changing the `ir.actions.server` Many2one relationship to a One2many
  relationship. Automated actions can now directly contain multiple actions,
  eliminating the need for an "Execute several actions" action in automation
  rules.
- Introducing a widget for the new `ir.actions.server` One2many field for a
  clearer understanding of multiple actions.

This commit also enhances the usability of "Server Actions" (`ir.actions`) by:

- Removing the `ir.server.object.lines` model and the associated `fields_lines`
  One2Many field. The attributes of the removed model are now merged into
  `ir.actions`. An action can now write to only one field, and the create action
  is now a name_create action.
- Adapting the form view when creating an "Update the record" action. The value
  field shown adapts itself based on the field to update; this field can be a
  `reference` field for a `one2many` `update_field_id`, a `one2many` field for a
  selection `update_field_id`, or a `text` field otherwise.
- Refactoring the form view to display only relevant details and other
  miscellaneous improvements.

closes odoo/odoo#114352

Taskid: 3085360
Upgrade: https://github.com/odoo/upgrade/pull/4904
Enterprise: https://github.com/odoo/enterprise/pull/37782
Related: odoo/enterprise#37782
Related: odoo/upgrade#4904
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-09-05 18:44:13 +00:00
Damien Bouvy 9751075208 [IMP] base_automation: use backend action for Automations button
This commit ensures that the 'Automations' button uses the backend
action and not one created on the fly.

This ensures that the user lands in a view which has the correct helper
text.

Task-3085360

Part-of: odoo/odoo#114352
2023-09-05 18:44:13 +00:00
Damien Bouvy b75fad0df9 [IMP] base_automation: modular kanban header action
This commit makes it possible to have the same 'Automation' button hook
in this module (in community) and in web_enterprise (which is in the
Enterprise edition, as one may have guessed).

The purpose of the override in web_enterprise is to promote Odoo Studio
as the module to install to enjoy automations. Including this Studio
promotion in Odoo CE makes little sense, especially since only
base_automation is actually needed. Therefore we needed to have both a
promotion button in EE and an actual button in CE but not both when
base_automation was installed along with web_enterprise.

This commit simply adds an intermediary function on the KanbanHeader
component, which calls an indirect function that is only defined
in base_automation. In that way, the web_enterprise module can
override the intermediary function and can check the existence of
the indirect function.

Task-3085360

Part-of: odoo/odoo#114352
2023-09-05 18:44:13 +00:00
0a744accc2 [IMP] base_automation,*: simpler edition workflow
*: base, crm, digest, mail, mass_mailing, sms, test_base_automation,
   website_forum, website_sale

This commit makes "Automated Actions" more discoverable and usable by:

- Adding a menu in the kanban header config dropdown to add/edit them.
- Creating a new custom kanban view for a clear understanding of each
  automated action record and its associated actions.
- Introducing new "smart" triggers that appear in the form view based on the
  chosen model:
  - Updated Values category:
    - "Stage is set to" when a `stage_id` field exists in the model,
      allowing users to select a specific stage value.
    - "State is set to" when a `state` field exists in the model,
      allowing users to select a specific state value.
    - "Priority is set to" (`priority`) where users can select a specific priority.
    - "User is set" (`user_id`, `user_ids` fields)
    - "Tag is added" (`tag_ids` field) where users can select a specific tag.
    - "On Archive"
    - "On Unarchive"
  - Timing Conditions:
    - "After creation"
    - "After last update"
- Deprecating previously known triggers "On Creation" (`on_create`) and "On
  Update" (`on_write`) to simplify the user experience. "On Creation & Update"
  (`on_create_or_write`) is retained and renamed to "On save".
- Changing the `ir.actions.server` Many2one relationship to a One2many
  relationship. Automated actions can now directly contain multiple actions,
  eliminating the need for an "Execute several actions" action in automation
  rules.
- Introducing a widget for the new `ir.actions.server` One2many field for a
  clearer understanding of multiple actions.

This commit also enhances the usability of "Server Actions" (`ir.actions`) by:

- Removing the `ir.server.object.lines` model and the associated `fields_lines`
  One2Many field. The attributes of the removed model are now merged into
  `ir.actions`. An action can now write to only one field, and the create action
  is now a name_create action.
- Adapting the form view when creating an "Update the record" action. The value
  field shown adapts itself based on the field to update; this field can be a
  `reference` field for a `one2many` `update_field_id`, a `one2many` field for a
  selection `update_field_id`, or a `text` field otherwise.
- Refactoring the form view to display only relevant details and other
  miscellaneous improvements.

Taskid: 3085360
Part-of: odoo/odoo#114352
Co-authored-by: Florent Dardenne <dafl@odoo.com>
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
2023-09-05 18:44:13 +00:00
Bruno Boi e1b0763347 [REF] web: registry for KanbanHeader config items
**Before this commit**
In order to add a new entry in the KanbanHeader config dropdown,
one has to extend the xml template.

**After this commit**
A registry has been added, easing the job to add entries in this menu.

Task-3085360

Part-of: odoo/odoo#114352
2023-09-05 18:44:13 +00:00
Bruno Boi 3317e8510b [REF] base_automation: move some static files
Move some file up a folder:
- ./static/src/js/... => ./static/src/...
- ./static/src/xml/... => ./static/src/...

Task-3085360

Part-of: odoo/odoo#114352
2023-09-05 18:44:13 +00:00
tsm-odoo 1450747b3e [FIX] bus: fix single notification test
Before this commit, the "subscribe to single notification"
test failed in an nondeterministic fashion. This commit
solves this issue.

fixes runbot-24033

closes odoo/odoo#134243

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-09-05 16:34:44 +00:00
Antoine (ande) 12c6eb017c [FIX] web: textarea do not resize properly
Current behaviour:
When clicking on a note containing
multi-line text, the textarea shrinks

Expected behaviour:
Note should show whole text

Steps to reproduce:
1. Install sale_management
2. Head to Sales > Quotations
3. Click on any quotation line
4. Click on "Add a note"
5. Input multi-line text
6. Click on the "Save manually" button
7. Click again on the note
8. Note is omly one character tall

opw-3457234

closes odoo/odoo#134231

X-original-commit: 061430f1430723d719230796774cf4efab8aa348
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2023-09-05 16:34:41 +00:00
momegahed 631d34e8eb [FIX] l10n_ar_website_sale: fix access to AFIP in ecommerce
Steps to reproduce:
1. install l10n_ar_website_sale
2. try to checkout out using a guest account (without sigining in)
3. error on address form

very similar to:
https://github.com/odoo/odoo/pull/130455

Issue:
due to https://github.com/odoo/odoo/pull/118701 public users can't read
`l10n_ar.afip.responsibility.type` anymore

Fix:

open access to the models

opw-3460719

closes odoo/odoo#134226

X-original-commit: dc3a2be108989343ac62d6c42a064b1b39586bbf
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-09-05 14:44:14 +00:00
Brieuc-brd 4736b2afd5 [FIX] web: ListView selection and action icons
=== ISSUE 1 ===
Prior to this commit, there was a missing padding on  the
`o_list_selection_box`.

=== ISSUE 2 ===
On mobile, Cog and Print icons had no margin and were stick next to
their label.

This commit fixes these issues.

task-3454841
Part of task-3326263

closes odoo/odoo#134219

X-original-commit: 80f82816b17d32efbf4cbe4a1956b2457eac8ad9
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-05 14:44:13 +00:00
niyasraphy 36cf1708a4 [FIX] (account,website)_payment, sale: pass argument values in super call
before this commit, on inheriting the function
_get_custom_rendering_context_values the argument values are not received
in the inherited function as it is not passed along with the super

scenario:
* consider that the payment link is shared to customer
* customer made the full payment
* once the sale or invoice is fully paid, the link has to
be shown as fully paid or expired
* for doing this, if we inherit the above function, the
arguments is not passed to the function

after this commit, the argument values are passed to
super and the value can be used re used in the further
inherit of this function

closes odoo/odoo#134195

X-original-commit: 49b91e47c6c24e0023110365e7f9084a2c13ca5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-05 12:22:22 +00:00
Louis (loco) f34540c535 [FIX] web_editor: save an image with the correct parameters
Steps to reproduce the problem:
- Go on the "Courses" application and select a course.
- Edit.
- Replace the main image of the course with one of your own.
- Save.

-> The function route `/web_editor/modify_image/` is called two times
leading to the creation of two attachments instead of one.

The `savePendingImages()` function iterates through editable elements
and calls `/web_editor/modify_image/` (through `_saveModifiedImage()`)
for each image with a `o_modified_image_to_save` class inside those
elements. In our case, the image has an editable element parent that has
itself an editable element parent. Because since [1], the
`o_modified_image_to_save` class is removed after the `rpc` call, this
class is not removed while the `savePendingImages()` loops on the
second editable element parent of the image. As a result,
`/web_editor/modify_image/` is called two times. Note that before [1],
the process was partially wrong as well. `/web_editor/modify_image/` was
indeed called only once but with the wrong arguments. This is now fixed
by ensuring that `_saveModifiedImage()` is called with the arguments
coming from the closest editable element. The same logic is applied for
the call of the `_saveB64Image()` function.

[1]: https://github.com/odoo/odoo/commit/8872aab2d108ff3e2ec06ca4579479898c87738c

task-3451349

closes odoo/odoo#134189

X-original-commit: 8ff0151cf06c37e8ee2e344bc96c063b4921ce43
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-09-05 12:22:20 +00:00
Jorge Pinna Puissant f609a616d1 [IMP] web: allow to save and read next record in one rpc call
In [1], a new python function was introduced that allows to save and
read in one rpc. This commit, adds the possiblitity to read another
record in the same rpc call. This is particularly useful when you want
to save and read the next record (for instance on a pager).

1: ebd538a194

Task-id : 3453184

closes odoo/odoo#134125

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 12:22:19 +00:00
hupo-odoo 8afae04c35 [IMP] account: discount allocation
Provides the possibility for the user to enter defaults accounts for discounts allocation. If provided, discounts on Customer Invoices and Vendor BIlls will be allocation on the specified account instead of the product account.

Example:
Create a journal entry with one product with the following attributes:
quantity: 1
price unit: 100
discount 5

We expect the following account move line:
Without an account set in the settings for discount allocation:
ACCOUNT                                             DEBIT     CREDIT
700000 Sales rendered in Belgium (marchandises)      0         95
400000 Trade debtors within one year - Customer      95        0

With discount allocation account set to "657000 Discount Given":
ACCOUNT                                             DEBIT     CREDIT
700000 Sales rendered in Belgium (marchandises)      0         95
700000 Sales rendered in Belgium (marchandises)      0         5
657000 Discounts Given                               5         0
400000 Trade debtors within one year - Customer      95        0

closes odoo/odoo#133286

Note: the discount is added on another line than the one of the product even though it is the same account because it does not include taxes and analytic distributions.
Task: 3278827
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-05 12:22:17 +00:00
ravb-odoo b56c565c07 [IMP] hr_contract: make contract and work permit expiration notice periods configurable
Currently the warning messages to warn for contracts and work permits that are
about to expire are hardcoded to be triggered 7 and 60 days in advance
respectively. With this commit, these notice periods are made to be configurable
on a per-company basis.

task-3340931

closes odoo/odoo#124414

Related: odoo/enterprise#42214
Related: odoo/upgrade#4885
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-05 12:22:15 +00:00
Odoo's Mergebot fdf0ffb8c6 [MERGE][ADD] product,(website_)sale: product documents
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:

* quotations
* confirmed sale orders
* e-commerce product page

This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.

This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:

1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.

therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.

task-3249201

See also:
* https://github.com/odoo/enterprise/pull/46106
* https://github.com/odoo/upgrade/pull/5069

closes odoo/odoo#132739

Related: odoo/enterprise#46106
Related: odoo/upgrade#5069
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-05 10:59:17 +00:00
Victor Feyens 5a801bc602 [ADD] product,(website_)sale: product documents
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:

* quotations
* confirmed sale orders
* e-commerce product page

This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.

This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:

1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.

therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.

task-3249201

Part-of: odoo/odoo#132739
2023-09-05 10:59:17 +00:00
Victor Feyens 9ed1dc5cae [REM] website_sale_digital
Part-of: odoo/odoo#132739
2023-09-05 10:59:17 +00:00
Laurent Smet ac3621084c [FIX] account[_peppol]: Delay link_documents after _call_web_service_after_invoice_pdf_render
If a web-service after the PDF generation failed but does a cr.commit(), the attachments should not be generated.

closes odoo/odoo#134237

X-original-commit: 5d343598c2ce03698aa686965ec3887df610ec9a
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-05 07:19:52 +00:00
Nicolas Bayet e4bac8c129 [FIX] web_editor: prevent creation of RTCPeerConnection when offline
Before this commit, when the browser was offline and when an attempt
to make a RTCPeerConnection was made, a traceback was raised by
firefox:

> InvalidStateError: Can't create RTCPeerConnections when the network is
> down

This commit prevents the creation of the RTCPeerConnection when the
browser is offline.

task-3186872

closes odoo/odoo#134236

X-original-commit: 8f9a3e1ebd05d9df8ec0d82b93967f1a62f879c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-05 07:19:51 +00:00
Xavier ALT 0f213505bb [FIX] account: fix incorrect chatter body for incoming vendor bills
As the use of Markup is enforced since [1], we must use a Markup string
when adding the subject to incoming vendor bills body otherwise the
chatter will contain the escaped html, making it quite difficult for
users to understand it.

opw-3453136

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

closes odoo/odoo#134220

X-original-commit: 66194df56d9e724b889527dbfea725ac9b8844b9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-09-05 07:19:49 +00:00
William Henrotin 9a3dde222a [FIX] {sale_}purchase{_stock}: select sellers depending on date
Commit 72a17bafba6e7 force the PO `date_order` to be >= at ` today() to
ensure the select_seller method take the right seller price. This
introduces an error in the MPS module that may need to create PO in the
past.

Instead, this commit patch the call to `_select_seller` to take at least
`today()`

closes odoo/odoo#134217

Opw: 3167094
X-original-commit: a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-05 07:19:48 +00:00
mano-odoo 0cc569004d [FIX] web: o_quick_assign same color as the clock
As the Activity button (clock icon) is the same kind of action
it make sense to apply the text-muted on the quick assign.

To make the hover clearer we apply a text-dark on hover using the
btn-link + contextual classes function. We apply the same to the
`subtask_list_button` and milestones for consistency.

task-3382159

closes odoo/odoo#134196

X-original-commit: 4b8b6e2155eca66652b4a57dfff27b0e81d62573
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-05 07:19:47 +00:00
Yaroslav Soroko (yaso) 95eece118c [FIX] hw_drivers: Error-proof Interfaces
Before, when instatating the interfaces if there was an error inside
Odoo could stop. This PR prevents that and simply avoids instantiating
the interface which causes the error.

closes odoo/odoo#133890

X-original-commit: e8f700f766bde6906076192ffe12eec255454a81
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-09-05 07:19:45 +00:00
Thomas Lefebvre (thle) e561cd5b5d [FIX] hr_holidays_attendance: correct date overtime attendances
Issue:
------
The `date` field of the `hr.attendance.overtime` model
records is not the date of the related leave.

Cause:
------
We use: `fields.Date.today()` instead of the leave field `date_from`.

Solution:
---------
Use `date_from` field of `leave`.

opw-3433480

closes odoo/odoo#134156

X-original-commit: b82a338380e7e693d8123a496e36676260873828
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-05 05:33:59 +00:00
Sébastien Theys 53cd2bd72f [REF] mail: tests: remove nextAnimationFrame
In some tests it was no longer necessary.

Negative tests will be slightly weaker, but they are so weak already
that is does not change much, they should be done differently anyway.

closes odoo/odoo#134025

Related: odoo/enterprise#46739
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 21:53:38 +00:00
Sébastien Theys 4458a01606 [REF] mail: tests: remove nextTick
It was no longer used.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 7a9581e1f3 [REF] web, mail, im_livechat: tests: remove afterNextRender
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys e3b774118b [REF] mail, *: tests: remove most remaining afterNextRender
* = base_iban, bus, calendar, crm_livechat, im_livechat

Follow up of https://github.com/odoo/odoo/pull/130451

`contains` is faster and functionally more significant.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 3ea78a8354 [REF] mail, website_livechat: tests: remove waitFormViewLoaded
This is no longer used since tests properly await what they require.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 315263f1b3 [REF] mail: tests: remove waitUntilMessagesLoaded of openDiscuss
This is no longer used since tests properly await what they require.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys e25e70b2f5 [REF] mail: tests: remove unused getMouseenter
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Rahul Prajapati 4250ae62b6 [FIX] mail: chatwindow header threadactions display
Before this commit:

When ThreadActions has a length of 1 it will display the threadAction
multiple times.

ex. In Mobile View When starting a new conversation with a partner from the
`New Message` button from the systray. It will have only 1 ThreadAction
which is `close`. So, it will be displayed multiple times.

After this commit:

If there is only 1 threadAction then it should not be displayed multiple times

closes odoo/odoo#134228

X-original-commit: 6a229db2db60e4b0bfdfe585f5ca05e2e373905f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 20:55:14 +00:00
tsm-odoo 4b72cd0e3f [FIX] im_livechat: fix chatbot test page
This PR fixes a server error when trying to test a chatbot that
appeared with the [livechat refactoring].

Steps to reproduce:
- Go to a livechat channel form view
- Click on the "chatbot" smart button
- Click on a chatbot
- Click on the "test" button
- An internal server error occurs

task-3485014

[livechat refactoring]: https://github.com/odoo/odoo/pull/122834

closes odoo/odoo#134227

X-original-commit: dfc50ea4e4fb327876458afee1b807e36ce80c2b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 20:55:13 +00:00
Benjamin Vray 6566d12a62 [FIX] web_editor: fix opening of colorpicker of the transparent header
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Re-open the colorpicker.
- Bug: The colorpicker is empty.

This bug occurs since [1] because the 'selectedTab' option of the
colorPalette was being reset to its default value when the colorPicker
was opened for a second time. In this commit, we stored the
'selectedTab' props in a variable to be able to modify it (see the owl
[documentation]).

[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
[documentation]: https://github.com/odoo/owl/blob/master/doc/reference/props.md#good-practices

task-3440939

closes odoo/odoo#134229

X-original-commit: 2094a52647ce1c321d1e703d96211fc0d642025f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-04 19:58:34 +00:00
Julien Castiaux 94595ba992 [FIX] website: 308 wrongly set on all routes
Users sometime want to rename existing controllers URL, e.g. /shop as
french /magasin. The feature is possible within Odoo thanks to 308 type
redirections that can be configured via a hidden ?debug=1-only website
menu.

Upon generating the routing-map (the structure that links URLs to
controllers), when a URL is found inside of the `website.rewrite` model,
two links (called Rules in werkzeug jargon) are registered: the new,
translated, URL is linked to the controller and the original URL is
linked to a redirection to the new URL.

For the context of this PR, it is important to note that the redirection
only applies to the very URL saved inside the `website.rewrite` model:
if a controller has multiple routes, e.g. `/shop` and `/shop/shop`, only
`/shop` is redirected to `/magasin`, `/shop/shop` is left as-is.

Without 308 redirection:

	/shop -> def shop()
	/shop/shop -> def shop()

With 308 redirection:

	website.rewrite(from_url='/shop', to_url='/magasin')
	/shop -> /magasin
	/shop/shop -> def shop()
	/magasin -> def shop()

The redirection is set on the routing dictionnary of the endpoint, this
is the dictionnary that collect the informations set via the `@route`
decorator (auth=, method=, type=, ...).

Prior to [HTTPocalypse], that dictionnary was duplicated so that the
redirection was applied on the single route endpoint that matched
the `website.rewrite` record. With [HTTPocalypse] that duplication has
been wrongly removed: all original routes redirected to the new
translated one.

Bug introduced in [HTTPocalypse]:

	website.rewrite(from_url='/shop', to_url='/magasin')
	/shop -> /magasin
	/shop/shop -> /magasin          <-- wrong
	/magasin -> def shop()

This PR fixes the problem, it makes sure that the redirection is saved
*only* on the route that matched the website.rewrite record, not the
other routes.

[HTTPocalypse]: https://github.com/odoo/odoo/pull/78857

closes odoo/odoo#133960

closes odoo/odoo#134206

X-original-commit: 144a22c22c95004171860cdaecd1f7d7975dc468
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 19:58:33 +00:00
Romain Derie 3b19a53191 [IMP] test_website: add a test for 308 redirect with multi url route
This commit introduces a test in Odoo 15 about a broken behavior in Odoo
16 which was not covered by a test.
A fix will be shipped alongside this commit forward-port in Odoo 16.

The behavior involved here is about:
- Having a multi-url defined route
- One of those URL not having a model converter
- One of those URL having a model converter
- Creating a 308 redirect for the URL without model converter

Something like this route (real example from the code):
```py
@http.route([
    '''/shop''',
    '''/shop/page/<int:page>''',
    '''/shop/category/<model("product.public.category"):category>''',
    '''/shop/category/<model("product.public.category"):category>/page/<int:page>'''
], type='http', auth="public", website=True, sitemap=sitemap_shop)
```
And this redirect (real usual example from clients):
```py
self.env['website.rewrite'].create({
    'name': 'Test Multi URL 308',
    'redirect_type': '308',
    'url_from': '/shop',
    'url_to': '/magasin',
})
```

In Odoo 15, everything will work as expected:
1. Accessing /shop will redirect to /magasin
2. Accessing /shop/category/categ-1 will not redirect and user will be
   on /shop/category/categ-1 still

But in Odoo 16:
In the case described above, acessing the URL with model converter from
the route will fail and redirect to a non slugified URL in the form of
`/some-url?param=test.model%287%2C%29` which is basically the
stringified encoded version of the record `test.model(7,)`.

Note:
- It doesn't matter if the route is contained in the other, the error
  will still occur even if `'''/shop'''` was `'''/abc'''`.
- Even if all URL from the route have their own 308 redirect, the error
  will still occur.
- It won't have any issue if there is a 308 on the route with model
  converter: both the one without model converter and other url with
  model converter will work and won't be impacted.

This might be because of a concept of "merging URL" from httpocalypse,
see https://github.com/odoo/odoo/commit/347a3ccf763cc6958d5dc1df3168c9c65245736c

opw-3450054
opw-3466498
opw-3477380
opw-3475694

X-original-commit: 22ca1c48f78cdf575f9a2b0823f9487f942bc7cd
Part-of: odoo/odoo#134206
2023-09-04 19:58:33 +00:00
Benoit Socias 679ede2c32 [FIX] website: get the name of the visitor through the related field
Since [1] if the partner related to a visitor belongs to a company that
cannot be accessed by the current user, an error is raised when trying
to display the list of visitors.

This commit makes the name obtained through an additional sudo on the
`partner_id` record which might not be accessible to the current user.
This is equivalent to using the `name` field of visitor, except that
accessing the `partner_id` field will fail if `website.visitor` itself
cannot be accessed.

Steps to reproduce:
- Go to Settings / Companies
- Create a second company
- Go to Website / Reporting / Visitors
- Select "Edwin Hansen"
- Navigate to its linked partner in the contact field
"Gemini Furniture, Edwin Hansen"
- Navigate to its company "Gemini Furniture"
- In the "Sales & Purchase" tab, assign the second company as the
Company
- Save (this creates an error - but it is saved)
- Go to Website / Reporting / Visitors

=> The page was not displayed and an access error message was
displayed.

[1]: https://github.com/odoo/odoo/commit/d348bed1ad9d3d16b295f013f015706be6c07820

opw-3462104

closes odoo/odoo#134190

X-original-commit: a75673217aef2ffaaa93585526dc1e647a270495
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 19:58:32 +00:00
Gabriel de Paula Felix (gdpf) 07f17b0c80 [FIX] microsoft_calendar: traceback restarting synchronizations
Before this commit, when restarting a synchronization with Outlook or Google, a traceback error could be thrown due when accessing a variable possibly null. After this commit, the variable integrity is checked before its access.

Issue from: 3473180

closes odoo/odoo#134181

X-original-commit: e7015b6c0cd2bd009184bfbc69730c211922658b
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
2023-09-04 19:58:31 +00:00
Ivan Yelizariev 602b3f3d39 [FIX] account: prevent reading fake binary fields over rpc
Since Odoo 16 [1] account module uses some non-storable computed Binary fields
to compute and access structured data. Those data is not transformed into binary
data and is not supposed to be used outside of server environment. There are
still use cases when ORM tries to process such fields as normal Binary fields.
For example, on using export wizard [2].

This commit fixes similar problem on reading `account.move{.line}` records via
rpc.

STEPS: create `account.move` record and read it via an RPC call [3]

```
account_move_id = 666
models.execute_kw(db, uid, password, 'account.move', 'read', [account_move_id])
```

SOLUTION

1. Add missing `exportable=False` to the fake Binary fields
2. Block access to such fields via method `check_field_access_rights`

[1]:
https://github.com/odoo/odoo/commit/d8d47f9ff8554f4b39487fd2f13c153c7d6f958d
[2]: https://github.com/odoo/odoo/commit/c925ecb2a22750524020f0d111888fd76eedb0cb
[3]: https://www.odoo.com/documentation/16.0/developer/api/external_api.html

opw-3099975

closes odoo/odoo#134164

X-original-commit: 5193d145b96e34ef1e754b8421cccd8c9dab99e7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-04 17:10:12 +00:00